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

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

Issue 872673007: Disable the noisiest /analyze warning in Chrome. ~3,700/12,000 (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Remove _PREFAST_ check. Created 5 years, 10 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 | « no previous file | no next file » | 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 /* 2 /*
3 * Copyright 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #ifndef SkMath_DEFINED 10 #ifndef SkMath_DEFINED
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 int SkCLZ_portable(uint32_t); 72 int SkCLZ_portable(uint32_t);
73 73
74 #ifndef SkCLZ 74 #ifndef SkCLZ
75 #if defined(_MSC_VER) && _MSC_VER >= 1400 75 #if defined(_MSC_VER) && _MSC_VER >= 1400
76 #include <intrin.h> 76 #include <intrin.h>
77 77
78 static inline int SkCLZ(uint32_t mask) { 78 static inline int SkCLZ(uint32_t mask) {
79 if (mask) { 79 if (mask) {
80 DWORD index; 80 DWORD index;
81 _BitScanReverse(&index, mask); 81 _BitScanReverse(&index, mask);
82 // Suppress this bogus /analyze warning. The check for non-zero
83 // guarantees that _BitScanReverse will succeed.
84 #pragma warning(suppress : 6102) // Using 'index' from failed function call
82 return index ^ 0x1F; 85 return index ^ 0x1F;
83 } else { 86 } else {
84 return 32; 87 return 32;
85 } 88 }
86 } 89 }
87 #elif defined(SK_CPU_ARM32) || defined(__GNUC__) || defined(__clang__) 90 #elif defined(SK_CPU_ARM32) || defined(__GNUC__) || defined(__clang__)
88 static inline int SkCLZ(uint32_t mask) { 91 static inline int SkCLZ(uint32_t mask) {
89 // __builtin_clz(0) is undefined, so we have to detect that case. 92 // __builtin_clz(0) is undefined, so we have to detect that case.
90 return mask ? __builtin_clz(mask) : 32; 93 return mask ? __builtin_clz(mask) : 32;
91 } 94 }
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 *div = static_cast<Out>(d); 223 *div = static_cast<Out>(d);
221 *mod = static_cast<Out>(numer-d*denom); 224 *mod = static_cast<Out>(numer-d*denom);
222 #else 225 #else
223 // On x86 this will just be a single idiv. 226 // On x86 this will just be a single idiv.
224 *div = static_cast<Out>(numer/denom); 227 *div = static_cast<Out>(numer/denom);
225 *mod = static_cast<Out>(numer%denom); 228 *mod = static_cast<Out>(numer%denom);
226 #endif 229 #endif
227 } 230 }
228 231
229 #endif 232 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698