]> git.proxmox.com Git - grub2.git/commitdiff
Fix build warnings (without -Wall).
authorRobert Millan <rmh@aybabtu.com>
Sun, 8 Nov 2009 22:54:27 +0000 (22:54 +0000)
committerRobert Millan <rmh@aybabtu.com>
Sun, 8 Nov 2009 22:54:27 +0000 (22:54 +0000)
util/mkisofs/eltorito.c
util/mkisofs/getopt.c
util/mkisofs/joliet.c
util/mkisofs/match.c
util/mkisofs/mkisofs.c
util/mkisofs/mkisofs.h
util/mkisofs/rock.c
util/mkisofs/tree.c
util/mkisofs/write.c

index b577c731dc055a71aeb3e4df1c2e9701dcba8db9..e003f2b6780d8100fedd31753d58bd48a5567b45 100644 (file)
@@ -123,7 +123,7 @@ void FDECL1(get_torito_desc, struct eltorito_boot_descriptor *, boot_desc)
     unsigned char                    * checksum_ptr;
     struct directory_entry      * de;
     struct directory_entry      * de2;
-    int                                i;
+    unsigned int               i;
     int                                nsectors;
     
     memset(boot_desc, 0, sizeof(*boot_desc));
index 79080aa54b3bcde5cb4d625e9945b2bb0b1d6d26..14d52b341c92cd540505441613f00a8e3e447420 100644 (file)
@@ -3,13 +3,13 @@
    "Keep this file name-space clean" means, talk to roland@gnu.ai.mit.edu
    before changing it!
 
-   Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95
+   Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 2009
        Free Software Foundation, Inc.
 
 This file is part of the libiberty library.  This library is free
 software; you can redistribute it and/or modify it under the
 terms of the GNU General Public License as published by the
-Free Software Foundation; either version 2, or (at your option)
+Free Software Foundation; either version 3, or (at your option)
 any later version.
 
 This library is distributed in the hope that it will be useful,
@@ -53,6 +53,7 @@ the executable file might be covered by the GNU General Public License. */
 #endif
 
 #include <stdio.h>
+#include <assert.h>
 
 /* Comment out all this code if we are using the GNU C Library, and are not
    actually compiling the library itself.  This code is part of the GNU C
@@ -498,7 +499,8 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
       for (p = longopts, option_index = 0; p->name; p++, option_index++)
        if (!strncmp (p->name, nextchar, nameend - nextchar))
          {
-           if (nameend - nextchar == strlen (p->name))
+           assert (nameend > nextchar);
+           if (nameend == strlen (p->name) + nextchar)
              {
                /* Exact match found.  */
                pfound = p;
index 0aa8668543582e5dbefd75c71cdab19cd983d9f4..d1cd25bf4939bdce559bf263664c41bdb82d29c2 100644 (file)
@@ -77,7 +77,7 @@ static char rcsid[] ="$Id: joliet.c,v 1.14 1999/03/07 17:41:19 eric Exp $";
 #include <stdlib.h>
 #include <time.h>
 
-static int jpath_table_index;
+static unsigned int jpath_table_index;
 static struct directory ** jpathlist;
 static int next_jpath_index  = 1;
 static int sort_goof;
index e01314b0b6b45da691940908aebed5d5a6e55fb1..8590be470e9fe35edf514e6129aa98074f22fb9c 100644 (file)
@@ -98,7 +98,7 @@ char * fn;
 
 int i_ishidden()
 {
-  return((int)i_mat[0]);
+  return (i_mat[0] != NULL);
 }
 
 /* Joliet hide */
@@ -142,6 +142,6 @@ char * fn;
 
 int j_ishidden()
 {
-  return((int)j_mat[0]);
+  return (j_mat[0] != NULL);
 }
 
index 0eb9d95fb3c2d721ff207b46686001a75a65b46d..2b11dc6eca7cbdd4709e108d14c90b0912fabf85 100644 (file)
@@ -115,7 +115,7 @@ int volume_sequence_number = 1;
 int omit_period = 0;             /* Violates iso9660, but these are a pain */
 int transparent_compression = 0; /* So far only works with linux */
 int omit_version_number = 0;     /* May violate iso9660, but noone uses vers*/
-int RR_relocation_depth = 6;     /* Violates iso9660, but most systems work */
+unsigned int RR_relocation_depth = 6;     /* Violates iso9660, but most systems work */
 int full_iso9660_filenames = 0;  /* Used with Amiga.  Disc will not work with
                                  DOS */
 int allow_leading_dots = 0;     /* DOS cannot read names with leading dots */
