From 814574507fef62cfe83f6d1c579aa4b6736443a2 Mon Sep 17 00:00:00 2001 From: Stelian Pop Date: Wed, 21 Apr 2004 09:15:08 +0000 Subject: [PATCH] Fix some compile warnings. --- dump/tape.c | 11 +++++------ restore/dirs.c | 11 ++++++++--- restore/tape.c | 11 +++++------ 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/dump/tape.c b/dump/tape.c index 54f1178..116b4a3 100644 --- a/dump/tape.c +++ b/dump/tape.c @@ -37,7 +37,7 @@ #ifndef lint static const char rcsid[] = - "$Id: tape.c,v 1.82 2004/03/08 14:04:04 stelian Exp $"; + "$Id: tape.c,v 1.83 2004/04/21 09:15:08 stelian Exp $"; #endif /* not lint */ #include @@ -1087,9 +1087,6 @@ doslave(int cmd, int compresult; volatile int do_compress = !first; unsigned long worklen; -#ifdef HAVE_BZLIB - unsigned int worklen2; -#endif #ifdef HAVE_LZO lzo_align_t __LZO_MMODEL *LZO_WorkMem; #endif @@ -1226,7 +1223,7 @@ doslave(int cmd, #endif /* HAVE_ZLIB */ #ifdef HAVE_BZLIB if (zipflag == COMPRESS_BZLIB) { - worklen2 = worklen; + unsigned int worklen2 = worklen; compresult = BZ2_bzBuffToBuffCompress( comp_buf->buf, &worklen2, @@ -1244,10 +1241,12 @@ doslave(int cmd, #endif /* HAVE_BZLIB */ #ifdef HAVE_LZO if (zipflag == COMPRESS_LZO) { + lzo_uint worklen2 = worklen; compresult = lzo1x_1_compress((char *)slp->tblock[0],writesize, comp_buf->buf, - (lzo_uintp)&worklen, + &worklen2, LZO_WorkMem); + worklen = worklen2; if (compresult == LZO_E_OK) compresult = 1; else diff --git a/restore/dirs.c b/restore/dirs.c index 3a8a94d..49d5052 100644 --- a/restore/dirs.c +++ b/restore/dirs.c @@ -42,7 +42,7 @@ #ifndef lint static const char rcsid[] = - "$Id: dirs.c,v 1.26 2004/04/13 13:04:33 stelian Exp $"; + "$Id: dirs.c,v 1.27 2004/04/21 09:15:22 stelian Exp $"; #endif /* not lint */ #include @@ -419,8 +419,11 @@ putdir(char *buf, size_t size) i = DIRBLKSIZ - (loc & (DIRBLKSIZ - 1)); if ((dp->d_reclen & 0x3) != 0 || dp->d_reclen > i || - dp->d_reclen < DIRSIZ(0, dp) || - dp->d_namlen > MAXNAMLEN) { + dp->d_reclen < DIRSIZ(0, dp) +#if MAXNAMLEN < 255 + || dp->d_namlen > MAXNAMLEN +#endif + ) { Vprintf(stdout, "Mangled directory: "); if ((dp->d_reclen & 0x3) != 0) Vprintf(stdout, @@ -429,10 +432,12 @@ putdir(char *buf, size_t size) Vprintf(stdout, "reclen less than DIRSIZ (%d < %d) ", dp->d_reclen, DIRSIZ(0, dp)); +#if MAXNAMLEN < 255 if (dp->d_namlen > MAXNAMLEN) Vprintf(stdout, "reclen name too big (%d > %d) ", dp->d_namlen, MAXNAMLEN); +#endif Vprintf(stdout, "\n"); loc += i; continue; diff --git a/restore/tape.c b/restore/tape.c index 560a6c9..68a40a0 100644 --- a/restore/tape.c +++ b/restore/tape.c @@ -42,7 +42,7 @@ #ifndef lint static const char rcsid[] = - "$Id: tape.c,v 1.79 2004/04/13 13:04:33 stelian Exp $"; + "$Id: tape.c,v 1.80 2004/04/21 09:15:22 stelian Exp $"; #endif /* not lint */ #include @@ -2063,9 +2063,6 @@ decompress_tapebuf(struct tapebuf *tpbin, int readsize) /* zflag gets set in setup() from the dump header */ int cresult, blocklen; unsigned long worklen; -#ifdef HAVE_BZLIB - unsigned int worklen2; -#endif char *output = NULL,*reason = NULL, *lengtherr = NULL; /* build a length error message */ @@ -2112,7 +2109,7 @@ decompress_tapebuf(struct tapebuf *tpbin, int readsize) #ifndef HAVE_BZLIB errx(1,"This restore version doesn't support bzlib decompression"); #else - worklen2 = worklen; + unsigned int worklen2 = worklen; cresult = BZ2_bzBuffToBuffDecompress( comprbuf, &worklen2, tpbin->buf, blocklen, 0, 0); @@ -2145,8 +2142,10 @@ decompress_tapebuf(struct tapebuf *tpbin, int readsize) #ifndef HAVE_LZO errx(1,"This restore version doesn't support lzo decompression"); #else + lzo_uint worklen2 = worklen; cresult = lzo1x_decompress(tpbin->buf, blocklen, - comprbuf, (lzo_uintp) &worklen,NULL); + comprbuf, &worklen2, NULL); + worklen = worklen2; output = comprbuf; switch (cresult) { case LZO_E_OK: -- 2.39.5