Fix build warnings (without -Wall).

This commit is contained in:
Robert Millan 2009-11-08 22:54:27 +00:00
parent d70d390732
commit dc83dd6422
9 changed files with 29 additions and 22 deletions

View 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));

View 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;

View 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;

View 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);
}

View 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;

View 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;

View 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

View 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);

View 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);