From 13a68cd97888d451d9f40b61891709af1648432b Mon Sep 17 00:00:00 2001 From: David Cole Date: Tue, 23 May 2006 12:38:22 -0400 Subject: COMP: Fix warnings on Borland dashboards... --- Utilities/cmtar/CMakeLists.txt | 1 + Utilities/cmtar/append.c | 5 +++-- Utilities/cmtar/compat/fnmatch.c | 7 ++----- Utilities/cmtar/config.h.in | 3 +++ Utilities/cmtar/extract.c | 10 ++++++++++ Utilities/cmtar/handle.c | 2 +- 6 files changed, 20 insertions(+), 8 deletions(-) diff --git a/Utilities/cmtar/CMakeLists.txt b/Utilities/cmtar/CMakeLists.txt index 3ef4100..1c3b470 100644 --- a/Utilities/cmtar/CMakeLists.txt +++ b/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" diff --git a/Utilities/cmtar/append.c b/Utilities/cmtar/append.c index 6b746ea..38e8294 100644 --- a/Utilities/cmtar/append.c +++ b/Utilities/cmtar/append.c @@ -31,8 +31,9 @@ #ifdef HAVE_UNISTD_H # include #endif -#ifdef _MSC_VER -#include + +#ifdef HAVE_IO_H +# include #endif struct tar_dev diff --git a/Utilities/cmtar/compat/fnmatch.c b/Utilities/cmtar/compat/fnmatch.c index d10e8a3..936f21e 100644 --- a/Utilities/cmtar/compat/fnmatch.c +++ b/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 (conklin@ngai.kaleida.com) */ - if ((negate = (*pattern == '!' || *pattern == '^'))) + negate = (*pattern == '!' || *pattern == '^'); + if (negate) ++pattern; if (flags & FNM_CASEFOLD) diff --git a/Utilities/cmtar/config.h.in b/Utilities/cmtar/config.h.in index 948afde..1ab4362 100644 --- a/Utilities/cmtar/config.h.in +++ b/Utilities/cmtar/config.h.in @@ -30,6 +30,9 @@ /* Define to 1 if you have the header file. */ #cmakedefine HAVE_INTTYPES_H @HAVE_INTTYPES_H@ +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_IO_H @HAVE_IO_H@ + /* Define to 1 if you have the `lchown' function. */ #cmakedefine HAVE_LCHOWN @HAVE_LCHOWN@ diff --git a/Utilities/cmtar/extract.c b/Utilities/cmtar/extract.c index 3ebdeeb..cb1fab3 100644 --- a/Utilities/cmtar/extract.c +++ b/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 } diff --git a/Utilities/cmtar/handle.c b/Utilities/cmtar/handle.c index 4f6dd10..a86bbc5 100644 --- a/Utilities/cmtar/handle.c +++ b/Utilities/cmtar/handle.c @@ -24,7 +24,7 @@ # include #endif -#if defined ( _MSC_VER) || defined(__WATCOMC__) +#ifdef HAVE_IO_H #include //Yogi: hack. this should work on windows where there is no O_ACCMODE defined #ifndef O_ACCMODE -- cgit v0.12