summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@theqtcompany.com>2015-12-09 14:37:11 +0100
committerEdward Welbourne <edward.welbourne@theqtcompany.com>2015-12-15 16:40:15 +0000
commit935ddbd3a2350dd57978894b00d7a57a7488d571 (patch)
treeb5f225000c606634a1b3be257b432ff7030d77aa
parent5e7492325a745908e11403b1f729a840c180fc6c (diff)
downloadqtbase-935ddbd3a2350dd57978894b00d7a57a7488d571.tar.gz
qmake: simplify file-reading loop in findMocs
Change-Id: If436215c6041551782750f107021fcccbd447b32 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
-rw-r--r--qmake/generators/makefiledeps.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/qmake/generators/makefiledeps.cpp b/qmake/generators/makefiledeps.cpp
index 635a775cb3..037ad06ad3 100644
--- a/qmake/generators/makefiledeps.cpp
+++ b/qmake/generators/makefiledeps.cpp
@@ -872,7 +872,7 @@ bool QMakeSourceFileInfo::findMocs(SourceFile *file)
files_changed = true;
file->moc_checked = true;
- int buffer_len;
+ int buffer_len = 0;
char *buffer = 0;
{
struct stat fst;
@@ -890,9 +890,9 @@ bool QMakeSourceFileInfo::findMocs(SourceFile *file)
return false; //shouldn't happen
}
buffer = getBuffer(fst.st_size);
- for(int have_read = buffer_len = 0;
- (have_read = QT_READ(fd, buffer + buffer_len, fst.st_size - buffer_len));
- buffer_len += have_read) ;
+ while (int have_read = QT_READ(fd, buffer + buffer_len, fst.st_size - buffer_len))
+ buffer_len += have_read;
+
QT_CLOSE(fd);
}