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

Side by Side Diff: include/core/SkTypes.h

Issue 1737363002: fix undefined signed shifts (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: try again on nan Created 4 years, 9 months 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 | « include/core/SkCanvas.h ('k') | include/private/SkFloatBits.h » ('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 2006 The Android Open Source Project 2 * Copyright 2006 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 SkTypes_DEFINED 8 #ifndef SkTypes_DEFINED
9 #define SkTypes_DEFINED 9 #define SkTypes_DEFINED
10 10
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 #define SkToBool(cond) ((cond) != 0) 283 #define SkToBool(cond) ((cond) != 0)
284 284
285 #define SK_MaxS16 32767 285 #define SK_MaxS16 32767
286 #define SK_MinS16 -32767 286 #define SK_MinS16 -32767
287 #define SK_MaxU16 0xFFFF 287 #define SK_MaxU16 0xFFFF
288 #define SK_MinU16 0 288 #define SK_MinU16 0
289 #define SK_MaxS32 0x7FFFFFFF 289 #define SK_MaxS32 0x7FFFFFFF
290 #define SK_MinS32 -SK_MaxS32 290 #define SK_MinS32 -SK_MaxS32
291 #define SK_MaxU32 0xFFFFFFFF 291 #define SK_MaxU32 0xFFFFFFFF
292 #define SK_MinU32 0 292 #define SK_MinU32 0
293 #define SK_NaN32 (1 << 31) 293 #define SK_NaN32 ((int) (1U << 31))
294 294
295 /** Returns true if the value can be represented with signed 16bits 295 /** Returns true if the value can be represented with signed 16bits
296 */ 296 */
297 static inline bool SkIsS16(long x) { 297 static inline bool SkIsS16(long x) {
298 return (int16_t)x == x; 298 return (int16_t)x == x;
299 } 299 }
300 300
301 /** Returns true if the value can be represented with unsigned 16bits 301 /** Returns true if the value can be represented with unsigned 16bits
302 */ 302 */
303 static inline bool SkIsU16(long x) { 303 static inline bool SkIsU16(long x) {
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
706 706
707 void* fPtr; 707 void* fPtr;
708 size_t fSize; // can be larger than the requested size (see kReuse) 708 size_t fSize; // can be larger than the requested size (see kReuse)
709 uint32_t fStorage[kSize >> 2]; 709 uint32_t fStorage[kSize >> 2];
710 }; 710 };
711 // Can't guard the constructor because it's a template class. 711 // Can't guard the constructor because it's a template class.
712 712
713 #endif /* C++ */ 713 #endif /* C++ */
714 714
715 #endif 715 #endif
OLDNEW
« no previous file with comments | « include/core/SkCanvas.h ('k') | include/private/SkFloatBits.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698