]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
fixed shadowing of stat variable
authorYann Collet <cyan@fb.com>
Thu, 20 Dec 2018 22:56:44 +0000 (14:56 -0800)
committerYann Collet <cyan@fb.com>
Thu, 20 Dec 2018 22:56:44 +0000 (14:56 -0800)
some standard lib declares a `stat` variable at global scope
shadowing local declarations ....

lib/compress/zstd_compress_internal.h

index 8111fb2260b368ff5c9b67390930e4e7f7507a46..798dad14f01ab92661542bd5112a51e7f0dd9760 100644 (file)
@@ -751,10 +751,10 @@ MEM_STATIC double ZSTD_fWeight(U32 rawStat)
 {
     U32 const fp_accuracy = 8;
     U32 const fp_multiplier = (1 << fp_accuracy);
-    U32 const stat = rawStat + 1;
-    U32 const hb = ZSTD_highbit32(stat);
+    U32 const newStat = rawStat + 1;
+    U32 const hb = ZSTD_highbit32(newStat);
     U32 const BWeight = hb * fp_multiplier;
-    U32 const FWeight = (stat << fp_accuracy) >> hb;
+    U32 const FWeight = (newStat << fp_accuracy) >> hb;
     U32 const weight = BWeight + FWeight;
     assert(hb + fp_accuracy < 31);
     return (double)weight / fp_multiplier;