]> git.ipfire.org Git - thirdparty/make.git/commitdiff
Clean up a few Windows build warnings (not all!)
authorPaul Smith <psmith@gnu.org>
Mon, 6 Sep 2021 01:07:14 +0000 (21:07 -0400)
committerPaul Smith <psmith@gnu.org>
Mon, 6 Sep 2021 01:09:27 +0000 (21:09 -0400)
* build_w32.bat: Quote uses of %VSWHERE% so it can contain spaces
* src/hash.c (hash_init): Avoid use of an undefined struct.
(hash_rehash): Ditto.
* src/vpath.c (construct_vpath_list): Cast explicitly to void*.

build_w32.bat
src/hash.c
src/vpath.c

index da770223b24f28f959bb1130afff0e38f0929c60..17066d7265a8476cb52b6a84e5a6bb503feb7397 100755 (executable)
@@ -100,7 +100,7 @@ if not ERRORLEVEL 1 goto FoundMSVC
 call :FindVswhere\r
 if ERRORLEVEL 1 goto LegacyVS\r
 \r
-for /f "tokens=* usebackq" %%i in (`%VSWHERE% -latest -property installationPath`) do (\r
+for /f "tokens=* usebackq" %%i in (`"%VSWHERE%" -latest -property installationPath`) do (\r
     set InstallPath=%%i\r
 )\r
 set "VSVARS=%InstallPath%\VC\Auxiliary\Build\vcvarsall.bat"\r
@@ -404,10 +404,10 @@ goto :EOF
 \r
 :FindVswhere\r
 set VSWHERE=vswhere\r
-%VSWHERE% -help >nul 2>&1\r
+"%VSWHERE%" -help >nul 2>&1\r
 if not ERRORLEVEL 1 exit /b 0\r
 set "VSWHERE=C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere"\r
-%VSWHERE% -help >nul 2>&1\r
+"%VSWHERE%" -help >nul 2>&1\r
 if ERRORLEVEL 1 exit /b 1\r
 goto :EOF\r
 \r
index 004097d0aa263be049da7b276f12a349775f7e9a..beda7656916c4105e34bb6555bc6655ccdb2ecd2 100644 (file)
@@ -44,11 +44,11 @@ hash_init (struct hash_table *ht, unsigned long size,
 {
   ht->ht_size = round_up_2 (size);
   ht->ht_empty_slots = ht->ht_size;
-  ht->ht_vec = (void**) CALLOC (struct token *, ht->ht_size);
+  ht->ht_vec = CALLOC (void *, ht->ht_size);
   if (ht->ht_vec == 0)
     {
       fprintf (stderr, _("can't allocate %lu bytes for hash table: memory exhausted"),
-               ht->ht_size * (unsigned long) sizeof (struct token *));
+               ht->ht_size * (unsigned long) sizeof (void *));
       exit (MAKE_TROUBLE);
     }
 
@@ -260,7 +260,7 @@ hash_rehash (struct hash_table *ht)
       ht->ht_capacity = ht->ht_size - (ht->ht_size >> 4);
     }
   ht->ht_rehashes++;
-  ht->ht_vec = (void **) CALLOC (struct token *, ht->ht_size);
+  ht->ht_vec = CALLOC (void *, ht->ht_size);
 
   for (ovp = old_vec; ovp < &old_vec[old_ht_size]; ovp++)
     {
index d4e7dc73f7b5558fd7bd4d714e74ba1c20497e13..caa09f0429c2e44fc55c94be63aa75928b186ffd 100644 (file)
@@ -277,7 +277,7 @@ construct_vpath_list (char *pattern, char *dirpath)
          entry, to where the nil-pointer terminator goes.
          Usually this is maxelem - 1.  If not, shrink down.  */
       if (elem < (maxelem - 1))
-        vpath = xrealloc (vpath, (elem+1) * sizeof (const char *));
+        vpath = xrealloc ((void *)vpath, (elem+1) * sizeof (const char *));
 
       /* Put the nil-pointer terminator on the end of the VPATH list.  */
       vpath[elem] = NULL;