]> git.wh0rd.org - dump.git/commitdiff
Fix some compile warnings.
authorStelian Pop <stelian@popies.net>
Wed, 21 Apr 2004 09:15:08 +0000 (09:15 +0000)
committerStelian Pop <stelian@popies.net>
Wed, 21 Apr 2004 09:15:08 +0000 (09:15 +0000)
dump/tape.c
restore/dirs.c
restore/tape.c

index 54f11786ecc9be06c13d86a30e4d8119e4e7f947..116b4a3016e0f9d523f81769c4d0cfbaeca83cb2 100644 (file)
@@ -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 <config.h>
@@ -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
index 3a8a94d4fd0dfc1a15016ac9f7b339eb7fbe5077..49d50529b689a3c1720dd739caedc6dafdd2ea00 100644 (file)
@@ -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 <config.h>
@@ -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;
index 560a6c96c5f220d00e04eaefc427a1011a7106d4..68a40a0556cd56f85e249d85fb2e82f8fdce0e98 100644 (file)
@@ -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 <config.h>
@@ -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: