]> git.ipfire.org Git - thirdparty/make.git/commitdiff
* src/job.c: Switch from bit operators to flags macros
authorPaul Smith <psmith@gnu.org>
Sat, 28 Jan 2023 18:01:39 +0000 (13:01 -0500)
committerPaul Smith <psmith@gnu.org>
Sat, 28 Jan 2023 18:05:08 +0000 (13:05 -0500)
* src/remake.c: Ditto.

src/job.c
src/remake.c

index d145bef93bc4fe387d18f5f6e92a36b7232dcaaa..94df0197fd2c62bceaa0433ff1d1cb4aa42ecf7f 100644 (file)
--- a/src/job.c
+++ b/src/job.c
@@ -1193,7 +1193,7 @@ start_job_command (struct child *child)
            | child->file->cmds->lines_flags[child->command_line - 1]);
 
   p = child->command_ptr;
-  child->noerror = ((flags & COMMANDS_NOERROR) != 0);
+  child->noerror = ANY_SET (flags, COMMANDS_NOERROR);
 
   while (*p != '\0')
     {
@@ -1209,7 +1209,7 @@ start_job_command (struct child *child)
       ++p;
     }
 
-  child->recursive = ((flags & COMMANDS_RECURSE) != 0);
+  child->recursive = ANY_SET (flags, COMMANDS_RECURSE);
 
   /* Update the file's command flags with any new ones we found.  We only
      keep the COMMANDS_RECURSE setting.  Even this isn't 100% correct; we are
@@ -1294,7 +1294,7 @@ start_job_command (struct child *child)
      command line, or 'succeeded' otherwise.  The exit status of 1 tells the
      user that -q is saying 'something to do'; the exit status for a random
      error is 2.  */
-  if (argv != 0 && question_flag && !(flags & COMMANDS_RECURSE))
+  if (argv != 0 && question_flag && NONE_SET (flags, COMMANDS_RECURSE))
     {
       FREE_ARGV (argv);
 #ifdef VMS
@@ -1310,7 +1310,7 @@ start_job_command (struct child *child)
 #endif
     }
 
-  if (touch_flag && !(flags & COMMANDS_RECURSE))
+  if (touch_flag && NONE_SET (flags, COMMANDS_RECURSE))
     {
       /* Go on to the next command.  It might be the recursive one.
          We construct ARGV only to find the end of the command line.  */
@@ -1344,7 +1344,7 @@ start_job_command (struct child *child)
      in SYNC_RECURSE mode or this command is not recursive.  We'll also check
      output_sync separately below in case it changes due to error.  */
   child->output.syncout = output_sync && (output_sync == OUTPUT_SYNC_RECURSE
-                                          || !(flags & COMMANDS_RECURSE));
+                                          || NONE_SET (flags, COMMANDS_RECURSE));
 
   OUTPUT_SET (&child->output);
 
@@ -1355,7 +1355,7 @@ start_job_command (struct child *child)
 
   /* Print the command if appropriate.  */
   if (just_print_flag || ISDB (DB_PRINT)
-      || (!(flags & COMMANDS_SILENT) && !run_silent))
+      || (NONE_SET (flags, COMMANDS_SILENT) && !run_silent))
     OS (message, 0, "%s", p);
 
   /* Tell update_goal_chain that a command has been started on behalf of
@@ -1395,7 +1395,7 @@ start_job_command (struct child *child)
 
   /* If -n was given, recurse to get the next line in the sequence.  */
 
-  if (just_print_flag && !(flags & COMMANDS_RECURSE))
+  if (just_print_flag && NONE_SET (flags, COMMANDS_RECURSE))
     {
       FREE_ARGV (argv);
       goto next_command;
@@ -1464,12 +1464,12 @@ start_job_command (struct child *child)
 
 #else
 
-      jobserver_pre_child (flags & COMMANDS_RECURSE);
+      jobserver_pre_child (ANY_SET (flags, COMMANDS_RECURSE));
 
       child->pid = child_execute_job ((struct childbase *)child,
                                       child->good_stdin, argv);
 
-      jobserver_post_child (flags & COMMANDS_RECURSE);
+      jobserver_post_child (ANY_SET (flags, COMMANDS_RECURSE));
 
 #endif /* !VMS */
     }
@@ -3538,7 +3538,7 @@ construct_command_argv_internal (char *line, char **restp, const char *shell,
     /* Some shells do not work well when invoked as 'sh -c xxx' to run a
        command line (e.g. Cygnus GNUWIN32 sh.exe on W32 systems).  In these
        cases, run commands via a script file.  */
-    if (just_print_flag && !(flags & COMMANDS_RECURSE))
+    if (just_print_flag && NONE_SET (flags, COMMANDS_RECURSE))
       {
         /* Need to allocate new_argv, although it's unused, because
            start_job_command will want to free it and its 0'th element.  */
index 62b3d7917c8e96cc71cb0a720e1f95e660f5d37d..e2892e2dc7efa358997dd022fe28bd9d00df8007 100644 (file)
@@ -958,7 +958,7 @@ notice_finished_file (struct file *file)
              we don't want to do the touching.  */
           unsigned int i;
           for (i = 0; i < file->cmds->ncommand_lines; ++i)
-            if (!(file->cmds->lines_flags[i] & COMMANDS_RECURSE))
+            if (NONE_SET (file->cmds->lines_flags[i], COMMANDS_RECURSE))
               goto have_nonrecursing;
         }
       else
@@ -999,7 +999,7 @@ notice_finished_file (struct file *file)
       if ((question_flag || just_print_flag || touch_flag) && file->cmds)
         {
           for (i = file->cmds->ncommand_lines; i > 0; --i)
-            if (! (file->cmds->lines_flags[i-1] & COMMANDS_RECURSE))
+            if (NONE_SET (file->cmds->lines_flags[i-1], COMMANDS_RECURSE))
               break;
         }