]> git.ipfire.org Git - thirdparty/make.git/commitdiff
Clean up some compiler warnings.
authorPaul Smith <psmith@gnu.org>
Mon, 7 Mar 2016 06:30:21 +0000 (01:30 -0500)
committerPaul Smith <psmith@gnu.org>
Wed, 9 Mar 2016 04:40:46 +0000 (23:40 -0500)
* commands.c, commands.h: Use unsigned char for flags.
* dir.c: Use time_t and size_t, and char for a boolean value.
* job.c: Use unsigned and char.
* read.c: Return a signed type since -1 is a valid return code.

commands.c
commands.h
dir.c
implicit.c
job.c
read.c

index bc418b7677334d439729c50f782bd519503f20ad..6a9df7c2ec93a19e76790a2f9836986e7c9d0acf 100644 (file)
@@ -411,7 +411,7 @@ chop_commands (struct commands *cmds)
 
   for (idx = 0; idx < nlines; ++idx)
     {
-      int flags = 0;
+      unsigned char flags = 0;
       const char *p = lines[idx];
 
       while (isblank (*p) || *p == '-' || *p == '@' || *p == '+')
index ec706201447cdb74671910309bf56d70986367e8..db95fb2fb3e630840be35381d496e5e682de957c 100644 (file)
@@ -22,7 +22,7 @@ struct commands
     gmk_floc fileinfo;          /* Where commands were defined.  */
     char *commands;             /* Commands text.  */
     char **command_lines;       /* Commands chopped up into lines.  */
-    char *lines_flags;          /* One set of flag bits for each line.  */
+    unsigned char *lines_flags; /* One set of flag bits for each line.  */
     unsigned short ncommand_lines;/* Number of command lines.  */
     char recipe_prefix;         /* Recipe prefix for this command set.  */
     unsigned int any_recurse:1; /* Nonzero if any 'lines_flags' elt has */
diff --git a/dir.c b/dir.c
index baeaaa36b908b8ca97e158f593b2ebdf19e5ddc7..de85a3c7492b66fb1901043ad9071931d42152da 100644 (file)
--- a/dir.c
+++ b/dir.c
@@ -248,9 +248,9 @@ struct directory_contents
      * qualified name of the directory. Beware though, this is also
      * unreliable. I'm open to suggestion on a better way to emulate inode.  */
     char *path_key;
-    int   ctime;
-    int   mtime;        /* controls check for stale directory cache */
-    int   fs_flags;     /* FS_FAT, FS_NTFS, ... */
+    time_t ctime;
+    time_t mtime;        /* controls check for stale directory cache */
+    int fs_flags;     /* FS_FAT, FS_NTFS, ... */
 # define FS_FAT      0x1
 # define FS_NTFS     0x2
 # define FS_UNKNOWN  0x4
@@ -405,7 +405,7 @@ static unsigned int open_directories = 0;
 struct dirfile
   {
     const char *name;           /* Name of the file.  */
-    short length;
+    size_t length;
     short impossible;           /* This file is impossible.  */
   };
 
index 7af635c7fb56de66d599ec2e5237630cb6a94ac4..aa33b833a2c156dbec855392727cf3d52c462123 100644 (file)
@@ -317,7 +317,7 @@ pattern_search (struct file *file, int archive,
         {
           const char *target = rule->targets[ti];
           const char *suffix = rule->suffixes[ti];
-          int check_lastslash;
+          char check_lastslash;
 
           /* Rules that can match any filename and are not terminal
              are ignored if we're recursing, so that they cannot be
@@ -438,7 +438,7 @@ pattern_search (struct file *file, int archive,
       for (ri = 0; ri < nrules; ri++)
         {
           struct dep *dep;
-          int check_lastslash;
+          char check_lastslash;
           unsigned int failed = 0;
           int file_variables_set = 0;
           unsigned int deps_found = 0;
diff --git a/job.c b/job.c
index 321a1e82051813e9fc649865350aa0bb35ad79eb..084c1b87f00d5df0314af3a02360698c2885256a 100644 (file)
--- a/job.c
+++ b/job.c
@@ -589,7 +589,7 @@ reap_children (int block, int err)
   while ((children != 0 || shell_function_pid != 0)
          && (block || REAP_MORE))
     {
-      int remote = 0;
+      unsigned int remote = 0;
       pid_t pid;
       int exit_code, exit_sig, coredump;
       struct child *lastc, *c;
@@ -3109,7 +3109,7 @@ construct_command_argv_internal (char *line, char **restp, const char *shell,
                 /* Write another line into the batch file.  */
                 if (t > tstart)
                   {
-                    int c = *t;
+                    char c = *t;
                     *t = '\0';
                     fputs (tstart, batch);
                     DB (DB_JOBS, ("\t%s", tstart));
diff --git a/read.c b/read.c
index 95c885083cc82baa9d745ec79820046d208bbb44..bcd6c243d07ed5019575556e808988e64e373825 100644 (file)
--- a/read.c
+++ b/read.c
@@ -2467,7 +2467,7 @@ find_percent_cached (const char **string)
    Since we aren't really reading from a file, don't bother with linenumbers.
  */
 
-static unsigned long
+static long
 readstring (struct ebuffer *ebuf)
 {
   char *eol;
@@ -3013,12 +3013,12 @@ tilde_expand (const char *name)
         PARSEFS_NOCACHE - Do not add filenames to the strcache (caller frees)
   */
 
+void dir_setup_glob (glob_t *glob);
+
 void *
 parse_file_seq (char **stringp, unsigned int size, int stopmap,
                 const char *prefix, int flags)
 {
-  extern void dir_setup_glob (glob_t *glob);
-
   /* tmp points to tmpbuf after the prefix, if any.
      tp is the end of the buffer. */
   static char *tmpbuf = NULL;