@@ -913,7 +913,7 @@ static bool do_merge(int argc, char *argv[])
913
913
return ok && !error_check ();
914
914
}
915
915
916
- static bool is_circular ()
916
+ static bool is_circular (void )
917
917
{
918
918
struct list_head * cur = current -> q -> next ;
919
919
struct list_head * fast = (cur ) ? cur -> next : NULL ;
@@ -1056,7 +1056,7 @@ static bool do_next(int argc, char *argv[])
1056
1056
return q_show (0 );
1057
1057
}
1058
1058
1059
- static void console_init ()
1059
+ static void console_init (void )
1060
1060
{
1061
1061
ADD_COMMAND (new , "Create new queue" , "" );
1062
1062
ADD_COMMAND (free , "Delete queue" , "" );
@@ -1125,7 +1125,7 @@ static void sigalrm_handler(int sig)
1125
1125
"code is too inefficient" );
1126
1126
}
1127
1127
1128
- static void q_init ()
1128
+ static void q_init (void )
1129
1129
{
1130
1130
fail_count = 0 ;
1131
1131
INIT_LIST_HEAD (& chain .head );
@@ -1259,7 +1259,7 @@ bool commit_exists(const char *commit_hash)
1259
1259
char buffer [1024 ];
1260
1260
while (fgets (buffer , sizeof (buffer ), stream )) {
1261
1261
/* Compare the first 40 characters of each line with commit_hash */
1262
- if (! strncmp (buffer , commit_hash , 40 )) {
1262
+ if (strncmp (buffer , commit_hash , 40 ) == 0 ) {
1263
1263
found = true;
1264
1264
break ;
1265
1265
}
@@ -1294,19 +1294,20 @@ static bool check_commitlog(void)
1294
1294
}
1295
1295
1296
1296
#define GIT_HOOK ".git/hooks/"
1297
- static bool sanity_check ()
1297
+ static bool sanity_check (void )
1298
1298
{
1299
1299
struct stat buf ;
1300
1300
/* Directory .git not found */
1301
- if (stat (".git" , & buf )) {
1301
+ if (stat (".git" , & buf ) != 0 ) {
1302
1302
fprintf (stderr ,
1303
1303
"FATAL: You should run qtest in the directory containing valid "
1304
1304
"git workspace.\n" );
1305
1305
return false;
1306
1306
}
1307
1307
/* Expected pre-commit and pre-push hooks not found */
1308
- if (stat (GIT_HOOK "commit-msg" , & buf ) ||
1309
- stat (GIT_HOOK "pre-commit" , & buf ) || stat (GIT_HOOK "pre-push" , & buf )) {
1308
+ if (stat (GIT_HOOK "commit-msg" , & buf ) != 0 ||
1309
+ stat (GIT_HOOK "pre-commit" , & buf ) != 0 ||
1310
+ stat (GIT_HOOK "pre-push" , & buf ) != 0 ) {
1310
1311
fprintf (stderr , "FATAL: Git hooks are not properly installed.\n" );
1311
1312
1312
1313
/* Attempt to install Git hooks */
@@ -1323,7 +1324,7 @@ static bool sanity_check()
1323
1324
return false;
1324
1325
}
1325
1326
/* GitHub Actions checkouts do not include the complete git history. */
1326
- if (stat ("/home/runner/work" , & buf )) {
1327
+ if (stat ("/home/runner/work" , & buf ) != 0 ) {
1327
1328
#define COPYRIGHT_COMMIT_SHA1 "50c5ac53d31adf6baac4f8d3db6b3ce2215fee40"
1328
1329
if (!commit_exists (COPYRIGHT_COMMIT_SHA1 )) {
1329
1330
fprintf (
0 commit comments