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

Unified Diff: base/file_util_win.cc

Issue 2081007: Enable warning 4389 as an error on windows builds. This will make... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 7 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 | « base/event_trace_provider_win_unittest.cc ('k') | base/iat_patch.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/file_util_win.cc
===================================================================
--- base/file_util_win.cc (revision 48060)
+++ base/file_util_win.cc (working copy)
@@ -656,15 +656,11 @@
if (file == INVALID_HANDLE_VALUE)
return -1;
- int ret_value;
DWORD read;
- if (::ReadFile(file, data, size, &read, NULL) && read == size) {
- ret_value = static_cast<int>(read);
- } else {
- ret_value = -1;
- }
-
- return ret_value;
+ if (::ReadFile(file, data, size, &read, NULL) &&
+ static_cast<int>(read) == size)
+ return read;
+ return -1;
}
int WriteFile(const FilePath& filename, const char* data, int size) {
@@ -684,8 +680,8 @@
DWORD written;
BOOL result = ::WriteFile(file, data, size, &written, NULL);
- if (result && written == size)
- return static_cast<int>(written);
+ if (result && static_cast<int>(written) == size)
+ return written;
if (!result) {
// WriteFile failed.
« no previous file with comments | « base/event_trace_provider_win_unittest.cc ('k') | base/iat_patch.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698