Commit e3ee14ea authored by pkasting@chromium.org's avatar pkasting@chromium.org

Fixes for re-enabling more MSVC level 4 warnings: misc edition #3

This contains fixes for the following sorts of issues:
* Signedness mismatch
* Possibly-uninitialized local variable

These are the warnings that have appeared in the codebase since I began
uploading my first cleanup pass a few weeks ago.

BUG=81439
TEST=none

Review URL: https://codereview.chromium.org/400313002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@284378 0039d316-1c4b-4281-b951-d872f2087c98
parent d34824ba
......@@ -31,7 +31,7 @@ namespace {
SurfaceId InvalidSurfaceId() {
static SurfaceId invalid;
invalid.id = -1;
invalid.id = static_cast<uint64_t>(-1);
return invalid;
}
......
......@@ -362,13 +362,12 @@ ParentIDAndTitle MetadataDatabaseIndexOnDisk::PickMultiBackingFilePath() const {
return ParentIDAndTitle();
size_t pos = value.find('\0'); // '\0' is a separator.
int64 parent_id;
if (pos == std::string::npos ||
!base::StringToInt64(value.substr(0, pos), &parent_id))
if (pos == std::string::npos)
return ParentIDAndTitle();
// Successfully found an entry.
return ParentIDAndTitle(parent_id, value.substr(pos + 1));
int64 parent_id;
return base::StringToInt64(value.substr(0, pos), &parent_id) ?
ParentIDAndTitle(parent_id, value.substr(pos + 1)) : ParentIDAndTitle();
}
int64 MetadataDatabaseIndexOnDisk::PickDirtyTracker() const {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment