90
90
case 'c' :
91
91
if (argc != 3 ) {
92
92
chars = snprintf (msg , sizeof (msg ) - 1 ,
93
- "usage: %s -c <compiler option>\n"
93
+ "usage: %s -c <compiler option>\n"
94
94
"Tests for whether cl.exe supports an option\n"
95
95
"exitcodes: 0 == no, 1 == yes, 2 == error\n" , argv [0 ]);
96
96
WriteFile (GetStdHandle (STD_ERROR_HANDLE ), msg , chars ,
@@ -101,7 +101,7 @@ main(
101
101
case 'l' :
102
102
if (argc < 3 ) {
103
103
chars = snprintf (msg , sizeof (msg ) - 1 ,
104
- "usage: %s -l <linker option> ?<mandatory option> ...?\n"
104
+ "usage: %s -l <linker option> ?<mandatory option> ...?\n"
105
105
"Tests for whether link.exe supports an option\n"
106
106
"exitcodes: 0 == no, 1 == yes, 2 == error\n" , argv [0 ]);
107
107
WriteFile (GetStdHandle (STD_ERROR_HANDLE ), msg , chars ,
@@ -271,7 +271,7 @@ CheckForCompilerFeature(
271
271
if (!ok ) {
272
272
DWORD err = GetLastError ();
273
273
int chars = snprintf (msg , sizeof (msg ) - 1 ,
274
- "Tried to launch: \"%s\", but got error [%lu ]: " , cmdline , err );
274
+ "Tried to launch: \"%s\", but got error [%u ]: " , cmdline , err );
275
275
276
276
FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM |FORMAT_MESSAGE_IGNORE_INSERTS |
277
277
FORMAT_MESSAGE_MAX_WIDTH_MASK , 0L , err , 0 , (LPSTR )& msg [chars ],
@@ -318,11 +318,11 @@ CheckForCompilerFeature(
318
318
*/
319
319
320
320
return !(strstr (Out .buffer , "D4002" ) != NULL
321
- || strstr (Err .buffer , "D4002" ) != NULL
322
- || strstr (Out .buffer , "D9002" ) != NULL
323
- || strstr (Err .buffer , "D9002" ) != NULL
324
- || strstr (Out .buffer , "D2021" ) != NULL
325
- || strstr (Err .buffer , "D2021" ) != NULL );
321
+ || strstr (Err .buffer , "D4002" ) != NULL
322
+ || strstr (Out .buffer , "D9002" ) != NULL
323
+ || strstr (Err .buffer , "D9002" ) != NULL
324
+ || strstr (Out .buffer , "D2021" ) != NULL
325
+ || strstr (Err .buffer , "D2021" ) != NULL );
326
326
}
327
327
328
328
static int
@@ -405,7 +405,7 @@ CheckForLinkerFeature(
405
405
if (!ok ) {
406
406
DWORD err = GetLastError ();
407
407
int chars = snprintf (msg , sizeof (msg ) - 1 ,
408
- "Tried to launch: \"%s\", but got error [%lu ]: " , cmdline , err );
408
+ "Tried to launch: \"%s\", but got error [%u ]: " , cmdline , err );
409
409
410
410
FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM |FORMAT_MESSAGE_IGNORE_INSERTS |
411
411
FORMAT_MESSAGE_MAX_WIDTH_MASK , 0L , err , 0 , (LPSTR )& msg [chars ],
@@ -493,9 +493,9 @@ IsIn(
493
493
494
494
/*
495
495
* GetVersionFromFile --
496
- * Looks for a match string in a file and then returns the version
497
- * following the match where a version is anything acceptable to
498
- * package provide or package ifneeded.
496
+ * Looks for a match string in a file and then returns the version
497
+ * following the match where a version is anything acceptable to
498
+ * package provide or package ifneeded.
499
499
*/
500
500
501
501
static const char *
@@ -600,9 +600,9 @@ list_free(list_item_t **listPtrPtr)
600
600
*
601
601
* Usage is something like:
602
602
* nmakehlp -S << $** > $@
603
- * @PACKAGE_NAME@ $(PACKAGE_NAME)
604
- * @PACKAGE_VERSION@ $(PACKAGE_VERSION)
605
- * <<
603
+ * @PACKAGE_NAME@ $(PACKAGE_NAME)
604
+ * @PACKAGE_VERSION@ $(PACKAGE_VERSION)
605
+ * <<
606
606
*/
607
607
608
608
static int
@@ -747,8 +747,9 @@ static int LocateDependencyHelper(const char *dir, const char *keypath)
747
747
#else
748
748
hSearch = FindFirstFile (path , & finfo );
749
749
#endif
750
- if (hSearch == INVALID_HANDLE_VALUE )
750
+ if (hSearch == INVALID_HANDLE_VALUE ) {
751
751
return 1 ; /* Not found */
752
+ }
752
753
753
754
/* Loop through all subdirs checking if the keypath is under there */
754
755
ret = 1 ; /* Assume not found */
@@ -758,11 +759,13 @@ static int LocateDependencyHelper(const char *dir, const char *keypath)
758
759
* We need to check it is a directory despite the
759
760
* FindExSearchLimitToDirectories in the above call. See SDK docs
760
761
*/
761
- if ((finfo .dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY ) == 0 )
762
+ if ((finfo .dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY ) == 0 ) {
762
763
continue ;
764
+ }
763
765
sublen = strlen (finfo .cFileName );
764
- if ((dirlen + 1 + sublen + 1 + keylen + 1 ) > sizeof (path ))
766
+ if ((dirlen + 1 + sublen + 1 + keylen + 1 ) > sizeof (path )) {
765
767
continue ; /* Path does not fit, assume not matched */
768
+ }
766
769
strncpy (path + dirlen + 1 , finfo .cFileName , sublen );
767
770
path [dirlen + 1 + sublen ] = '\\' ;
768
771
strncpy (path + dirlen + 1 + sublen + 1 , keypath , keylen + 1 );
@@ -782,13 +785,13 @@ static int LocateDependencyHelper(const char *dir, const char *keypath)
782
785
* LocateDependency --
783
786
*
784
787
* Locates a dependency for a package.
785
- * keypath - a relative path within the package directory
786
- * that is used to confirm it is the correct directory.
788
+ * keypath - a relative path within the package directory
789
+ * that is used to confirm it is the correct directory.
787
790
* The search path for the package directory is currently only
788
- * the parent and grandparent of the current working directory.
789
- * If found, the command prints
790
- * name_DIRPATH=<full path of located directory>
791
- * and returns 0. If not found, does not print anything and returns 1.
791
+ * the parent and grandparent of the current working directory.
792
+ * If found, the command prints
793
+ * name_DIRPATH=<full path of located directory>
794
+ * and returns 0. If not found, does not print anything and returns 1.
792
795
*/
793
796
static int LocateDependency (const char * keypath )
794
797
{
0 commit comments