]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
fixes for test programs to be buildable by Open Watcom 67/head
authorJiri Malak <malak.jiri@gmail.com>
Wed, 12 Mar 2014 07:50:51 +0000 (08:50 +0100)
committerJiri Malak <malak.jiri@gmail.com>
Wed, 12 Mar 2014 07:50:51 +0000 (08:50 +0100)
correct buffers to be realy local for each test as expected by logic

16 files changed:
cpio/test/main.c
cpio/test/test.h
libarchive/test/main.c
libarchive/test/test.h
libarchive/test/test_read_data_large.c
libarchive/test/test_read_truncated.c
libarchive/test/test_write_filter_program.c
libarchive/test/test_write_format_ar.c
libarchive/test/test_write_format_gnutar.c
libarchive/test/test_write_format_iso9660.c
libarchive/test/test_write_format_iso9660_boot.c
libarchive/test/test_write_format_pax.c
libarchive/test/test_write_format_tar.c
libarchive/test/test_write_format_tar_sparse.c
tar/test/main.c
tar/test/test.h

index d4c6e5c3388c733edbc09db8cf40d3978fb37a2c..f83661637d79d78989801daf4fc072edb361c86f 100644 (file)
@@ -130,6 +130,14 @@ __FBSDID("$FreeBSD: src/usr.bin/cpio/test/main.c,v 1.3 2008/08/24 04:58:22 kient
 # include <crtdbg.h>
 #endif
 
+/* Path to working directory for current test */
+const char *testworkdir;
+/* Pathname of exe to be tested. */
+const char *testprogfile;
+/* Name of exe to use in printf-formatted command strings. */
+/* On Windows, this includes leading/trailing quotes. */
+const char *testprog;
+
 #if defined(_WIN32) && !defined(__CYGWIN__)
 static void    *GetFunctionKernel32(const char *);
 static int      my_CreateSymbolicLinkA(const char *, const char *, int);
@@ -194,7 +202,7 @@ my_GetFileInformationByName(const char *path, BY_HANDLE_FILE_INFORMATION *bhfi)
 }
 #endif
 