@@ -461,7 +461,7 @@ void usage(){
 [-x path -x path ...] path\n");
 #endif
 
-  int i;
+  unsigned int i;
 /*  const char **targets, **pp;*/
 
   fprintf (stderr, "Usage: %s [options] file...\n", program_name);
@@ -473,7 +473,7 @@ void usage(){
        {
          int comma;
          int len;
-         int j;
+         unsigned int j;
 
          fprintf (stderr, "  ");
 
@@ -641,7 +641,8 @@ int FDECL2(main, int, argc, char **, argv){
      the ordering of the two.  We describe each non-option ARGV-element
      as if it were the argument of an option with character code 1.  */
   {
-    int i, is, il;
+    unsigned int i;
+    int is, il;
     shortopts[0] = '-';
     is = 1;
     il = 0;
index db297eec6ceaa76a76c47888b9f2682f1b523631..ffabb96f90748eeca0687dedf6db1f40478f9172 100644 (file)
@@ -277,7 +277,7 @@ extern int split_output;
 extern int omit_period;
 extern int omit_version_number;
 extern int transparent_compression;
-extern int RR_relocation_depth;
+extern unsigned int RR_relocation_depth;
 extern int full_iso9660_filenames;
 extern int split_SL_component;
 extern int split_SL_field;
index 45fbd51f39e411e62544d9e7a03f67660dcbc539..fa15576585c7b237d3ebf3380a1b08395b7cb480 100644 (file)
@@ -5,9 +5,11 @@
 
    Copyright 1993 Yggdrasil Computing, Incorporated
 
+   Copyright (C) 2009  Free Software Foundation, Inc.
+
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
+   the Free Software Foundation; either version 3, or (at your option)
    any later version.
 
    This program is distributed in the hope that it will be useful,
@@ -16,7 +18,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
+   along with this program; if not, see <http://www.gnu.org/licenses/>.
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
 static char rcsid[] ="$Id: rock.c,v 1.8 1999/03/02 03:41:26 eric Exp $";
@@ -86,7 +88,7 @@ static char rcsid[] ="$Id: rock.c,v 1.8 1999/03/02 03:41:26 eric Exp $";
    a CE entry for the continuation record */
 
 #define MAYBE_ADD_CE_ENTRY(BYTES) \
-    (BYTES + CE_SIZE + currlen + (ipnt - recstart) > reclimit ? 1 : 0) 
+    ((unsigned) ((BYTES) + CE_SIZE + currlen + ipnt) > (unsigned) (recstart + reclimit) ? 1 : 0) 
 
 /*
  * Buffer to build RR attributes
index 59d76d9a664a78a367d74cea0e64f1d431dbabec..9d5418965d1f5974830a034e61215f43816f9527 100644 (file)
@@ -107,9 +107,9 @@ static void DECL(delete_directory, (struct directory * parent, struct directory
 
 extern int verbose;
 
-struct stat fstatbuf = {0,};  /* We use this for the artificial entries we create */
+struct stat fstatbuf;  /* We use this for the artificial entries we create */
 
-struct stat root_statbuf = {0, };  /* Stat buffer for root directory */
+struct stat root_statbuf;  /* Stat buffer for root directory */
 
 struct directory * reloc_dir = NULL;
 
@@ -1269,7 +1269,7 @@ FDECL3(insert_file_entry,struct directory *, this_dir,
     }
   
   if (strcmp(short_name,".") && strcmp(short_name,"..") && 
-      S_ISDIR(statbuf.st_mode) && this_dir->depth >  RR_relocation_depth)
+      S_ISDIR(statbuf.st_mode) && this_dir->depth > RR_relocation_depth)
     {
       struct directory * child;
 
@@ -1612,7 +1612,7 @@ struct directory * FDECL4(find_or_create_directory, struct directory *, parent,
 #ifdef DEBUG
       fprintf(stderr,"%s(%d) ", path, dpnt->depth);
 #endif
-      if(parent->depth >  RR_relocation_depth) 
+      if(parent->depth > RR_relocation_depth) 
        {
          fprintf(stderr,"Directories too deep  %s\n", path);
          exit(1);
index bb70cc752ccb0c7e6eb5e89a4ed15f9ca08d2b90..8d46d89c6591e266e2c0f8dccf00b31997b29bca 100644 (file)
@@ -34,6 +34,7 @@ static char rcsid[] ="$Id: write.c,v 1.21 1999/03/07 17:41:19 eric Exp $";
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
+#include <assert.h>
 
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
@@ -178,7 +179,7 @@ struct deferred_write
 static struct deferred_write * dw_head = NULL, * dw_tail = NULL;
 
 unsigned int last_extent_written  =0;
-static int path_table_index;
+static unsigned int path_table_index;
 static time_t begun;
 
 /* We recursively walk through all of the directories and assign extent
@@ -239,7 +240,7 @@ static void FDECL3(write_one_file, char *, filename,
      char                buffer[SECTOR_SIZE * NSECT];
      FILE              * infile;
      int                 remain;
-     int                 use;
+     unsigned int                use;
 
 
      if ((infile = fopen(filename, "rb")) == NULL) 
@@ -1163,7 +1164,8 @@ static int FDECL1(file_write, FILE *, outfile)
   /* 
    * Hard links throw us off here 
    */
-  if(should_write != last_extent - session_start)
+  assert (last_extent > session_start);
+  if(should_write + session_start != last_extent)
     {
       fprintf(stderr,"Number of extents written not what was predicted.  Please fix.\n");
       fprintf(stderr,"Predicted = %d, written = %d\n", should_write, last_extent);