some minor files.c cleanup

This commit is contained in:
nhmall
2023-11-20 14:59:03 -05:00
parent 2f167a4672
commit 033c6981d8
+20 -22
View File
@@ -1647,11 +1647,7 @@ docompress_file(const char *filename, boolean uncomp)
void void
nh_compress(const char *filename UNUSED_if_not_COMPRESS) nh_compress(const char *filename UNUSED_if_not_COMPRESS)
{ {
#if !defined(COMPRESS) && !defined(ZLIB_COMP) #if defined(COMPRESS) || defined(ZLIB_COMP)
#ifdef PRAGMA_UNUSED
#pragma unused(filename)
#endif
#else
docompress_file(filename, FALSE); docompress_file(filename, FALSE);
#endif #endif
} }
@@ -1660,11 +1656,7 @@ nh_compress(const char *filename UNUSED_if_not_COMPRESS)
void void
nh_uncompress(const char *filename UNUSED_if_not_COMPRESS) nh_uncompress(const char *filename UNUSED_if_not_COMPRESS)
{ {
#if !defined(COMPRESS) && !defined(ZLIB_COMP) #if defined(COMPRESS) || defined(ZLIB_COMP)
#ifdef PRAGMA_UNUSED
#pragma unused(filename)
#endif
#else
docompress_file(filename, TRUE); docompress_file(filename, TRUE);
#endif #endif
} }
@@ -1825,6 +1817,8 @@ docompress_file(const char *filename, boolean uncomp)
} }
#endif /* RLC 09 Mar 1999: End ZLIB patch */ #endif /* RLC 09 Mar 1999: End ZLIB patch */
#undef UNUSED_if_not_COMPRESS
/* ---------- END FILE COMPRESSION HANDLING ----------- */ /* ---------- END FILE COMPRESSION HANDLING ----------- */
/* ---------- BEGIN FILE LOCKING HANDLING ----------- */ /* ---------- BEGIN FILE LOCKING HANDLING ----------- */
@@ -1842,9 +1836,18 @@ struct flock sflock; /* for unlocking, same as above */
#define HUP #define HUP
#endif #endif
#if defined(UNIX) || defined(VMS) || defined(AMIGA) || defined(WIN32) \
|| defined(MSDOS)
#define UNUSED_conditional /*empty*/
#else
#define UNUSED_conditional UNUSED
#endif
#ifndef USE_FCNTL #ifndef USE_FCNTL
static char * static char *
make_lockname(const char *filename, char *lockname) make_lockname(const char *filename UNUSED_conditional, char *lockname)
{ {
#if defined(UNIX) || defined(VMS) || defined(AMIGA) || defined(WIN32) \ #if defined(UNIX) || defined(VMS) || defined(AMIGA) || defined(WIN32) \
|| defined(MSDOS) || defined(MSDOS)
@@ -1867,9 +1870,6 @@ make_lockname(const char *filename, char *lockname)
#endif #endif
return lockname; return lockname;
#else /* !(UNIX || VMS || AMIGA || WIN32 || MSDOS) */ #else /* !(UNIX || VMS || AMIGA || WIN32 || MSDOS) */
#ifdef PRAGMA_UNUSED
#pragma unused(filename)
#endif
lockname[0] = '\0'; lockname[0] = '\0';
return (char *) 0; return (char *) 0;
#endif #endif
@@ -1878,12 +1878,9 @@ make_lockname(const char *filename, char *lockname)
/* lock a file */ /* lock a file */
boolean boolean
lock_file(const char *filename, int whichprefix, int retryct) lock_file(const char *filename, int whichprefix,
int retryct UNUSED_conditional)
{ {
#if defined(PRAGMA_UNUSED) && !(defined(UNIX) || defined(VMS)) \
&& !(defined(AMIGA) || defined(WIN32) || defined(MSDOS))
#pragma unused(retryct)
#endif
#ifndef USE_FCNTL #ifndef USE_FCNTL
char locknambuf[BUFSZ]; char locknambuf[BUFSZ];
const char *lockname; const char *lockname;
@@ -2082,6 +2079,8 @@ unlock_file(const char *filename)
gn.nesting--; gn.nesting--;
} }
#undef UNUSED_conditional
/* ---------- END FILE LOCKING HANDLING ----------- */ /* ---------- END FILE LOCKING HANDLING ----------- */
/* ---------- BEGIN CONFIG FILE HANDLING ----------- */ /* ---------- BEGIN CONFIG FILE HANDLING ----------- */
@@ -4031,9 +4030,6 @@ read_sym_file(int which_set)
void void
check_recordfile(const char *dir UNUSED_if_not_OS2_CODEVIEW) check_recordfile(const char *dir UNUSED_if_not_OS2_CODEVIEW)
{ {
#if defined(PRAGMA_UNUSED) && !defined(OS2_CODEVIEW)
#pragma unused(dir)
#endif
const char *fq_record; const char *fq_record;
int fd; int fd;
@@ -4136,6 +4132,8 @@ check_recordfile(const char *dir UNUSED_if_not_OS2_CODEVIEW)
#endif /* MICRO || WIN32*/ #endif /* MICRO || WIN32*/
} }
#undef UNUSED_if_not_OS2_CODEVIEW
/* ---------- END SCOREBOARD CREATION ----------- */ /* ---------- END SCOREBOARD CREATION ----------- */
/* ---------- BEGIN PANIC/IMPOSSIBLE/TESTING LOG ----------- */ /* ---------- BEGIN PANIC/IMPOSSIBLE/TESTING LOG ----------- */