diff options
author | zhurunz@google.com <zhurunz@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-04 00:40:26 +0000 |
---|---|---|
committer | zhurunz@google.com <zhurunz@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-04 00:40:26 +0000 |
commit | 5e927a8f537c78e60cbf0ede35db698cb9950108 (patch) | |
tree | 352c409faa54b09ad588e704357e700c558cd523 /o3d/import | |
parent | 40f1abab4402613d3cd90ff690aa83bf02f50d5d (diff) | |
download | chromium_src-5e927a8f537c78e60cbf0ede35db698cb9950108.zip chromium_src-5e927a8f537c78e60cbf0ede35db698cb9950108.tar.gz chromium_src-5e927a8f537c78e60cbf0ede35db698cb9950108.tar.bz2 |
Small changes to make GCC 4.4.1 happy.
Review URL: http://codereview.chromium.org/1908003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46306 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d/import')
-rw-r--r-- | o3d/import/cross/archive_processor.cc | 6 | ||||
-rw-r--r-- | o3d/import/cross/raw_data.cc | 4 |
2 files changed, 7 insertions, 3 deletions
diff --git a/o3d/import/cross/archive_processor.cc b/o3d/import/cross/archive_processor.cc index e400cf1..674579f 100644 --- a/o3d/import/cross/archive_processor.cc +++ b/o3d/import/cross/archive_processor.cc @@ -75,8 +75,10 @@ StreamProcessor::Status ArchiveProcessor::ProcessFile(const char *filename) { // progressive streaming system FILE *fp = fopen(filename, "rb"); if (!fp) return FAILURE; // can't open file! - fread(p, sizeof(uint8), file_length, fp); - fclose(fp); + if (static_cast<size_t>(file_length) != + fread(p, sizeof(uint8), file_length, fp)) + return FAILURE; + if (0 != fclose(fp)) return FAILURE; MemoryReadStream stream(p, file_length); diff --git a/o3d/import/cross/raw_data.cc b/o3d/import/cross/raw_data.cc index 91e2bc6..2cc8d7f 100644 --- a/o3d/import/cross/raw_data.cc +++ b/o3d/import/cross/raw_data.cc @@ -306,7 +306,9 @@ void RawData::Flush() { FILE *tempfile = file_util::OpenFile(temp_filepath_, "wb"); if (tempfile) { - fwrite(data_.get(), 1, GetLength(), tempfile); + if (GetLength() != fwrite(data_.get(), 1, GetLength(), tempfile)) { + DLOG(ERROR) << "error writing cached data file"; + } file_util::CloseFile(tempfile); // Now that the data is cached, free it |