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

Side by Side Diff: minidump/minidump_module_writer.cc

Issue 700383007: Use implicit_cast<> instead of static_cast<> whenever possible (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Created 6 years, 1 month 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
OLDNEW
1 // Copyright 2014 The Crashpad Authors. All rights reserved. 1 // Copyright 2014 The Crashpad Authors. All rights reserved.
2 // 2 //
3 // Licensed under the Apache License, Version 2.0 (the "License"); 3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License. 4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at 5 // You may obtain a copy of the License at
6 // 6 //
7 // http://www.apache.org/licenses/LICENSE-2.0 7 // http://www.apache.org/licenses/LICENSE-2.0
8 // 8 //
9 // Unless required by applicable law or agreed to in writing, software 9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS, 10 // distributed under the License is distributed on an "AS IS" BASIS,
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 internal::MinidumpWriterUtil::AssignTimeT(&module_.TimeDateStamp, timestamp); 286 internal::MinidumpWriterUtil::AssignTimeT(&module_.TimeDateStamp, timestamp);
287 } 287 }
288 288
289 void MinidumpModuleWriter::SetFileVersion(uint16_t version_0, 289 void MinidumpModuleWriter::SetFileVersion(uint16_t version_0,
290 uint16_t version_1, 290 uint16_t version_1,
291 uint16_t version_2, 291 uint16_t version_2,
292 uint16_t version_3) { 292 uint16_t version_3) {
293 DCHECK_EQ(state(), kStateMutable); 293 DCHECK_EQ(state(), kStateMutable);
294 294
295 module_.VersionInfo.dwFileVersionMS = 295 module_.VersionInfo.dwFileVersionMS =
296 (static_cast<uint32_t>(version_0) << 16) | version_1; 296 (implicit_cast<uint32_t>(version_0) << 16) | version_1;
297 module_.VersionInfo.dwFileVersionLS = 297 module_.VersionInfo.dwFileVersionLS =
298 (static_cast<uint32_t>(version_2) << 16) | version_3; 298 (implicit_cast<uint32_t>(version_2) << 16) | version_3;
299 } 299 }
300 300
301 void MinidumpModuleWriter::SetProductVersion(uint16_t version_0, 301 void MinidumpModuleWriter::SetProductVersion(uint16_t version_0,
302 uint16_t version_1, 302 uint16_t version_1,
303 uint16_t version_2, 303 uint16_t version_2,
304 uint16_t version_3) { 304 uint16_t version_3) {
305 DCHECK_EQ(state(), kStateMutable); 305 DCHECK_EQ(state(), kStateMutable);
306 306
307 module_.VersionInfo.dwProductVersionMS = 307 module_.VersionInfo.dwProductVersionMS =
308 (static_cast<uint32_t>(version_0) << 16) | version_1; 308 (implicit_cast<uint32_t>(version_0) << 16) | version_1;
309 module_.VersionInfo.dwProductVersionLS = 309 module_.VersionInfo.dwProductVersionLS =
310 (static_cast<uint32_t>(version_2) << 16) | version_3; 310 (implicit_cast<uint32_t>(version_2) << 16) | version_3;
311 } 311 }
312 312
313 void MinidumpModuleWriter::SetFileFlagsAndMask(uint32_t file_flags, 313 void MinidumpModuleWriter::SetFileFlagsAndMask(uint32_t file_flags,
314 uint32_t file_flags_mask) { 314 uint32_t file_flags_mask) {
315 DCHECK_EQ(state(), kStateMutable); 315 DCHECK_EQ(state(), kStateMutable);
316 DCHECK_EQ(file_flags & ~file_flags_mask, 0u); 316 DCHECK_EQ(file_flags & ~file_flags_mask, 0u);
317 317
318 module_.VersionInfo.dwFileFlags = file_flags; 318 module_.VersionInfo.dwFileFlags = file_flags;
319 module_.VersionInfo.dwFileFlagsMask = file_flags_mask; 319 module_.VersionInfo.dwFileFlagsMask = file_flags_mask;
320 } 320 }
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
448 } 448 }
449 449
450 return file_writer->WriteIoVec(&iovecs); 450 return file_writer->WriteIoVec(&iovecs);
451 } 451 }
452 452
453 MinidumpStreamType MinidumpModuleListWriter::StreamType() const { 453 MinidumpStreamType MinidumpModuleListWriter::StreamType() const {
454 return kMinidumpStreamTypeModuleList; 454 return kMinidumpStreamTypeModuleList;
455 } 455 }
456 456
457 } // namespace crashpad 457 } // namespace crashpad
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698