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

Side by Side Diff: src/ports/SkFontMgr_android_parser.h

Issue 1503423003: ubsan shift fixes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add cast to work around win compiler Created 5 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
« no previous file with comments | « src/pathops/SkOpAngle.cpp ('k') | src/utils/SkDashPath.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2011 The Android Open Source Project 2 * Copyright 2011 The Android Open Source Project
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef SkFontMgr_android_parser_DEFINED 8 #ifndef SkFontMgr_android_parser_DEFINED
9 #define SkFontMgr_android_parser_DEFINED 9 #define SkFontMgr_android_parser_DEFINED
10 10
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 // Check for overflow 204 // Check for overflow
205 if (n > nMax || (n == nMax && d > dMax)) { 205 if (n > nMax || (n == nMax && d > dMax)) {
206 return false; 206 return false;
207 } 207 }
208 n = (n * 10) + d; 208 n = (n * 10) + d;
209 } 209 }
210 if (negate) { 210 if (negate) {
211 n = -n; 211 n = -n;
212 frac = -frac; 212 frac = -frac;
213 } 213 }
214 *value = (n << N) + frac; 214 *value = SkLeftShift(n, N) + frac;
215 return true; 215 return true;
216 } 216 }
217 217
218 #endif /* SkFontMgr_android_parser_DEFINED */ 218 #endif /* SkFontMgr_android_parser_DEFINED */
OLDNEW
« no previous file with comments | « src/pathops/SkOpAngle.cpp ('k') | src/utils/SkDashPath.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698