diff options
author | brucedawson <brucedawson@chromium.org> | 2016-03-31 05:53:44 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-31 05:53:44 -0700 |
commit | cce19c821ce0a76886078c6df24fba57fd2f12de (patch) | |
tree | 116fee35a6ea805fa39c8cd107cf784c65396273 /bench/FSRectBench.cpp | |
parent | 142659c76dfca1e0a34eb6a022329b73b6ba3166 (diff) |
Fix C4334 warning about 32-bit shift assigned to 64-bits
VS 2015 has a new or louder warning about 32-bit shifts that are then
assigned to a 64-bit target. This type of code triggers it:
int64_t size = 1 << shift_amount;
Because the '1' being shifted is a 32-bit int the result of the shift
will be a 32-bit result, so assigning it to a 64-bit variable is just
misleading.
In this case the code that triggers it is this:
size_t alloc = 1<<fLgSize++;
The destination is a size_t so the warning only shows up on 64-bit
builds and doesn't indicate a real bug. But, casting the '1' constant
to size_t makes the behavior/intent more obvious and consistent and
allows enabling C4334 in Chromium.
BUG=593448
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1845123002
Review URL: https://codereview.chromium.org/1845123002
Diffstat (limited to 'bench/FSRectBench.cpp')
0 files changed, 0 insertions, 0 deletions