From 32f8d2a43644c1720f5f057259b8bb6cfa19ed36 Mon Sep 17 00:00:00 2001 From: agc Date: Wed, 21 Jan 1998 15:09:10 +0000 Subject: Fix up an error relating to a forward declaration of the time(3) library function, found by Bill Coldwell on /alpha. Clean up the other warnings, too. --- archivers/unarj/patches/patch-aa | 135 +++++++++++++++++++-------------------- 1 file changed, 65 insertions(+), 70 deletions(-) (limited to 'archivers/unarj') diff --git a/archivers/unarj/patches/patch-aa b/archivers/unarj/patches/patch-aa index b8a59372191..c9c245d1855 100644 --- a/archivers/unarj/patches/patch-aa +++ b/archivers/unarj/patches/patch-aa @@ -12,73 +12,68 @@ all: unarj -*** environ.c.old Wed Jun 23 09:07:20 1993 ---- environ.c Wed Dec 28 04:38:04 1994 -*************** -*** 534,541 **** - } - - long -! gettz() /* returns the offset from GMT in seconds */ - { - #define NOONOFFSET 43200L - #define SEC_IN_DAY (24L * 60L * 60L) - #define INV_VALUE (SEC_IN_DAY + 1L) ---- 534,545 ---- - } - - long -! gettz(stamp) /* returns the offset from GMT in seconds */ -! time_t stamp; - { -+ #if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) -+ return -localtime(&stamp)->tm_gmtoff; -+ #else - #define NOONOFFSET 43200L - #define SEC_IN_DAY (24L * 60L * 60L) - #define INV_VALUE (SEC_IN_DAY + 1L) -*************** -*** 551,556 **** ---- 555,561 ---- - noontm = localtime(&noon); - retval = NOONOFFSET - 60 * (60 * noontm->tm_hour - noontm->tm_min); - return retval; -+ #endif - } - - long -*************** -*** 608,614 **** - (uint) attribute; - (uint) host; - -! m_time = mstonix(tstamp) + gettz(); - - tb.mtime = m_time; /* Set modification time */ - tb.atime = m_time; /* Set access time */ ---- 613,620 ---- - (uint) attribute; - (uint) host; - -! m_time = mstonix(tstamp); -! m_time += gettz(m_time); - - tb.mtime = m_time; /* Set modification time */ - tb.atime = m_time; /* Set access time */ -*** unarj.h.old Wed Jun 23 09:07:20 1993 ---- unarj.h Wed Dec 28 04:25:07 1994 -*************** -*** 104,111 **** ---- 104,115 ---- - #endif - - typedef unsigned char uchar; /* 8 bits or more */ -+ #if !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__NetBSD__) - typedef unsigned int uint; /* 16 - 32 bits or more */ - typedef unsigned short ushort; /* 16 bits or more */ -+ #else -+ # include -+ #endif - typedef unsigned long ulong; /* 32 bits or more */ - - #define USHRT_BIT (CHAR_BIT * sizeof(ushort)) +--- environ.c.orig Wed Jun 23 06:07:20 1993 ++++ environ.c Wed Jan 21 14:59:59 1998 +@@ -435,10 +435,14 @@ + #define time_t long + #endif + ++#include ++ ++#if !(defined(BSD) && BSD >= 199306) + extern struct tm *localtime(); + extern time_t time(); + extern char *strcpy(); + extern voidp *malloc(); ++#endif + + FILE * + file_open(name, mode) +@@ -534,8 +538,12 @@ + } + + long +-gettz() /* returns the offset from GMT in seconds */ ++gettz(stamp) /* returns the offset from GMT in seconds */ ++time_t stamp; + { ++#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) ++ return -localtime(&stamp)->tm_gmtoff; ++#else + #define NOONOFFSET 43200L + #define SEC_IN_DAY (24L * 60L * 60L) + #define INV_VALUE (SEC_IN_DAY + 1L) +@@ -551,6 +559,7 @@ + noontm = localtime(&noon); + retval = NOONOFFSET - 60 * (60 * noontm->tm_hour - noontm->tm_min); + return retval; ++#endif + } + + long +@@ -608,7 +617,8 @@ + (uint) attribute; + (uint) host; + +- m_time = mstonix(tstamp) + gettz(); ++ m_time = mstonix(tstamp); ++ m_time += gettz(m_time); + + tb.mtime = m_time; /* Set modification time */ + tb.atime = m_time; /* Set access time */ +--- unarj.h.orig Wed Jun 23 06:07:20 1993 ++++ unarj.h Wed Jan 21 15:03:39 1998 +@@ -104,9 +104,13 @@ + #endif + + typedef unsigned char uchar; /* 8 bits or more */ ++#if !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__NetBSD__) + typedef unsigned int uint; /* 16 - 32 bits or more */ + typedef unsigned short ushort; /* 16 bits or more */ + typedef unsigned long ulong; /* 32 bits or more */ ++#else ++# include ++#endif + + #define USHRT_BIT (CHAR_BIT * sizeof(ushort)) + -- cgit v1.2.3