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

Side by Side Diff: tools/ipc_fuzzer/message_lib/message_file_writer.cc

Issue 115673002: Fix linux/gcc compiler warnings in tools/ipc_fuzzer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tools/ipc_fuzzer/message_lib/message_file_format.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <limits.h> 5 #include <limits.h>
6 #include <set> 6 #include <set>
7 7
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/platform_file.h" 9 #include "base/platform_file.h"
10 #include "tools/ipc_fuzzer/message_lib/message_file.h" 10 #include "tools/ipc_fuzzer/message_lib/message_file.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 return false; 72 return false;
73 } 73 }
74 return true; 74 return true;
75 } 75 }
76 76
77 bool Writer::WriteBlob(const void *buffer, size_t size) { 77 bool Writer::WriteBlob(const void *buffer, size_t size) {
78 if (size > INT_MAX) 78 if (size > INT_MAX)
79 return false; 79 return false;
80 const char* char_buffer = static_cast<const char*>(buffer); 80 const char* char_buffer = static_cast<const char*>(buffer);
81 int ret = base::WritePlatformFileAtCurrentPos(file_, char_buffer, size); 81 int ret = base::WritePlatformFileAtCurrentPos(file_, char_buffer, size);
82 if (ret != size) { 82 if (ret != static_cast<int>(size)) {
83 LOG(ERROR) << "Failed to write " << size << " bytes."; 83 LOG(ERROR) << "Failed to write " << size << " bytes.";
84 return false; 84 return false;
85 } 85 }
86 return true; 86 return true;
87 } 87 }
88 88
89 bool Writer::CollectMessageTypes() { 89 bool Writer::CollectMessageTypes() {
90 for (size_t i = 0; i < messages_->size(); ++i) { 90 for (size_t i = 0; i < messages_->size(); ++i) {
91 uint32_t type = (*messages_)[i]->type(); 91 uint32_t type = (*messages_)[i]->type();
92 if (!MessageNames::GetInstance()->TypeExists(type)) { 92 if (!MessageNames::GetInstance()->TypeExists(type)) {
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 167
168 } // namespace 168 } // namespace
169 169
170 bool MessageFile::Write(const base::FilePath& path, 170 bool MessageFile::Write(const base::FilePath& path,
171 const MessageVector& messages) { 171 const MessageVector& messages) {
172 Writer writer(path); 172 Writer writer(path);
173 return writer.Write(messages); 173 return writer.Write(messages);
174 } 174 }
175 175
176 } // namespace ipc_fuzzer 176 } // namespace ipc_fuzzer
OLDNEW
« no previous file with comments | « tools/ipc_fuzzer/message_lib/message_file_format.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698