diff options
author | Kaveh R. Ghazi <ghazi@caip.rutgers.edu> | 2000-12-14 18:45:35 +0000 |
---|---|---|
committer | Kaveh Ghazi <ghazi@gcc.gnu.org> | 2000-12-14 18:45:35 +0000 |
commit | 990bee10e7f467d0a2eaed58363b69896553a648 (patch) | |
tree | 4038c59b8993142fec6dcdc3b59d41af2314c771 /fastjar/compress.c | |
parent | ad46e8819b6ff19173ded53b8415e8ca89a82275 (diff) | |
download | gcc-990bee10e7f467d0a2eaed58363b69896553a648.tar.gz |
Warning fixes:
* compress.c: Include stdlib.h and compress.h.
(rcsid): Delete.
(report_str_error): Make static.
(ez_inflate_str): Delete unused variable. Add parens in if-stmt.
(hrd_inflate_str): Likewise.
* compress.h (init_compression, end_compression, init_inflation,
end_inflation): Prototype void arguments.
* dostime.c (rcsid): Delete.
* jargrep.c: Include ctype.h, stdlib.h, zlib.h and compress.h.
Make functions static. Cast ctype function argument to `unsigned
char'. Add parens in if-stmts. Constify.
(Usage): Change into a macro.
(jargrep): Remove unused parameter.
* jartool.c: Constify. Add parens in if-stmts. Align
signed/unsigned char pointers in functions calls using casts.
(rcsid): Delete.
(list_jar): Fix printf format specifier.
(usage): Chop long string into bits. Reformat.
* pushback.c (rcsid): Delete.
From-SVN: r38254
Diffstat (limited to 'fastjar/compress.c')
-rw-r--r-- | fastjar/compress.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/fastjar/compress.c b/fastjar/compress.c index 0f919d76364..e88eff5ee4a 100644 --- a/fastjar/compress.c +++ b/fastjar/compress.c @@ -1,6 +1,11 @@ -/* $Id: compress.c,v 1.7 2000/09/13 14:02:02 cory Exp $ +/* $Id: compress.c,v 1.1 2000/12/09 03:08:23 apbianco Exp $ $Log: compress.c,v $ + Revision 1.1 2000/12/09 03:08:23 apbianco + 2000-12-08 Alexandre Petit-Bianco <apbianco@cygnus.com> + + * fastjar: Imported. + Revision 1.7 2000/09/13 14:02:02 cory Reformatted some of the code to more closly match the layout of the orriginal fastjar utility. @@ -67,16 +72,18 @@ #ifdef HAVE_UNISTD_H #include <unistd.h> #endif +#ifdef STDC_HEADERS +#include <stdlib.h> +#endif #include <sys/types.h> #include "jartool.h" #include "pushback.h" +#include "compress.h" extern int seekable; -static char rcsid[] = "$Id: compress.c,v 1.7 2000/09/13 14:02:02 cory Exp $"; - static z_stream zs; void init_compression(){ @@ -335,7 +342,7 @@ purpose: Put out an error message corresponding to error code returned from zlib Be suitably cryptic seeing I don't really know exactly what these errors mean. */ -void report_str_error(int val) { +static void report_str_error(int val) { switch(val) { case Z_STREAM_END: break; @@ -376,10 +383,9 @@ static Bytef *ez_inflate_str(pb_file *pbf, ub4 csize, ub4 usize) { Bytef *out_buff; Bytef *in_buff; unsigned int rdamt; - ub4 crc = 0; - if(zs.next_in = in_buff = (Bytef *) malloc(csize)) { - if(zs.next_out = out_buff = (Bytef *) malloc(usize + 1)) { + if((zs.next_in = in_buff = (Bytef *) malloc(csize))) { + if((zs.next_out = out_buff = (Bytef *) malloc(usize + 1))) { if((rdamt = pb_read(pbf, zs.next_in, csize)) == csize) { zs.avail_in = csize; zs.avail_out = usize; @@ -430,7 +436,6 @@ static Bytef *hrd_inflate_str(pb_file *pbf, ub4 *csize, ub4 *usize) { unsigned int rdamt; int i; int zret; - ub4 crc = 0; i = 1; out_buff = NULL; @@ -441,7 +446,7 @@ static Bytef *hrd_inflate_str(pb_file *pbf, ub4 *csize, ub4 *usize) { zs.avail_out = 0; zs.next_in = in_buff; do { - if(tmp = (Bytef *) realloc(out_buff, (RDSZ * i) + 1)) { + if((tmp = (Bytef *) realloc(out_buff, (RDSZ * i) + 1))) { out_buff = tmp; zs.next_out = &(out_buff[(RDSZ * (i - 1)) - zs.avail_out]); zs.avail_out += RDSZ; |