@@ -913,7 +913,7 @@ static bool do_merge(int argc, char *argv[])
913913 return ok && !error_check ();
914914}
915915
916- static bool is_circular ()
916+ static bool is_circular (void )
917917{
918918 struct list_head * cur = current -> q -> next ;
919919 struct list_head * fast = (cur ) ? cur -> next : NULL ;
@@ -1056,7 +1056,7 @@ static bool do_next(int argc, char *argv[])
10561056 return q_show (0 );
10571057}
10581058
1059- static void console_init ()
1059+ static void console_init (void )
10601060{
10611061 ADD_COMMAND (new , "Create new queue" , "" );
10621062 ADD_COMMAND (free , "Delete queue" , "" );
@@ -1125,7 +1125,7 @@ static void sigalrm_handler(int sig)
11251125 "code is too inefficient" );
11261126}
11271127
1128- static void q_init ()
1128+ static void q_init (void )
11291129{
11301130 fail_count = 0 ;
11311131 INIT_LIST_HEAD (& chain .head );
@@ -1259,7 +1259,7 @@ bool commit_exists(const char *commit_hash)
12591259 char buffer [1024 ];
12601260 while (fgets (buffer , sizeof (buffer ), stream )) {
12611261 /* 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 ) {
12631263 found = true;
12641264 break ;
12651265 }
@@ -1294,19 +1294,20 @@ static bool check_commitlog(void)
12941294}
12951295
12961296#define GIT_HOOK ".git/hooks/"
1297- static bool sanity_check ()
1297+ static bool sanity_check (void )
12981298{
12991299 struct stat buf ;
13001300 /* Directory .git not found */
1301- if (stat (".git" , & buf )) {
1301+ if (stat (".git" , & buf ) != 0 ) {
13021302 fprintf (stderr ,
13031303 "FATAL: You should run qtest in the directory containing valid "
13041304 "git workspace.\n" );
13051305 return false;
13061306 }
13071307 /* 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 ) {
13101311 fprintf (stderr , "FATAL: Git hooks are not properly installed.\n" );
13111312
13121313 /* Attempt to install Git hooks */
@@ -1323,7 +1324,7 @@ static bool sanity_check()
13231324 return false;
13241325 }
13251326 /* 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 ) {
13271328#define COPYRIGHT_COMMIT_SHA1 "50c5ac53d31adf6baac4f8d3db6b3ce2215fee40"
13281329 if (!commit_exists (COPYRIGHT_COMMIT_SHA1 )) {
13291330 fprintf (
0 commit comments