Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2239)

Unified Diff: chrome/browser/privacy_blacklist/blacklist_store.cc

Issue 155625: A build fix for GCC 4.3.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/privacy_blacklist/blacklist_store.cc
===================================================================
--- chrome/browser/privacy_blacklist/blacklist_store.cc (revision 20820)
+++ chrome/browser/privacy_blacklist/blacklist_store.cc (working copy)
@@ -13,20 +13,26 @@
const char cookie[] = "GCPBL100";
+// This is a wrapper function for fwrite() to avoid warnings of GCC 4.4.
+void WriteData(const char* data, size_t size, size_t items, FILE* stream) {
+ if (fwrite(data, size, items, stream) != size * items)
+ return;
Evan Martin 2009/07/17 17:15:49 Should this LOG(WARNING) ?
}
+}
+
void BlacklistStoreOutput::WriteUInt(uint32 i) {
- fwrite(reinterpret_cast<char*>(&i), 1, sizeof(uint32), file_);
+ WriteData(reinterpret_cast<char*>(&i), 1, sizeof(uint32), file_);
}
void BlacklistStoreOutput::WriteString(const std::string& s) {
uint32 n = s.size();
- fwrite(reinterpret_cast<char*>(&n), 1, sizeof(uint32), file_);
- fwrite(s.c_str(), 1, s.size(), file_);
+ WriteData(reinterpret_cast<char*>(&n), 1, sizeof(uint32), file_);
+ WriteData(s.c_str(), 1, s.size(), file_);
}
BlacklistStoreOutput::BlacklistStoreOutput(FILE* file) : file_(file) {
- fwrite(cookie, 1, sizeof(cookie), file_);
+ WriteData(cookie, 1, sizeof(cookie), file_);
}
BlacklistStoreOutput::~BlacklistStoreOutput() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698