Browse Source

COMP: Fix warnings on Borland dashboards...

David Cole 19 years ago
parent
commit
13a68cd978

+ 1 - 0
Utilities/cmtar/CMakeLists.txt

@@ -67,6 +67,7 @@ FOREACH(file
   "ctype.h"
   "fnmatch.h"
   "inttypes.h"
+  "io.h"
   "libgen.h"
   "memory.h"
   "sys/mkdev.h"

+ 3 - 2
Utilities/cmtar/append.c

@@ -31,8 +31,9 @@
 #ifdef HAVE_UNISTD_H
 # include <unistd.h>
 #endif
-#ifdef _MSC_VER
-#include <io.h>
+
+#ifdef HAVE_IO_H
+# include <io.h>
 #endif
 
 struct tar_dev

+ 2 - 5
Utilities/cmtar/compat/fnmatch.c

@@ -70,11 +70,7 @@ static char rcsid[] = "$OpenBSD: fnmatch.c,v 1.6 1998/03/19 00:29:59 millert Exp
 #define  RANGE_NOMATCH  0
 #define  RANGE_ERROR  (-1)
 
-#ifdef NO_IBM_COMPILER_HORKAGE
 static int rangematch (const char *, char, int, char **);
-#else
-static int rangematch ();
-#endif
 
 int
 fnmatch(pattern, string, flags)
@@ -195,7 +191,8 @@ rangematch(pattern, test, flags, newp)
    * consistency with the regular expression syntax.
    * J.T. Conklin ([email protected])
    */
-  if ((negate = (*pattern == '!' || *pattern == '^')))
+  negate = (*pattern == '!' || *pattern == '^');
+  if (negate)
     ++pattern;
 
   if (flags & FNM_CASEFOLD)

+ 3 - 0
Utilities/cmtar/config.h.in

@@ -30,6 +30,9 @@
 /* Define to 1 if you have the <inttypes.h> header file. */
 #cmakedefine HAVE_INTTYPES_H @HAVE_INTTYPES_H@
 
+/* Define to 1 if you have the <io.h> header file. */
+#cmakedefine HAVE_IO_H @HAVE_IO_H@
+
 /* Define to 1 if you have the `lchown' function. */
 #cmakedefine HAVE_LCHOWN @HAVE_LCHOWN@
 

+ 10 - 0
Utilities/cmtar/extract.c

@@ -470,11 +470,13 @@ tar_extract_hardlink(TAR * t, char *realname)
     return -1;
   }
 
+#ifndef WIN32
   if (pathname)
     {
     free(pathname);
     }
   return 0;
+#endif
 }
 
 
@@ -545,11 +547,13 @@ tar_extract_symlink(TAR *t, char *realname)
     return -1;
   }
 
+#ifndef WIN32
   if (pathname)
     {
     free(pathname);
     }
   return 0;
+#endif
 }
 
 
@@ -620,11 +624,13 @@ tar_extract_chardev(TAR *t, char *realname)
     return -1;
   }
 
+#ifndef WIN32
   if (pathname)
     {
     free(pathname);
     }
   return 0;
+#endif
 }
 
 
@@ -694,11 +700,13 @@ tar_extract_blockdev(TAR *t, char *realname)
     return -1;
   }
 
+#ifndef WIN32
   if (pathname)
     {
     free(pathname);
     }
   return 0;
+#endif
 }
 
 
@@ -867,9 +875,11 @@ tar_extract_fifo(TAR *t, char *realname)
     return -1;
   }
 
+#ifndef WIN32
   if (pathname)
     {
     free(pathname);
     }
   return 0;
+#endif
 }

+ 1 - 1
Utilities/cmtar/handle.c

@@ -24,7 +24,7 @@
 # include <stdlib.h>
 #endif
 
-#if defined ( _MSC_VER) || defined(__WATCOMC__)
+#ifdef HAVE_IO_H
 #include <io.h>
 //Yogi: hack. this should work on windows where there is no O_ACCMODE defined
 #ifndef O_ACCMODE