Add a few unsigned and casts for less warnings with -Wsign-compare. --HG-- branch : HEAD
diff --git a/lib/zip_close.c b/lib/zip_close.c index 890f337..69437b6 100644 --- a/lib/zip_close.c +++ b/lib/zip_close.c
@@ -1,5 +1,5 @@ /* - $NiH: zip_close.c,v 1.49 2005/06/09 19:11:37 dillo Exp $ + $NiH: zip_close.c,v 1.50 2005/06/09 19:57:09 dillo Exp $ zip_close.c -- close zip archive and update changes Copyright (C) 1999, 2004, 2005 Dieter Baron and Thomas Klausner @@ -313,7 +313,7 @@ st->comp_size = 0; while ((n=cb(ud, buf, sizeof(buf), ZIP_SOURCE_READ)) > 0) { - if (fwrite(buf, 1, n, ft) != n) { + if (fwrite(buf, 1, n, ft) != (size_t)n) { _zip_error_set(error, ZIP_ER_WRITE, errno); return -1; } @@ -443,7 +443,7 @@ return -1; } - if (fwrite(buf, 1, n, ft) != n) { + if (fwrite(buf, 1, n, ft) != (size_t)n) { _zip_error_set(error, ZIP_ER_WRITE, errno); return -1; }
diff --git a/lib/zip_dirent.c b/lib/zip_dirent.c index 8c5b56c..70ebf63 100644 --- a/lib/zip_dirent.c +++ b/lib/zip_dirent.c
@@ -1,5 +1,5 @@ /* - $NiH: zip_dirent.c,v 1.5 2005/01/11 19:00:34 wiz Exp $ + $NiH: zip_dirent.c,v 1.6 2005/06/09 19:57:09 dillo Exp $ zip_dirent.c -- read directory entry (local or central), clean dirent Copyright (C) 1999, 2003, 2004, 2005 Dieter Baron and Thomas Klausner @@ -47,7 +47,7 @@ #include "zipint.h" static time_t _zip_d2u_time(int, int); -static char *_zip_readfpstr(FILE *, int, int, struct zip_error *); +static char *_zip_readfpstr(FILE *, unsigned int, int, struct zip_error *); static char *_zip_readstr(unsigned char **, int, int, struct zip_error *); static void _zip_u2d_time(time_t, int *, int *); static void _zip_write2(unsigned short, FILE *); @@ -188,13 +188,13 @@ int _zip_dirent_read(struct zip_dirent *zde, FILE *fp, - unsigned char **bufp, int left, int localp, + unsigned char **bufp, unsigned int left, int localp, struct zip_error *error) { unsigned char buf[CDENTRYSIZE]; unsigned char *cur; unsigned short dostime, dosdate; - int size; + unsigned int size; if (localp) size = LENTRYSIZE; @@ -434,7 +434,7 @@ static char * -_zip_readfpstr(FILE *fp, int len, int nulp, struct zip_error *error) +_zip_readfpstr(FILE *fp, unsigned int len, int nulp, struct zip_error *error) { char *r, *o;
diff --git a/lib/zip_fread.c b/lib/zip_fread.c index 2d6574a..07be819 100644 --- a/lib/zip_fread.c +++ b/lib/zip_fread.c
@@ -1,5 +1,5 @@ /* - $NiH: zip_fread.c,v 1.15 2005/05/20 21:54:53 wiz Exp $ + $NiH: zip_fread.c,v 1.16 2005/06/09 19:57:09 dillo Exp $ zip_fread.c -- read from file Copyright (C) 1999, 2004, 2005 Dieter Baron and Thomas Klausner @@ -43,7 +43,8 @@ ssize_t zip_fread(struct zip_file *zf, void *outbuf, size_t toread) { - int len, out_before, ret; + int out_before, ret; + unsigned int len; if (!zf) return -1;
diff --git a/lib/zipint.h b/lib/zipint.h index ff42dbe..fd30f29 100644 --- a/lib/zipint.h +++ b/lib/zipint.h
@@ -2,7 +2,7 @@ #define _HAD_ZIPINT_H /* - $NiH: zipint.h,v 1.39 2005/01/11 19:52:24 wiz Exp $ + $NiH: zipint.h,v 1.40 2005/06/09 19:57:10 dillo Exp $ zipint.h -- internal declarations. Copyright (C) 1999, 2003, 2004, 2005 Dieter Baron and Thomas Klausner @@ -180,7 +180,7 @@ void _zip_dirent_finalize(struct zip_dirent *); void _zip_dirent_init(struct zip_dirent *); int _zip_dirent_read(struct zip_dirent *, FILE *, - unsigned char **, int, int, struct zip_error *); + unsigned char **, unsigned int, int, struct zip_error *); int _zip_dirent_write(struct zip_dirent *, FILE *, int, struct zip_error *); void _zip_entry_free(struct zip_entry *);
diff --git a/src/zipcmp.c b/src/zipcmp.c index 4ffc039..eaceee9 100644 --- a/src/zipcmp.c +++ b/src/zipcmp.c
@@ -1,5 +1,5 @@ /* - $NiH: zipcmp.c,v 1.16 2005/05/20 21:56:54 wiz Exp $ + $NiH: zipcmp.c,v 1.17 2005/06/09 19:57:10 dillo Exp $ zipcmp.c -- compare zip files Copyright (C) 2003, 2004, 2005 Dieter Baron and Thomas Klausner @@ -295,7 +295,8 @@ { struct zip_file *zf; char buf[8192]; - int n, nsize, ncrc; + int n, nsize; + unsigned int ncrc; if ((zf=zip_fopen_index(za, idx, 0)) == NULL) { fprintf(stderr, "%s: cannot open file %d in archive: %s\n",