aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/private
diff options
context:
space:
mode:
authorGravatar caryclark <caryclark@google.com>2016-02-26 05:01:42 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-02-26 05:01:42 -0800
commit952538ed50661ad7dff6ec2b7af3f921e1d91b52 (patch)
tree5f5d4f9ee52a24fe164ca6fc32dcf293f4cbc0c5 /include/private
parent82e26bf23923f20828c850d1a0e01d8bde69cfff (diff)
fix undefined signed shifts
The expression (1 << 31) is technically undefined. Fixed the undefined shift referenced by this bug and a few friends. R=reed@google.com BUG=skia:2285 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1737363002 Review URL: https://codereview.chromium.org/1737363002
Diffstat (limited to 'include/private')
-rw-r--r--include/private/SkFloatBits.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/private/SkFloatBits.h b/include/private/SkFloatBits.h
index 3ddb9ef564..caad342a4a 100644
--- a/include/private/SkFloatBits.h
+++ b/include/private/SkFloatBits.h
@@ -32,7 +32,7 @@ static inline int32_t Sk2sComplimentToSignBit(int32_t x) {
// make x positive
x = (x ^ sign) - sign;
// set the sign bit as needed
- x |= sign << 31;
+ x |= SkLeftShift(sign, 31);
return x;
}