Don't initialize the first parameter of _BitScanReverse* functions

Like the document example, no need to initialize `r` to 0.
https://docs.microsoft.com/en-us/cpp/intrinsics/bitscanreverse-bitscanreverse64
This commit is contained in:
Ma Lin
2021-09-25 16:36:53 +08:00
parent cc22042da0
commit 95f492ea17
11 changed files with 21 additions and 30 deletions
+1 -1
View File
@@ -145,7 +145,7 @@ MEM_STATIC unsigned BIT_highbit32 (U32 val)
# if STATIC_BMI2 == 1
return _lzcnt_u32(val) ^ 31;
# else
unsigned long r = 0;
unsigned long r;
return _BitScanReverse(&r, val) ? (unsigned)r : 0;
# endif
# elif defined(__GNUC__) && (__GNUC__ >= 3) /* Use GCC Intrinsic */
+1 -1
View File
@@ -358,7 +358,7 @@ MEM_STATIC U32 ZSTD_highbit32(U32 val) /* compress, dictBuilder, decodeCorpus
# if STATIC_BMI2 == 1
return _lzcnt_u32(val)^31;
# else
unsigned long r=0;
unsigned long r;
return _BitScanReverse(&r, val) ? (unsigned)r : 0;
# endif
# elif defined(__GNUC__) && (__GNUC__ >= 3) /* GCC Intrinsic */