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

Unified Diff: include/libyuv/cpu_id.h

Issue 1418253002: switch cpu flags to 0 for unitialized to avoid compare (Closed) Base URL: https://chromium.googlesource.com/libyuv/libyuv@master
Patch Set: bump chromium to lkgr Created 5 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « README.chromium ('k') | include/libyuv/version.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/libyuv/cpu_id.h
diff --git a/include/libyuv/cpu_id.h b/include/libyuv/cpu_id.h
index 6bb4a064a21c12814ee46efec7a20a0ae3b88b6c..52f49cbcb1a1d5c7d6297482dd1a05d912aed949 100644
--- a/include/libyuv/cpu_id.h
+++ b/include/libyuv/cpu_id.h
@@ -18,9 +18,8 @@ namespace libyuv {
extern "C" {
#endif
-// TODO(fbarchard): Consider overlapping bits for different architectures.
// Internal flag to indicate cpuid requires initialization.
-#define kCpuInit 0x1
+static const int kCpuInitialized = 0x1;
// These flags are only valid on ARM processors.
static const int kCpuHasARM = 0x2;
@@ -58,7 +57,7 @@ int ArmCpuCaps(const char* cpuinfo_name);
// returns non-zero if instruction set is detected
static __inline int TestCpuFlag(int test_flag) {
LIBYUV_API extern int cpu_info_;
- return (cpu_info_ == kCpuInit ? InitCpuFlags() : cpu_info_) & test_flag;
+ return (!cpu_info_ ? InitCpuFlags() : cpu_info_) & test_flag;
}
// For testing, allow CPU flags to be disabled.
« no previous file with comments | « README.chromium ('k') | include/libyuv/version.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698