]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Add 0 initializers to static variables 656/head
authorSean Purcell <me@seanp.xyz>
Thu, 13 Apr 2017 23:34:28 +0000 (16:34 -0700)
committerSean Purcell <me@seanp.xyz>
Thu, 13 Apr 2017 23:34:28 +0000 (16:34 -0700)
programs/util.h

index a50b5e55b6704f3c38b3388e59be719c376aedee..b989e8232a6edca165f8153299968767158446ba 100644 (file)
@@ -498,7 +498,7 @@ typedef BOOL(WINAPI* LPFN_GLPI)(PSYSTEM_LOGICAL_PROCESSOR_INFORMATION, PDWORD);
 
 UTIL_STATIC int UTIL_countPhysicalCores(void)
 {
-    static int numPhysicalCores;
+    static int numPhysicalCores = 0;
     if (numPhysicalCores != 0) return numPhysicalCores;
 
     {   LPFN_GLPI glpi;
@@ -571,7 +571,7 @@ failed:
  * see: man 3 sysctl */
 UTIL_STATIC int UTIL_countPhysicalCores(void)
 {
-    static S32 numPhysicalCores; /* apple specifies int32_t */
+    static S32 numPhysicalCores = 0; /* apple specifies int32_t */
     if (numPhysicalCores != 0) return numPhysicalCores;
 
     {   size_t size = sizeof(S32);
@@ -597,7 +597,7 @@ UTIL_STATIC int UTIL_countPhysicalCores(void)
  * otherwise fall back on sysconf */
 UTIL_STATIC int UTIL_countPhysicalCores(void)
 {
-    static int numPhysicalCores;
+    static int numPhysicalCores = 0;
 
     if (numPhysicalCores != 0) return numPhysicalCores;