-#if defined(HAVE__CrtSetReportMode)
+#if defined(HAVE__CrtSetReportMode) && !defined(__WATCOMC__)
 static void
 invalid_parameter_handler(const wchar_t * expression,
     const wchar_t * function, const wchar_t * file,
@@ -2515,7 +2523,7 @@ main(int argc, char **argv)
        while (pwd[strlen(pwd) - 1] == '\n')
                pwd[strlen(pwd) - 1] = '\0';
 
-#if defined(HAVE__CrtSetReportMode)
+#if defined(HAVE__CrtSetReportMode) && !defined(__WATCOMC__)
        /* To stop to run the default invalid parameter handler. */
        _set_invalid_parameter_handler(invalid_parameter_handler);
        /* Disable annoying assertion message box. */
index 27813e1e52300aa99d26c69a252047deebb25ecd..41ab019b24e1491b7fb3b979b2f6ae6742727365 100644 (file)
@@ -305,17 +305,17 @@ char *slurpfile(size_t *, const char *fmt, ...);
 void extract_reference_file(const char *);
 
 /* Path to working directory for current test */
-const char *testworkdir;
+extern const char *testworkdir;
 
 /*
  * Special interfaces for program test harness.
  */
 
 /* Pathname of exe to be tested. */
-const char *testprogfile;
+extern const char *testprogfile;
 /* Name of exe to use in printf-formatted command strings. */
 /* On Windows, this includes leading/trailing quotes. */
-const char *testprog;
+extern const char *testprog;
 
 #ifdef USE_DMALLOC
 #include <dmalloc.h>
index f3567d982e2f5c495b9248b4782e19e8e5d032e2..f61d16c4cb3d7b51783180f025d82cb59e794b12 100644 (file)
@@ -128,6 +128,9 @@ __FBSDID("$FreeBSD: head/lib/libarchive/test/main.c 201247 2009-12-30 05:59:21Z
 # include <crtdbg.h>
 #endif
 
+/* Path to working directory for current test */
+const char *testworkdir;
+
 #if defined(_WIN32) && !defined(__CYGWIN__)
 static void    *GetFunctionKernel32(const char *);
 static int      my_CreateSymbolicLinkA(const char *, const char *, int);
@@ -192,7 +195,7 @@ my_GetFileInformationByName(const char *path, BY_HANDLE_FILE_INFORMATION *bhfi)
 }
 #endif
 
-#if defined(HAVE__CrtSetReportMode)
+#if defined(HAVE__CrtSetReportMode) && !defined(__WATCOMC__)
 static void
 invalid_parameter_handler(const wchar_t * expression,
     const wchar_t * function, const wchar_t * file,
index 51c56814c1d91b64558542a3470349d8fa2f81fb..105001c7c72f585e020bab6ce1d4302cb6c75c12 100644 (file)
@@ -315,7 +315,7 @@ void extract_reference_file(const char *);
 void extract_reference_files(const char **);
 
 /* Path to working directory for current test */
-const char *testworkdir;
+extern const char *testworkdir;
 
 /*
  * Special interfaces for libarchive test harness.
index 7bb72c01ed50e3027ae6886eb54e48ec52587302..418020d11109c932e62ac64bda7eae793e69cf17 100644 (file)
@@ -38,9 +38,9 @@ __FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_data_large.c 201247 2009-
 #define close _close
 #endif
 
-char buff1[11000000];
-char buff2[10000000];
-char buff3[10000000];
+static char buff1[11000000];
+static char buff2[10000000];
+static char buff3[10000000];
 
 DEFINE_TEST(test_read_data_large)
 {
index 3e66525673872fc4fe9a072dfadc3d6311932a33..3991ab2baa61d0b6bfefcca47a1166ef8411c06b 100644 (file)
@@ -25,8 +25,8 @@
 #include "test.h"
 __FBSDID("$FreeBSD: src/lib/libarchive/test/test_read_truncated.c,v 1.4 2008/09/01 05:38:33 kientzle Exp $");
 
-char buff[1000000];
-char buff2[100000];
+static char buff[1000000];
+static char buff2[100000];
 
 DEFINE_TEST(test_read_truncated)
 {
index c156b6d55d1e201872f0377e9eb1589bbe091fcd..9fe264c018dc7ed762d802093dfe9ccec5a7e664 100644 (file)
@@ -26,8 +26,8 @@
 #include "test.h"
 __FBSDID("$FreeBSD: head/lib/libarchive/test/test_write_compress_program.c 201247 2009-12-30 05:59:21Z kientzle $");
 
-char buff[1000000];
-char buff2[64];
+static char buff[1000000];
+static char buff2[64];
 
 DEFINE_TEST(test_write_filter_program)
 {
index 5db75871c75cd9f545f4bcce1b313d30e10f6d45..058d3b17875cc693f7a9386be8a9310037bc6ae6 100644 (file)
@@ -28,8 +28,8 @@
 #include "test.h"
 __FBSDID("$FreeBSD: head/lib/libarchive/test/test_write_format_ar.c 189308 2009-03-03 17:02:51Z kientzle $");
 
-char buff[4096];
-char buff2[64];
+static char buff[4096];
+static char buff2[64];
 static char strtab[] = "abcdefghijklmn.o/\nggghhhjjjrrrttt.o/\niiijjjdddsssppp.o/\n";
 
 DEFINE_TEST(test_write_format_ar)
index 67f5a107cb4c1eaa0d1917661469919d41aef62e..63ee6225f898c1ebdc28a1733a25db587bf27c2e 100644 (file)
@@ -25,7 +25,7 @@
 #include "test.h"
 __FBSDID("$FreeBSD$");
 
-char buff2[64];
+static char buff2[64];
 
 /* Some names 1026 characters long */
 static const char *longfilename = "abcdefghijklmnopqrstuvwxyz"
index 9c5a005fd131d4a602b508685d2daec5ea102839..1ea69a18359561cd40cc46dcdb5488fbd03e6bfd 100644 (file)
@@ -26,7 +26,7 @@
 #include "test.h"
 __FBSDID("$FreeBSD$");
 
-char buff2[64];
+static char buff2[64];
 DEFINE_TEST(test_write_format_iso9660)
 {
        size_t buffsize = 1000000;
index b1f185b9c45503e48d0e130fc5d30a817bb9daaf..433f633091f7e1b2f6c7c667d307a94780f02fec 100644 (file)
@@ -84,7 +84,7 @@ static const unsigned char el_torito_signature[] = {
     "IN PRIMARY VOLUME DESCRIPTOR FOR CONTACT INFORMATION."
 };
 
-char buff2[1024];
+static char buff2[1024];
 
 static void
 _test_write_format_iso9660_boot(int write_info_tbl)
index d29e9adcd867f568a619a5b3f32dd4ac66b4cdbc..1bae0050f0811227af823e13b89261538ba79534 100644 (file)
@@ -25,7 +25,7 @@
 #include "test.h"
 __FBSDID("$FreeBSD$");
 
-char buff2[64];
+static char buff2[64];
 
 DEFINE_TEST(test_write_format_pax)
 {
index 7d16bbfc6ec3c8dd20469f8a9e909d66d39bb3bd..3588e8fe2d948c65db0235315e838070069b44a3 100644 (file)
@@ -25,8 +25,8 @@
 #include "test.h"
 __FBSDID("$FreeBSD: head/lib/libarchive/test/test_write_format_tar.c 189308 2009-03-03 17:02:51Z kientzle $");
 
-char buff[1000000];
-char buff2[64];
+static char buff[1000000];
+static char buff2[64];
 
 DEFINE_TEST(test_write_format_tar)
 {
index c8e0f479779e55970e16d5ed222ca07b0b851a75..cc725a9a72ea58e6cb9ef8be900079a068e7dc3b 100644 (file)
@@ -26,7 +26,7 @@
 #include "test.h"
 __FBSDID("$FreeBSD$");
 
-char buff[1000000];
+static char buff[1000000];
 
 static void
 test_1(void)
index face5ca36baef51935d5043971fb7694b3ef6de4..b92ef2c7d3b1e845b814dabf4eac33f490121d14 100644 (file)
@@ -130,6 +130,14 @@ __FBSDID("$FreeBSD: src/usr.bin/tar/test/main.c,v 1.6 2008/11/05 06:40:53 kientz
 # include <crtdbg.h>
 #endif
 
+/* Path to working directory for current test */
+const char *testworkdir;
+/* Pathname of exe to be tested. */
+const char *testprogfile;
+/* Name of exe to use in printf-formatted command strings. */
+/* On Windows, this includes leading/trailing quotes. */
+const char *testprog;
+
 #if defined(_WIN32) && !defined(__CYGWIN__)
 static void    *GetFunctionKernel32(const char *);
 static int      my_CreateSymbolicLinkA(const char *, const char *, int);
@@ -194,7 +202,7 @@ my_GetFileInformationByName(const char *path, BY_HANDLE_FILE_INFORMATION *bhfi)
 }
 #endif
 
-#if defined(HAVE__CrtSetReportMode)
+#if defined(HAVE__CrtSetReportMode) && !defined(__WATCOMC__)
 static void
 invalid_parameter_handler(const wchar_t * expression,
     const wchar_t * function, const wchar_t * file,
index 0ef255f76f0a4c9ddf124d78ca36566ca13e25b7..7433219546acaecd35f7a17242905d3fa72b976a 100644 (file)
@@ -307,17 +307,17 @@ char *slurpfile(size_t *, const char *fmt, ...);
 void extract_reference_file(const char *);
 
 /* Path to working directory for current test */
-const char *testworkdir;
+extern const char *testworkdir;
 
 /*
  * Special interfaces for program test harness.
  */
 
 /* Pathname of exe to be tested. */
-const char *testprogfile;
+extern const char *testprogfile;
 /* Name of exe to use in printf-formatted command strings. */
 /* On Windows, this includes leading/trailing quotes. */
-const char *testprog;
+extern const char *testprog;
 
 #ifdef USE_DMALLOC
 #include <dmalloc.h>