commit 775b66a

Michael Forney  ·  2026-04-02 04:15:58 +0000 UTC
parent d897a12
unzip: Remove use of K&R function definitions
2 files changed,  +2129, -1
+2128, -0
   1@@ -0,0 +1,2128 @@
   2+From e53bad1be991d7b1d544625c92d4ff346946a635 Mon Sep 17 00:00:00 2001
   3+From: Michael Forney <mforney@mforney.org>
   4+Date: Wed, 1 Apr 2026 19:56:35 -0700
   5+Subject: [PATCH] Remove use of non-prototype function definitions
   6+
   7+---
   8+ amiga/smakefile    |   2 +-
   9+ aosvs/make_unz.cli |   2 +-
  10+ crc32.c            |   9 +--
  11+ crypt.c            |  37 +++++-----
  12+ envargs.c          |   8 +--
  13+ explode.c          |  37 ++++++----
  14+ extract.c          | 120 ++++++++++++---------------------
  15+ fileio.c           | 164 +++++++++++++++++++++------------------------
  16+ inflate.c          |  50 +++++++-------
  17+ list.c             |   9 +--
  18+ match.c            |  31 ++++-----
  19+ process.c          | 161 ++++++++++++++++++--------------------------
  20+ ttyio.c            |  60 +++++++++--------
  21+ ubz2err.c          |   3 +-
  22+ unix/configure     |   5 --
  23+ unix/unix.c        |  56 +++++-----------
  24+ unshrink.c         |   7 +-
  25+ unzip.c            |  39 ++++-------
  26+ unzip.h            |  57 +++-------------
  27+ zipinfo.c          |  37 ++++------
  28+ 20 files changed, 360 insertions(+), 534 deletions(-)
  29+
  30+diff --git a/amiga/smakefile b/amiga/smakefile
  31+index 48818f9..bf5c282 100644
  32+--- a/amiga/smakefile
  33++++ b/amiga/smakefile
  34+@@ -275,7 +275,7 @@ CCPUOPTSF = CPU=$(CUSECPU) $(CUTIL)
  35+ # cpu flags for UnzipSFX and MakeSFX (ensures portability to all Amigas)
  36+ CCPUOPTXM = CPU=ANY
  37+ 
  38+-CDEFINES = $(CMEMLIB) $(CDEFINES) DEF=AMIGA DEF=PROTO
  39++CDEFINES = $(CMEMLIB) $(CDEFINES) DEF=AMIGA
  40+ COPTIONS = CODE=NEAR NMINC VERBOSE STRINGMERGE PARAMETERS=BOTH
  41+ COPTIONS = $(COPTIONS) ERRORREXX NOERRORCONSOLE MEMSIZE=HUGE $(CLIST) $(CXREF)
  42+ COPTIONS = $(COPTIONS) $(CSTACK) STRICT UNSCHAR NOICONS
  43+diff --git a/aosvs/make_unz.cli b/aosvs/make_unz.cli
  44+index 8daf91e..0704944 100644
  45+--- a/aosvs/make_unz.cli
  46++++ b/aosvs/make_unz.cli
  47+@@ -1,5 +1,5 @@
  48+ push
  49+ prompt pop
  50+ searchlist :c_4.10 :c_4.10:lang_rt [!searchlist]
  51+-cc/link/NOUNX/NOSEA SYSV/DEFINE TERMIO/DEFINE AOS_VS/DEFINE=1 PROTO/DEFINE S_IFLNK/DEFINE=0120000 TIME.H/INCLUDE <unzip crc32 crypt envargs explode extract fileio globals inflate list match process ttyio ubz2err unreduce unshrink zipinfo aosvs>.c
  52++cc/link/NOUNX/NOSEA SYSV/DEFINE TERMIO/DEFINE AOS_VS/DEFINE=1 S_IFLNK/DEFINE=0120000 TIME.H/INCLUDE <unzip crc32 crypt envargs explode extract fileio globals inflate list match process ttyio ubz2err unreduce unshrink zipinfo aosvs>.c
  53+ pop
  54+diff --git a/crc32.c b/crc32.c
  55+index 02f504d..036d9e3 100644
  56+--- a/crc32.c
  57++++ b/crc32.c
  58+@@ -677,13 +677,14 @@ void free_crc_table()
  59+ 
  60+ 
  61+ /* ========================================================================= */
  62+-ulg crc32(crc, buf, len)
  63+-    ulg crc;                    /* crc shift register */
  64+-    register ZCONST uch *buf;   /* pointer to bytes to pump through */
  65+-    extent len;                 /* number of bytes in buf[] */
  66+ /* Run a set of bytes through the crc shift register.  If buf is a NULL
  67+    pointer, then initialize the crc shift register contents instead.
  68+    Return the current crc in either case. */
  69++ulg crc32(
  70++    ulg crc,                    /* crc shift register */
  71++    register ZCONST uch *buf,   /* pointer to bytes to pump through */
  72++    extent len                  /* number of bytes in buf[] */
  73++)
  74+ {
  75+   register z_uint4 c;
  76+   register ZCONST ulg near *crc_32_tab;
  77+diff --git a/crypt.c b/crypt.c
  78+index a8975f2..74ddc2a 100644
  79+--- a/crypt.c
  80++++ b/crypt.c
  81+@@ -146,8 +146,7 @@
  82+ /***********************************************************************
  83+  * Return the next byte in the pseudo-random sequence
  84+  */
  85+-int decrypt_byte(__G)
  86+-    __GDEF
  87++int decrypt_byte(__GPRO)
  88+ {
  89+     unsigned temp;  /* POTENTIAL BUG:  temp*(temp^1) may overflow in an
  90+                      * unpredictable manner on 16-bit systems; not a problem
  91+@@ -160,9 +159,10 @@ int decrypt_byte(__G)
  92+ /***********************************************************************
  93+  * Update the encryption keys with the next byte of plain text
  94+  */
  95+-int update_keys(__G__ c)
  96+-    __GDEF
  97+-    int c;                      /* byte of plain text */
  98++int update_keys(
  99++    __GPRO__
 100++    int c                       /* byte of plain text */
 101++)
 102+ {
 103+     GLOBAL(keys[0]) = CRC32(GLOBAL(keys[0]), c, CRY_CRC_TAB);
 104+     GLOBAL(keys[1]) = (GLOBAL(keys[1])
 105+@@ -180,9 +180,10 @@ int update_keys(__G__ c)
 106+  * Initialize the encryption keys and the random header according to
 107+  * the given password.
 108+  */
 109+-void init_keys(__G__ passwd)
 110+-    __GDEF
 111+-    ZCONST char *passwd;        /* password string with which to modify keys */
 112++void init_keys(
 113++    __GPRO__
 114++    ZCONST char *passwd         /* password string with which to modify keys */
 115++)
 116+ {
 117+ #ifdef IZ_CRC_BE_OPTIMIZ
 118+     if (cry_crctb_p == NULL) {
 119+@@ -209,8 +210,7 @@ void init_keys(__G__ passwd)
 120+  * crypt-crc32-table.
 121+  */
 122+ #ifdef IZ_CRC_BE_OPTIMIZ
 123+-local z_uint4 near *crytab_init(__G)
 124+-    __GDEF
 125++local z_uint4 near *crytab_init(__GPRO)
 126+ {
 127+     int i;
 128+ 
 129+@@ -450,9 +450,7 @@ unsigned zfwrite(buf, item_size, nb, f)
 130+  * Get the password and set up keys for current zipfile member.
 131+  * Return PK_ class error.
 132+  */
 133+-int decrypt(__G__ passwrd)
 134+-    __GDEF
 135+-    ZCONST char *passwrd;
 136++int decrypt(__GPRO__ ZCONST char *passwrd)
 137+ {
 138+     ush b;
 139+     int n, r;
 140+@@ -536,9 +534,7 @@ int decrypt(__G__ passwrd)
 141+ /***********************************************************************
 142+  * Test the password.  Return -1 if bad, 0 if OK.
 143+  */
 144+-local int testp(__G__ h)
 145+-    __GDEF
 146+-    ZCONST uch *h;
 147++local int testp(__GPRO__ ZCONST uch *h)
 148+ {
 149+     int r;
 150+     char *key_translated;
 151+@@ -591,10 +587,11 @@ local int testp(__G__ h)
 152+ } /* end function testp() */
 153+ 
 154+ 
 155+-local int testkey(__G__ h, key)
 156+-    __GDEF
 157+-    ZCONST uch *h;      /* decrypted header */
 158+-    ZCONST char *key;   /* decryption password to test */
 159++local int testkey(
 160++    __GPRO__
 161++    ZCONST uch *h,      /* decrypted header */
 162++    ZCONST char *key    /* decryption password to test */
 163++)
 164+ {
 165+     ush b;
 166+ #ifdef ZIP10
 167+diff --git a/envargs.c b/envargs.c
 168+index f0a230d..05a7902 100644
 169+--- a/envargs.c
 170++++ b/envargs.c
 171+@@ -46,10 +46,7 @@ static int count_args OF((ZCONST char *));
 172+ 
 173+ /* envargs() returns PK-style error code */
 174+ 
 175+-int envargs(Pargc, Pargv, envstr, envstr2)
 176+-    int *Pargc;
 177+-    char ***Pargv;
 178+-    ZCONST char *envstr, *envstr2;
 179++int envargs(int *Pargc, char ***Pargv, ZCONST char *envstr, ZCONST char *envstr2)
 180+ {
 181+     char *envptr;       /* value returned by getenv */
 182+     char *bufptr;       /* copy of env info */
 183+@@ -176,8 +173,7 @@ int envargs(Pargc, Pargv, envstr, envstr2)
 184+ 
 185+ 
 186+ 
 187+-static int count_args(s)
 188+-    ZCONST char *s;
 189++static int count_args(ZCONST char *s)
 190+ {
 191+     int count = 0;
 192+     char ch;
 193+diff --git a/explode.c b/explode.c
 194+index 3b558c2..9d79467 100644
 195+--- a/explode.c
 196++++ b/explode.c
 197+@@ -219,13 +219,14 @@ static ZCONST ush cpdist8[] =
 198+ }
 199+ 
 200+ 
 201+-static int get_tree(__G__ l, n)
 202+-     __GDEF
 203+-unsigned *l;            /* bit lengths */
 204+-unsigned n;             /* number expected */
 205+ /* Get the bit lengths for a code representation from the compressed
 206+    stream.  If get_tree() returns 4, then there is an error in the data.
 207+    Otherwise zero is returned. */
 208++static int get_tree(
 209++    __GDEF
 210++    unsigned *l,        /* bit lengths */
 211++    unsigned n          /* number expected */
 212++)
 213+ {
 214+   unsigned i;           /* bytes remaining in list */
 215+   unsigned k;           /* lengths entered */
 216+@@ -250,13 +251,18 @@ unsigned n;             /* number expected */
 217+ 
 218+ 
 219+ 
 220+-static int explode_lit(__G__ tb, tl, td, bb, bl, bd, bdl)
 221+-     __GDEF
 222+-struct huft *tb, *tl, *td;      /* literal, length, and distance tables */
 223+-unsigned bb, bl, bd;            /* number of bits decoded by those */
 224+-unsigned bdl;                   /* number of distance low bits */
 225+ /* Decompress the imploded data using coded literals and a sliding
 226+    window (of size 2^(6+bdl) bytes). */
 227++static int explode_lit(
 228++    __GPRO__
 229++    struct huft *tb,
 230++    struct huft *tl,
 231++    struct huft *td,    /* literal, length, and distance tables */
 232++    unsigned bb,
 233++    unsigned bl,
 234++    unsigned bd,        /* number of bits decoded by those */
 235++    unsigned bdl        /* number of distance low bits */
 236++)
 237+ {
 238+   zusz_t s;             /* bytes to decompress */
 239+   register unsigned e;  /* table entry flag/number of extra bits */
 240+@@ -368,13 +374,16 @@ unsigned bdl;                   /* number of distance low bits */
 241+ 
 242+ 
 243+ 
 244+-static int explode_nolit(__G__ tl, td, bl, bd, bdl)
 245+-     __GDEF
 246+-struct huft *tl, *td;   /* length and distance decoder tables */
 247+-unsigned bl, bd;        /* number of bits decoded by tl[] and td[] */
 248+-unsigned bdl;           /* number of distance low bits */
 249+ /* Decompress the imploded data using uncoded literals and a sliding
 250+    window (of size 2^(6+bdl) bytes). */
 251++static int explode_nolit(
 252++    __GPRO__
 253++    struct huft *tl,
 254++    struct huft *td,    /* length and distance decoder tables */
 255++    unsigned bl,
 256++    unsigned bd,        /* number of bits decoded by tl[] and td[] */
 257++    unsigned bdl        /* number of distance low bits */
 258++)
 259+ {
 260+   zusz_t s;             /* bytes to decompress */
 261+   register unsigned e;  /* table entry flag/number of extra bits */
 262+diff --git a/extract.c b/extract.c
 263+index 6712ed0..114f6c5 100644
 264+--- a/extract.c
 265++++ b/extract.c
 266+@@ -346,9 +346,7 @@ typedef struct {
 267+  * Return the index of the first span in cover whose beg is greater than val.
 268+  * If there is no such span, then cover->num is returned.
 269+  */
 270+-static size_t cover_find(cover, val)
 271+-    cover_t *cover;
 272+-    bound_t val;
 273++static size_t cover_find(cover_t *cover, bound_t val)
 274+ {
 275+     size_t lo = 0, hi = cover->num;
 276+     while (lo < hi) {
 277+@@ -362,9 +360,7 @@ static size_t cover_find(cover, val)
 278+ }
 279+ 
 280+ /* Return true if val lies within any one of the spans in cover. */
 281+-static int cover_within(cover, val)
 282+-    cover_t *cover;
 283+-    bound_t val;
 284++static int cover_within(cover_t *cover, bound_t val)
 285+ {
 286+     size_t pos = cover_find(cover, val);
 287+     return pos > 0 && val < cover->span[pos - 1].end;
 288+@@ -382,10 +378,7 @@ static int cover_within(cover, val)
 289+  * end, then -1 is returned. If the list needs to be grown but the memory
 290+  * allocation fails, then -2 is returned.
 291+  */
 292+-static int cover_add(cover, beg, end)
 293+-    cover_t *cover;
 294+-    bound_t beg;
 295+-    bound_t end;
 296++static int cover_add(cover_t *cover, bound_t beg, bound_t end)
 297+ {
 298+     size_t pos;
 299+     int prec, foll;
 300+@@ -449,8 +442,8 @@ static int cover_add(cover, beg, end)
 301+ /*  Function extract_or_test_files()  */
 302+ /**************************************/
 303+ 
 304+-int extract_or_test_files(__G)    /* return PK-type error code */
 305+-     __GDEF
 306++/* return PK-type error code */
 307++int extract_or_test_files(__GPRO)
 308+ {
 309+     unsigned i, j;
 310+     zoff_t cd_bufstart;
 311+@@ -975,8 +968,8 @@ int extract_or_test_files(__G)    /* return PK-type error code */
 312+ /*  Function store_info()  */
 313+ /***************************/
 314+ 
 315+-static int store_info(__G)   /* return 0 if skipping, 1 if OK */
 316+-    __GDEF
 317++/* return 0 if skipping, 1 if OK */
 318++static int store_info(__GPRO)
 319+ {
 320+ #ifdef USE_BZIP2
 321+ #  define UNKN_BZ2 (G.crec.compression_method!=BZIPPED)
 322+@@ -1152,8 +1145,7 @@ static int store_info(__G)   /* return 0 if skipping, 1 if OK */
 323+ /*  Function find_compr_idx()  */
 324+ /*******************************/
 325+ 
 326+-unsigned find_compr_idx(compr_methodnum)
 327+-    unsigned compr_methodnum;
 328++unsigned find_compr_idx(unsigned compr_methodnum)
 329+ {
 330+     unsigned i;
 331+ 
 332+@@ -1172,22 +1164,19 @@ unsigned find_compr_idx(compr_methodnum)
 333+ /*  Function extract_or_test_entrylist()  */
 334+ /******************************************/
 335+ 
 336+-static int extract_or_test_entrylist(__G__ numchunk,
 337+-                pfilnum, pnum_bad_pwd, pold_extra_bytes,
 338+-#ifdef SET_DIR_ATTRIB
 339+-                pnum_dirs, pdirlist,
 340+-#endif
 341+-                error_in_archive)    /* return PK-type error code */
 342+-    __GDEF
 343+-    unsigned numchunk;
 344+-    ulg *pfilnum;
 345+-    ulg *pnum_bad_pwd;
 346+-    zoff_t *pold_extra_bytes;
 347++/* return PK-type error code */
 348++static int extract_or_test_entrylist(
 349++    __GPRO__
 350++    unsigned numchunk,
 351++    ulg *pfilnum,
 352++    ulg *pnum_bad_pwd,
 353++    zoff_t *pold_extra_bytes,
 354+ #ifdef SET_DIR_ATTRIB
 355+-    unsigned *pnum_dirs;
 356+-    direntry **pdirlist;
 357++    unsigned *pnum_dirs,
 358++    direntry **pdirlist,
 359+ #endif
 360+-    int error_in_archive;
 361++    int error_in_archive
 362++)
 363+ {
 364+     unsigned i;
 365+     int renamed, query;
 366+@@ -1799,8 +1788,8 @@ reprompt:
 367+ /*  Function extract_or_test_member()  */
 368+ /***************************************/
 369+ 
 370+-static int extract_or_test_member(__G)    /* return PK-type error code */
 371+-     __GDEF
 372++/* return PK-type error code */
 373++static int extract_or_test_member(__GPRO)
 374+ {
 375+     char *nul="[empty] ", *txt="[text]  ", *bin="[binary]";
 376+ #ifdef CMS_MVS
 377+@@ -2218,10 +2207,7 @@ static int extract_or_test_member(__G)    /* return PK-type error code */
 378+ /*  Function TestExtraField()  */
 379+ /*******************************/
 380+ 
 381+-static int TestExtraField(__G__ ef, ef_len)
 382+-    __GDEF
 383+-    uch *ef;
 384+-    unsigned ef_len;
 385++static int TestExtraField(__GPRO__ uch *ef, unsigned ef_len)
 386+ {
 387+     ush ebID;
 388+     unsigned ebLen;
 389+@@ -2418,22 +2404,14 @@ static int TestExtraField(__G__ ef, ef_len)
 390+ /*  Function test_compr_eb()  */
 391+ /******************************/
 392+ 
 393+-#ifdef PROTO
 394+ static int test_compr_eb(
 395+     __GPRO__
 396+     uch *eb,
 397+     unsigned eb_size,
 398+     unsigned compr_offset,
 399+     int (*test_uc_ebdata)(__GPRO__ uch *eb, unsigned eb_size,
 400+-                          uch *eb_ucptr, ulg eb_ucsize))
 401+-#else /* !PROTO */
 402+-static int test_compr_eb(__G__ eb, eb_size, compr_offset, test_uc_ebdata)
 403+-    __GDEF
 404+-    uch *eb;
 405+-    unsigned eb_size;
 406+-    unsigned compr_offset;
 407+-    int (*test_uc_ebdata)();
 408+-#endif /* ?PROTO */
 409++                          uch *eb_ucptr, ulg eb_ucsize)
 410++)
 411+ {
 412+     ulg eb_ucsize;
 413+     uch *eb_ucptr;
 414+@@ -2493,12 +2471,11 @@ static int test_compr_eb(__G__ eb, eb_size, compr_offset, test_uc_ebdata)
 415+ /*  Function memextract()  */
 416+ /***************************/
 417+ 
 418+-int memextract(__G__ tgt, tgtsize, src, srcsize)  /* extract compressed */
 419+-    __GDEF                                        /*  extra field block; */
 420+-    uch *tgt;                                     /*  return PK-type error */
 421+-    ulg tgtsize;                                  /*  level */
 422+-    ZCONST uch *src;
 423+-    ulg srcsize;
 424++/* extract compressed */
 425++/*  extra field block; */
 426++/*  return PK-type error */
 427++/*  level */
 428++int memextract(__GPRO__ uch *tgt, ulg tgtsize, ZCONST uch *src, ulg srcsize)
 429+ {
 430+     zoff_t old_csize=G.csize;
 431+     uch   *old_inptr=G.inptr;
 432+@@ -2582,10 +2559,7 @@ int memextract(__G__ tgt, tgtsize, src, srcsize)  /* extract compressed */
 433+ /*  Function memflush()  */
 434+ /*************************/
 435+ 
 436+-int memflush(__G__ rawbuf, size)
 437+-    __GDEF
 438+-    ZCONST uch *rawbuf;
 439+-    ulg size;
 440++int memflush(__GPRO__ ZCONST uch *rawbuf, ulg size)
 441+ {
 442+     if (size > G.outsize)
 443+         /* Here, PK_DISK is a bit off-topic, but in the sense of marking
 444+@@ -2622,13 +2596,7 @@ int memflush(__G__ rawbuf, size)
 445+  * - Deflation (see memextract())
 446+  * The IZVMS block data is returned in malloc'd space.
 447+  */
 448+-uch *extract_izvms_block(__G__ ebdata, size, retlen, init, needlen)
 449+-    __GDEF
 450+-    ZCONST uch *ebdata;
 451+-    unsigned size;
 452+-    unsigned *retlen;
 453+-    ZCONST uch *init;
 454+-    unsigned needlen;
 455++uch *extract_izvms_block(__GPRO__ ZCONST uch *ebdata, unsigned size, unsigned *retlen, ZCONST uch *init, unsigned needlen)
 456+ {
 457+     uch *ucdata;       /* Pointer to block allocated */
 458+     int cmptype;
 459+@@ -2684,10 +2652,11 @@ uch *extract_izvms_block(__G__ ebdata, size, retlen, init, needlen)
 460+  *  else
 461+  *      putbit(0)
 462+  */
 463+-static void decompress_bits(outptr, needlen, bitptr)
 464+-    uch *outptr;        /* Pointer into output block */
 465+-    unsigned needlen;   /* Size of uncompressed block */
 466+-    ZCONST uch *bitptr; /* Pointer into compressed data */
 467++static void decompress_bits(
 468++    uch *outptr,        /* Pointer into output block */
 469++    unsigned needlen,   /* Size of uncompressed block */
 470++    ZCONST uch *bitptr  /* Pointer into compressed data */
 471++)
 472+ {
 473+     ulg bitbuf = 0;
 474+     int bitcnt = 0;
 475+@@ -2730,9 +2699,7 @@ static void decompress_bits(outptr, needlen, bitptr)
 476+ /* Function set_deferred_symlink() */
 477+ /***********************************/
 478+ 
 479+-static void set_deferred_symlink(__G__ slnk_entry)
 480+-    __GDEF
 481+-    slinkentry *slnk_entry;
 482++static void set_deferred_symlink(__GPRO__ slinkentry *slnk_entry)
 483+ {
 484+     extent ucsize = slnk_entry->targetlen;
 485+     char *linkfname = slnk_entry->fname;
 486+@@ -2787,10 +2754,8 @@ static void set_deferred_symlink(__G__ slnk_entry)
 487+ /*  Function fnfilter()  */        /* here instead of in list.c for SFX */
 488+ /*************************/
 489+ 
 490+-char *fnfilter(raw, space, size)   /* convert name to safely printable form */
 491+-    ZCONST char *raw;
 492+-    uch *space;
 493+-    extent size;
 494++/* convert name to safely printable form */
 495++char *fnfilter(ZCONST char *raw, uch *space, extent size)
 496+ {
 497+ #ifndef NATIVE   /* ASCII:  filter ANSI escape codes, etc. */
 498+     ZCONST uch *r=(ZCONST uch *)raw;
 499+@@ -2913,8 +2878,8 @@ char *fnfilter(raw, space, size)   /* convert name to safely printable form */
 500+ /*  Function dircomp()  */
 501+ /************************/
 502+ 
 503+-static int Cdecl dircomp(a, b)  /* used by qsort(); swiped from Zip */
 504+-    ZCONST zvoid *a, *b;
 505++/* used by qsort(); swiped from Zip */
 506++static int Cdecl dircomp(ZCONST zvoid *a, ZCONST zvoid *b)
 507+ {
 508+     /* order is significant:  this sorts in reverse order (deepest first) */
 509+     return strcmp((*(direntry **)b)->fn, (*(direntry **)a)->fn);
 510+@@ -2930,9 +2895,8 @@ static int Cdecl dircomp(a, b)  /* used by qsort(); swiped from Zip */
 511+ /*  Function UZbunzip2()  */
 512+ /**************************/
 513+ 
 514+-int UZbunzip2(__G)
 515+-__GDEF
 516+ /* decompress a bzipped entry using the libbz2 routines */
 517++int UZbunzip2(__GPRO)
 518+ {
 519+     int retval = 0;     /* return code: 0 = "no error" */
 520+     int err=BZ_OK;
 521+diff --git a/fileio.c b/fileio.c
 522+index 50a74fc..dff4c73 100644
 523+--- a/fileio.c
 524++++ b/fileio.c
 525+@@ -220,8 +220,8 @@ static ZCONST char Far ExtraFieldCorrupt[] =
 526+ /* Function open_input_file() */
 527+ /******************************/
 528+ 
 529+-int open_input_file(__G)    /* return 1 if open failed */
 530+-    __GDEF
 531++/* return 1 if open failed */
 532++int open_input_file(__GPRO__)
 533+ {
 534+     /*
 535+      *  open the zipfile for reading and in BINARY mode to prevent cr/lf
 536+@@ -271,8 +271,8 @@ int open_input_file(__G)    /* return 1 if open failed */
 537+ /* Function open_outfile() */
 538+ /***************************/
 539+ 
 540+-int open_outfile(__G)           /* return 1 if fail */
 541+-    __GDEF
 542++/* return 1 if fail */
 543++int open_outfile(__GPRO__)
 544+ {
 545+ #ifdef DLL
 546+     if (G.redirect_data)
 547+@@ -524,8 +524,7 @@ int open_outfile(__G)           /* return 1 if fail */
 548+ /* function undefer_input() */
 549+ /****************************/
 550+ 
 551+-void undefer_input(__G)
 552+-    __GDEF
 553++void undefer_input(__GPRO__)
 554+ {
 555+     if (G.incnt > 0)
 556+         G.csize += G.incnt;
 557+@@ -553,8 +552,7 @@ void undefer_input(__G)
 558+ /* function defer_leftover_input() */
 559+ /***********************************/
 560+ 
 561+-void defer_leftover_input(__G)
 562+-    __GDEF
 563++void defer_leftover_input(__GPRO__)
 564+ {
 565+     if ((zoff_t)G.incnt > G.csize) {
 566+         /* (G.csize < MAXINT), we can safely cast it to int !! */
 567+@@ -576,10 +574,8 @@ void defer_leftover_input(__G)
 568+ /* Function readbuf() */
 569+ /**********************/
 570+ 
 571+-unsigned readbuf(__G__ buf, size)   /* return number of bytes read into buf */
 572+-    __GDEF
 573+-    char *buf;
 574+-    register unsigned size;
 575++/* return number of bytes read into buf */
 576++unsigned readbuf(__GPRO__ char *buf, register unsigned size)
 577+ {
 578+     register unsigned count;
 579+     unsigned n;
 580+@@ -619,8 +615,8 @@ unsigned readbuf(__G__ buf, size)   /* return number of bytes read into buf */
 581+ /* Function readbyte() */
 582+ /***********************/
 583+ 
 584+-int readbyte(__G)   /* refill inbuf and return a byte if available, else EOF */
 585+-    __GDEF
 586++/* refill inbuf and return a byte if available, else EOF */
 587++int readbyte(__GPRO)
 588+ {
 589+     if (G.mem_mode)
 590+         return EOF;
 591+@@ -679,8 +675,8 @@ int readbyte(__G)   /* refill inbuf and return a byte if available, else EOF */
 592+ /* Function fillinbuf() */
 593+ /************************/
 594+ 
 595+-int fillinbuf(__G) /* like readbyte() except returns number of bytes in inbuf */
 596+-    __GDEF
 597++/* like readbyte() except returns number of bytes in inbuf */
 598++int fillinbuf(__GPRO)
 599+ {
 600+     if (G.mem_mode ||
 601+                   (G.incnt = read(G.zipfd, (char *)G.inbuf, INBUFSIZ)) <= 0)
 602+@@ -713,9 +709,7 @@ int fillinbuf(__G) /* like readbyte() except returns number of bytes in inbuf */
 603+ /* Function seek_zipf() */
 604+ /************************/
 605+ 
 606+-int seek_zipf(__G__ abs_offset)
 607+-    __GDEF
 608+-    zoff_t abs_offset;
 609++int seek_zipf(__GPRO__ zoff_t abs_offset)
 610+ {
 611+ /*
 612+  *  Seek to the block boundary of the block which includes abs_offset,
 613+@@ -784,11 +778,7 @@ int seek_zipf(__G__ abs_offset)
 614+ /* Function flush() */   /* returns PK error codes: */
 615+ /********************/   /* if tflag => always 0; PK_DISK if write error */
 616+ 
 617+-int flush(__G__ rawbuf, size, unshrink)
 618+-    __GDEF
 619+-    uch *rawbuf;
 620+-    ulg size;
 621+-    int unshrink;
 622++int flush(__GPRO__ uch *rawbuf, ulg size, int unshrink)
 623+ #if (defined(USE_DEFLATE64) && defined(__16BIT__))
 624+ {
 625+     int ret;
 626+@@ -812,11 +802,12 @@ int flush(__G__ rawbuf, size, unshrink)
 627+ /* Function partflush() */  /* returns PK error codes: */
 628+ /************************/  /* if tflag => always 0; PK_DISK if write error */
 629+ 
 630+-static int partflush(__G__ rawbuf, size, unshrink)
 631+-    __GDEF
 632+-    uch *rawbuf;        /* cannot be ZCONST, gets passed to (*G.message)() */
 633+-    ulg size;
 634+-    int unshrink;
 635++static int partflush(
 636++    __GPRO__
 637++    uch *rawbuf,        /* cannot be ZCONST, gets passed to (*G.message)() */
 638++    ulg size,
 639++    int unshrink
 640++)
 641+ #endif /* USE_DEFLATE64 && __16BIT__ */
 642+ {
 643+     register uch *p;
 644+@@ -1090,10 +1081,11 @@ static int partflush(__G__ rawbuf, size, unshrink)
 645+ /* Function is_vms_varlen_txt() */
 646+ /********************************/
 647+ 
 648+-static int is_vms_varlen_txt(__G__ ef_buf, ef_len)
 649+-    __GDEF
 650+-    uch *ef_buf;        /* buffer containing extra field */
 651+-    unsigned ef_len;    /* total length of extra field */
 652++static int is_vms_varlen_txt(
 653++    __GPRO__
 654++    uch *ef_buf,        /* buffer containing extra field */
 655++    unsigned ef_len     /* total length of extra field */
 656++)
 657+ {
 658+     unsigned eb_id;
 659+     unsigned eb_len;
 660+@@ -1216,8 +1208,7 @@ static int is_vms_varlen_txt(__G__ ef_buf, ef_len)
 661+ /* Function disk_error() */
 662+ /*************************/
 663+ 
 664+-static int disk_error(__G)
 665+-    __GDEF
 666++static int disk_error(__GPRO)
 667+ {
 668+     /* OK to use slide[] here because this file is finished regardless */
 669+     Info(slide, 0x4a1, ((char *)slide, LoadFarString(DiskFullQuery),
 670+@@ -1245,11 +1236,12 @@ static int disk_error(__G)
 671+ /* Function UzpMessagePrnt() */
 672+ /*****************************/
 673+ 
 674+-int UZ_EXP UzpMessagePrnt(pG, buf, size, flag)
 675+-    zvoid *pG;   /* globals struct:  always passed */
 676+-    uch *buf;    /* preformatted string to be printed */
 677+-    ulg size;    /* length of string (may include nulls) */
 678+-    int flag;    /* flag bits */
 679++int UZ_EXP UzpMessagePrnt(
 680++    zvoid *pG,   /* globals struct:  always passed */
 681++    uch *buf,    /* preformatted string to be printed */
 682++    ulg size,    /* length of string (may include nulls) */
 683++    int flag     /* flag bits */
 684++)
 685+ {
 686+     /* IMPORTANT NOTE:
 687+      *    The name of the first parameter of UzpMessagePrnt(), which passes
 688+@@ -1488,11 +1480,12 @@ int UZ_EXP UzpMessageNull(pG, buf, size, flag)
 689+ /* Function UzpInput() */   /* GRR:  this is a placeholder for now */
 690+ /***********************/
 691+ 
 692+-int UZ_EXP UzpInput(pG, buf, size, flag)
 693+-    zvoid *pG;    /* globals struct:  always passed */
 694+-    uch *buf;     /* preformatted string to be printed */
 695+-    int *size;    /* (address of) size of buf and of returned string */
 696+-    int flag;     /* flag bits (bit 0: no echo) */
 697++int UZ_EXP UzpInput(
 698++    zvoid *pG,    /* globals struct:  always passed */
 699++    uch *buf,     /* preformatted string to be printed */
 700++    int *size,    /* (address of) size of buf and of returned string */
 701++    int flag      /* flag bits (bit 0: no echo) */
 702++)
 703+ {
 704+     /* tell picky compilers to shut up about "unused variable" warnings */
 705+     pG = pG; buf = buf; flag = flag;
 706+@@ -1512,10 +1505,11 @@ int UZ_EXP UzpInput(pG, buf, size, flag)
 707+ /* Function UzpMorePause() */
 708+ /***************************/
 709+ 
 710+-void UZ_EXP UzpMorePause(pG, prompt, flag)
 711+-    zvoid *pG;            /* globals struct:  always passed */
 712+-    ZCONST char *prompt;  /* "--More--" prompt */
 713+-    int flag;             /* 0 = any char OK; 1 = accept only '\n', ' ', q */
 714++void UZ_EXP UzpMorePause(
 715++    zvoid *pG,            /* globals struct:  always passed */
 716++    ZCONST char *prompt,  /* "--More--" prompt */
 717++    int flag              /* 0 = any char OK; 1 = accept only '\n', ' ', q */
 718++)
 719+ {
 720+     uch c;
 721+ 
 722+@@ -1574,13 +1568,14 @@ void UZ_EXP UzpMorePause(pG, prompt, flag)
 723+ /* Function UzpPassword() */
 724+ /**************************/
 725+ 
 726+-int UZ_EXP UzpPassword (pG, rcnt, pwbuf, size, zfn, efn)
 727+-    zvoid *pG;         /* pointer to UnZip's internal global vars */
 728+-    int *rcnt;         /* retry counter */
 729+-    char *pwbuf;       /* buffer for password */
 730+-    int size;          /* size of password buffer */
 731+-    ZCONST char *zfn;  /* name of zip archive */
 732+-    ZCONST char *efn;  /* name of archive entry being processed */
 733++int UZ_EXP UzpPassword(
 734++    zvoid *pG,         /* pointer to UnZip's internal global vars */
 735++    int *rcnt,         /* retry counter */
 736++    char *pwbuf,       /* buffer for password */
 737++    int size,          /* size of password buffer */
 738++    ZCONST char *zfn,  /* name of zip archive */
 739++    ZCONST char *efn   /* name of archive entry being processed */
 740++)
 741+ {
 742+ #if CRYPT
 743+     int r = IZ_PW_ENTERED;
 744+@@ -1647,8 +1642,8 @@ int UZ_EXP UzpPassword (pG, rcnt, pwbuf, size, zfn, efn)
 745+ /* Function handler() */
 746+ /**********************/
 747+ 
 748+-void handler(signal)   /* upon interrupt, turn on echo and exit cleanly */
 749+-    int signal;
 750++/* upon interrupt, turn on echo and exit cleanly */
 751++void handler(int signal)
 752+ {
 753+     GETGLOBALS();
 754+ 
 755+@@ -1711,8 +1706,7 @@ ZCONST ush ydays[] =
 756+ /* Function dos_to_unix_time() */ /* used for freshening/updating/timestamps */
 757+ /*******************************/
 758+ 
 759+-time_t dos_to_unix_time(dosdatetime)
 760+-    ulg dosdatetime;
 761++time_t dos_to_unix_time(ulg dosdatetime)
 762+ {
 763+     time_t m_time;
 764+ 
 765+@@ -1897,9 +1891,10 @@ time_t dos_to_unix_time(dosdatetime)
 766+ /* Function check_for_newer() */  /* used for overwriting/freshening/updating */
 767+ /******************************/
 768+ 
 769+-int check_for_newer(__G__ filename)  /* return 1 if existing file is newer */
 770+-    __GDEF                           /*  or equal; 0 if older; -1 if doesn't */
 771+-    char *filename;                  /*  exist yet */
 772++/* return 1 if existing file is newer */
 773++/*  or equal; 0 if older; -1 if doesn't */
 774++/*  exist yet */
 775++int check_for_newer(__GPRO__ char *filename)
 776+ {
 777+     time_t existing, archive;
 778+ #ifdef USE_EF_UT_TIME
 779+@@ -2016,10 +2011,12 @@ int check_for_newer(__G__ filename)  /* return 1 if existing file is newer */
 780+ /* Function do_string() */
 781+ /************************/
 782+ 
 783+-int do_string(__G__ length, option)   /* return PK-type error code */
 784+-    __GDEF
 785+-    unsigned int length;        /* without prototype, ush converted to this */
 786+-    int option;
 787++/* return PK-type error code */
 788++int do_string(
 789++    __GPRO__
 790++    unsigned int length,        /* without prototype, ush converted to this */
 791++    int option
 792++)
 793+ {
 794+     unsigned comment_bytes_left;
 795+     unsigned int block_len;
 796+@@ -2446,8 +2443,7 @@ int do_string(__G__ length, option)   /* return PK-type error code */
 797+ /* Function makeword() */
 798+ /***********************/
 799+ 
 800+-ush makeword(b)
 801+-    ZCONST uch *b;
 802++ush makeword(ZCONST uch *b)
 803+ {
 804+     /*
 805+      * Convert Intel style 'short' integer to non-Intel non-16-bit
 806+@@ -2464,8 +2460,7 @@ ush makeword(b)
 807+ /* Function makelong() */
 808+ /***********************/
 809+ 
 810+-ulg makelong(sig)
 811+-    ZCONST uch *sig;
 812++ulg makelong(ZCONST uch *sig)
 813+ {
 814+     /*
 815+      * Convert intel style 'long' variable to non-Intel non-16-bit
 816+@@ -2485,8 +2480,7 @@ ulg makelong(sig)
 817+ /* Function makeint64() */
 818+ /************************/
 819+ 
 820+-zusz_t makeint64(sig)
 821+-    ZCONST uch *sig;
 822++zusz_t makeint64(ZCONST uch *sig)
 823+ {
 824+ #ifdef LARGE_FILE_SUPPORT
 825+     /*
 826+@@ -2524,11 +2518,7 @@ zusz_t makeint64(sig)
 827+ /*********************/
 828+ 
 829+ /* Format a zoff_t value in a cylindrical buffer set. */
 830+-char *fzofft(__G__ val, pre, post)
 831+-    __GDEF
 832+-    zoff_t val;
 833+-    ZCONST char *pre;
 834+-    ZCONST char *post;
 835++char *fzofft(__GPRO__ zoff_t val, ZCONST char *pre, ZCONST char *post)
 836+ {
 837+     /* Storage cylinder. (now in globals.h) */
 838+     /*static char fzofft_buf[FZOFFT_NUM][FZOFFT_LEN];*/
 839+@@ -2581,9 +2571,10 @@ char *fzofft(__G__ val, pre, post)
 840+ /* Function str2iso() */
 841+ /**********************/
 842+ 
 843+-char *str2iso(dst, src)
 844+-    char *dst;                          /* destination buffer */
 845+-    register ZCONST char *src;          /* source string */
 846++char *str2iso(
 847++    char *dst,                          /* destination buffer */
 848++    register ZCONST char *src           /* source string */
 849++)
 850+ {
 851+ #ifdef INTERN_TO_ISO
 852+     INTERN_TO_ISO(src, dst);
 853+@@ -2607,9 +2598,10 @@ char *str2iso(dst, src)
 854+ /* Function str2oem() */
 855+ /**********************/
 856+ 
 857+-char *str2oem(dst, src)
 858+-    char *dst;                          /* destination buffer */
 859+-    register ZCONST char *src;          /* source string */
 860++char *str2oem(
 861++    char *dst,                          /* destination buffer */
 862++    register ZCONST char *src           /* source string */
 863++)
 864+ {
 865+ #ifdef INTERN_TO_OEM
 866+     INTERN_TO_OEM(src, dst);
 867+@@ -2702,9 +2694,7 @@ zvoid *memcpy(dst, src, len)
 868+ /* Function zstrnicmp() */
 869+ /************************/
 870+ 
 871+-int zstrnicmp(s1, s2, n)
 872+-    register ZCONST char *s1, *s2;
 873+-    register unsigned n;
 874++int zstrnicmp(register ZCONST char *s1, register ZCONST char *s2, register unsigned n)
 875+ {
 876+     for (; n > 0;  --n, ++s1, ++s2) {
 877+ 
 878+diff --git a/inflate.c b/inflate.c
 879+index 2c37999..81bf089 100644
 880+--- a/inflate.c
 881++++ b/inflate.c
 882+@@ -718,11 +718,7 @@ uzinflate_cleanup_exit:
 883+ 
 884+ /* Function prototypes */
 885+ #ifndef OF
 886+-#  ifdef __STDC__
 887+-#    define OF(a) a
 888+-#  else
 889+-#    define OF(a) ()
 890+-#  endif
 891++#  define OF(a) a
 892+ #endif /* !OF */
 893+ int inflate_codes OF((__GPRO__ struct huft *tl, struct huft *td,
 894+                       unsigned bl, unsigned bd));
 895+@@ -929,12 +925,13 @@ static ZCONST unsigned dbits = 6;
 896+ 
 897+ #ifndef ASM_INFLATECODES
 898+ 
 899+-int inflate_codes(__G__ tl, td, bl, bd)
 900+-     __GDEF
 901+-struct huft *tl, *td;   /* literal/length and distance decoder tables */
 902+-unsigned bl, bd;        /* number of bits decoded by tl[] and td[] */
 903+ /* inflate (decompress) the codes in a deflated (compressed) block.
 904+    Return an error code or zero if it all goes ok. */
 905++int inflate_codes(
 906++    __GPRO__
 907++    struct huft *tl, struct huft *td, /* literal/length and distance decoder tables */
 908++    unsigned bl, unsigned bd          /* number of bits decoded by tl[] and td[] */
 909++)
 910+ {
 911+   register unsigned e;  /* table entry flag/number of extra bits */
 912+   unsigned d;           /* index for copy */
 913+@@ -1383,10 +1380,11 @@ cleanup_and_exit:
 914+ 
 915+ 
 916+ 
 917+-static int inflate_block(__G__ e)
 918+-  __GDEF
 919+-  int *e;               /* last block flag */
 920+ /* decompress an inflated block */
 921++static int inflate_block(
 922++  __GPRO__
 923++  int *e                /* last block flag */
 924++)
 925+ {
 926+   unsigned t;           /* block type */
 927+   register ulg b;       /* bit buffer */
 928+@@ -1434,10 +1432,8 @@ cleanup_and_exit:
 929+ 
 930+ 
 931+ 
 932+-int inflate(__G__ is_defl64)
 933+-    __GDEF
 934+-    int is_defl64;
 935+ /* decompress an inflated entry */
 936++int inflate(__GPRO__ int is_defl64)
 937+ {
 938+   int e;                /* last block flag */
 939+   int r;                /* result code */
 940+@@ -1548,15 +1544,6 @@ int inflate_free(__G)
 941+ #define N_MAX 288       /* maximum number of codes in any set */
 942+ 
 943+ 
 944+-int huft_build(__G__ b, n, s, d, e, t, m)
 945+-  __GDEF
 946+-  ZCONST unsigned *b;   /* code lengths in bits (all assumed <= BMAX) */
 947+-  unsigned n;           /* number of codes (assumed <= N_MAX) */
 948+-  unsigned s;           /* number of simple-valued codes (0..s-1) */
 949+-  ZCONST ush *d;        /* list of base values for non-simple codes */
 950+-  ZCONST uch *e;        /* list of extra bits for non-simple codes */
 951+-  struct huft **t;      /* result: starting table */
 952+-  unsigned *m;          /* maximum lookup bits, returns actual */
 953+ /* Given a list of code lengths and a maximum table size, make a set of
 954+    tables to decode that set of codes.  Return zero on success, one if
 955+    the given code set is incomplete (the tables are still built in this
 956+@@ -1565,6 +1552,16 @@ int huft_build(__G__ b, n, s, d, e, t, m)
 957+    The code with value 256 is special, and the tables are constructed
 958+    so that no bits beyond that code are fetched when that code is
 959+    decoded. */
 960++int huft_build(
 961++  __GPRO__
 962++  ZCONST unsigned *b,   /* code lengths in bits (all assumed <= BMAX) */
 963++  unsigned n,           /* number of codes (assumed <= N_MAX) */
 964++  unsigned s,           /* number of simple-valued codes (0..s-1) */
 965++  ZCONST ush *d,        /* list of base values for non-simple codes */
 966++  ZCONST uch *e,        /* list of extra bits for non-simple codes */
 967++  struct huft **t,      /* result: starting table */
 968++  unsigned *m           /* maximum lookup bits, returns actual */
 969++)
 970+ {
 971+   unsigned a;                   /* counter for codes of length k */
 972+   unsigned c[BMAX+1];           /* bit length count table */
 973+@@ -1754,11 +1751,12 @@ int huft_build(__G__ b, n, s, d, e, t, m)
 974+ 
 975+ 
 976+ 
 977+-int huft_free(t)
 978+-struct huft *t;         /* table to free */
 979+ /* Free the malloc'ed tables built by huft_build(), which makes a linked
 980+    list of the tables it made, with the links in a dummy first entry of
 981+    each table. */
 982++int huft_free(
 983++    struct huft *t          /* table to free */
 984++)
 985+ {
 986+   register struct huft *p, *q;
 987+ 
 988+diff --git a/list.c b/list.c
 989+index e488109..3454037 100644
 990+--- a/list.c
 991++++ b/list.c
 992+@@ -562,10 +562,8 @@ static int fn_is_dir(__G)    /* returns TRUE if G.filename is directory */
 993+ /* Function get_time_stamp() */
 994+ /*****************************/
 995+ 
 996+-int get_time_stamp(__G__ last_modtime, nmember)  /* return PK-type error code */
 997+-    __GDEF
 998+-    time_t *last_modtime;
 999+-    ulg *nmember;
1000++/* return PK-type error code */
1001++int get_time_stamp(__GPRO__ time_t *last_modtime, ulg *nmember)
1002+ {
1003+     int do_this_file=FALSE, error, error_in_archive=PK_COOL;
1004+     ulg j;
1005+@@ -705,8 +703,7 @@ int get_time_stamp(__G__ last_modtime, nmember)  /* return PK-type error code */
1006+ /* Function ratio() */    /* also used by ZipInfo routines */
1007+ /********************/
1008+ 
1009+-int ratio(uc, c)
1010+-    zusz_t uc, c;
1011++int ratio(zusz_t uc, zusz_t c)
1012+ {
1013+     zusz_t denom;
1014+ 
1015+diff --git a/match.c b/match.c
1016+index f634409..0957576 100644
1017+--- a/match.c
1018++++ b/match.c
1019+@@ -122,10 +122,7 @@ static int namecmp OF((ZCONST char *s1, ZCONST char *s2));
1020+ 
1021+ /* match() is a shell to recmatch() to return only Boolean values. */
1022+ 
1023+-int match(string, pattern, ignore_case __WDL)
1024+-    ZCONST char *string, *pattern;
1025+-    int ignore_case;
1026+-    __WDLDEF
1027++int match(ZCONST char *string, ZCONST char *pattern, int ignore_case __WDLPRO)
1028+ {
1029+ #if (defined(MSDOS) && defined(DOSWILD))
1030+     char *dospattern;
1031+@@ -164,15 +161,16 @@ int match(string, pattern, ignore_case __WDL)
1032+ 
1033+ 
1034+ 
1035+-static int recmatch(p, s, ic __WDL)
1036+-    ZCONST uch *p;        /* sh pattern to match */
1037+-    ZCONST uch *s;        /* string to which to match it */
1038+-    int ic;               /* true for case insensitivity */
1039+-    __WDLDEF              /* directory sepchar for WildStopAtDir mode, or 0 */
1040+ /* Recursively compare the sh pattern p with the string s and return 1 if
1041+  * they match, and 0 or 2 if they don't or if there is a syntax error in the
1042+  * pattern.  This routine recurses on itself no more deeply than the number
1043+  * of characters in the pattern. */
1044++static int recmatch(
1045++    ZCONST uch *p,        /* sh pattern to match */
1046++    ZCONST uch *s,        /* string to which to match it */
1047++    int ic                /* true for case insensitivity */
1048++    __WDLPRO              /* directory sepchar for WildStopAtDir mode, or 0 */
1049++)
1050+ {
1051+     unsigned int c;       /* pattern char or start of range in [-] loop */
1052+ 
1053+@@ -340,8 +338,7 @@ static int recmatch(p, s, ic __WDL)
1054+ 
1055+ 
1056+ 
1057+-static char *isshexp(p)
1058+-ZCONST char *p;
1059++static char *isshexp(ZCONST char *p)
1060+ /* If p is a sh expression, a pointer to the first special character is
1061+    returned.  Otherwise, NULL is returned. */
1062+ {
1063+@@ -355,8 +352,7 @@ ZCONST char *p;
1064+ 
1065+ 
1066+ 
1067+-static int namecmp(s1, s2)
1068+-    ZCONST char *s1, *s2;
1069++static int namecmp(ZCONST char *s1, ZCONST char *s2)
1070+ {
1071+     int d;
1072+ 
1073+@@ -376,10 +372,11 @@ static int namecmp(s1, s2)
1074+ 
1075+ 
1076+ 
1077+-
1078+-int iswild(p)        /* originally only used for stat()-bug workaround in */
1079+-    ZCONST char *p;  /*  VAX C, Turbo/Borland C, Watcom C, Atari MiNT libs; */
1080+-{                    /*  now used in process_zipfiles() as well */
1081++/* originally only used for stat()-bug workaround in */
1082++/*  VAX C, Turbo/Borland C, Watcom C, Atari MiNT libs; */
1083++/*  now used in process_zipfiles() as well */
1084++int iswild(ZCONST char *p)
1085++{
1086+     for (; *p; INCSTR(p))
1087+         if (*p == '\\' && *(p+1))
1088+             ++p;
1089+diff --git a/process.c b/process.c
1090+index b385f1e..a4ec6a8 100644
1091+--- a/process.c
1092++++ b/process.c
1093+@@ -233,8 +233,8 @@ static ZCONST char Far ZipfileCommTrunc1[] =
1094+ /* Function process_zipfiles() */
1095+ /*******************************/
1096+ 
1097+-int process_zipfiles(__G)    /* return PK-type error code */
1098+-    __GDEF
1099++/* return PK-type error code */
1100++int process_zipfiles(__GPRO__)
1101+ {
1102+ #ifndef SFX
1103+     char *lastzipfn = (char *)NULL;
1104+@@ -570,8 +570,8 @@ int process_zipfiles(__G)    /* return PK-type error code */
1105+ /* Function free_G_buffers() */
1106+ /*****************************/
1107+ 
1108+-void free_G_buffers(__G)     /* releases all memory allocated in global vars */
1109+-    __GDEF
1110++/* releases all memory allocated in global vars */
1111++void free_G_buffers(__GPRO)
1112+ {
1113+ #ifndef SFX
1114+     unsigned i;
1115+@@ -656,9 +656,8 @@ void free_G_buffers(__G)     /* releases all memory allocated in global vars */
1116+ /* Function do_seekable() */
1117+ /**************************/
1118+ 
1119+-static int do_seekable(__G__ lastchance)        /* return PK-type error code */
1120+-    __GDEF
1121+-    int lastchance;
1122++/* return PK-type error code */
1123++static int do_seekable(__GPRO__ int lastchance)
1124+ {
1125+ #ifndef SFX
1126+     /* static int no_ecrec = FALSE;  SKM: moved to globals.h */
1127+@@ -1042,14 +1041,12 @@ static int do_seekable(__G__ lastchance)        /* return PK-type error code */
1128+    The file has to be opened previously
1129+ */
1130+ #ifdef USE_STRM_INPUT
1131+-static zoff_t file_size(file)
1132+-    FILE *file;
1133++static zoff_t file_size(FILE *file)
1134+ {
1135+     int sts;
1136+     size_t siz;
1137+ #else /* !USE_STRM_INPUT */
1138+-static zoff_t file_size(fh)
1139+-    int fh;
1140++static zoff_t file_size(int fh)
1141+ {
1142+     int siz;
1143+ #endif /* ?USE_STRM_INPUT */
1144+@@ -1124,12 +1121,8 @@ static zoff_t file_size(fh)
1145+ /* Function rec_find() */
1146+ /***********************/
1147+ 
1148+-static int rec_find(__G__ searchlen, signature, rec_size)
1149+-    /* return 0 when rec found, 1 when not found, 2 in case of read error */
1150+-    __GDEF
1151+-    zoff_t searchlen;
1152+-    char* signature;
1153+-    int rec_size;
1154++/* return 0 when rec found, 1 when not found, 2 in case of read error */
1155++static int rec_find(__GPRO__ zoff_t searchlen, char *signature, int rec_size)
1156+ {
1157+     int i, numblks, found=FALSE;
1158+     zoff_t tail_len;
1159+@@ -1207,8 +1200,7 @@ static int rec_find(__G__ searchlen, signature, rec_size)
1160+ /* Function check_ecrec_zip64() */
1161+ /********************************/
1162+ 
1163+-static int check_ecrec_zip64(__G)
1164+-    __GDEF
1165++static int check_ecrec_zip64(__GPRO)
1166+ {
1167+     return G.ecrec.offset_start_central_directory  == 0xFFFFFFFFL
1168+         || G.ecrec.size_central_directory          == 0xFFFFFFFFL
1169+@@ -1225,9 +1217,8 @@ static int check_ecrec_zip64(__G)
1170+ /* Function find_ecrec64() */
1171+ /***************************/
1172+ 
1173+-static int find_ecrec64(__G__ searchlen)         /* return PK-class error */
1174+-    __GDEF
1175+-    zoff_t searchlen;
1176++/* return PK-class error */
1177++static int find_ecrec64(__GPRO__ zoff_t searchlen)
1178+ {
1179+     ec_byte_rec64 byterec;          /* buf for ecrec64 */
1180+     ec_byte_loc64 byterecL;         /* buf for ecrec64 locator */
1181+@@ -1455,9 +1446,8 @@ static int find_ecrec64(__G__ searchlen)         /* return PK-class error */
1182+ /* Function find_ecrec() */
1183+ /*************************/
1184+ 
1185+-static int find_ecrec(__G__ searchlen)          /* return PK-class error */
1186+-    __GDEF
1187+-    zoff_t searchlen;
1188++/* return PK-class error */
1189++static int find_ecrec(__GPRO__ zoff_t searchlen)
1190+ {
1191+     int found = FALSE;
1192+     int error_in_archive;
1193+@@ -1600,8 +1590,8 @@ static int find_ecrec(__G__ searchlen)          /* return PK-class error */
1194+ /* Function process_zip_cmmnt() */
1195+ /********************************/
1196+ 
1197+-static int process_zip_cmmnt(__G)       /* return PK-type error code */
1198+-    __GDEF
1199++/* return PK-type error code */
1200++static int process_zip_cmmnt(__GPRO)
1201+ {
1202+     int error = PK_COOL;
1203+ 
1204+@@ -1703,8 +1693,8 @@ static int process_zip_cmmnt(__G)       /* return PK-type error code */
1205+ /* Function process_cdir_file_hdr() */
1206+ /************************************/
1207+ 
1208+-int process_cdir_file_hdr(__G)    /* return PK-type error code */
1209+-    __GDEF
1210++/* return PK-type error code */
1211++int process_cdir_file_hdr(__GPRO)
1212+ {
1213+     int error;
1214+ 
1215+@@ -1791,8 +1781,8 @@ int process_cdir_file_hdr(__G)    /* return PK-type error code */
1216+ /* Function get_cdir_ent() */
1217+ /***************************/
1218+ 
1219+-static int get_cdir_ent(__G)    /* return PK-type error code */
1220+-    __GDEF
1221++/* return PK-type error code */
1222++static int get_cdir_ent(__GPRO)
1223+ {
1224+     cdir_byte_hdr byterec;
1225+ 
1226+@@ -1853,8 +1843,8 @@ static int get_cdir_ent(__G)    /* return PK-type error code */
1227+ /* Function process_local_file_hdr() */
1228+ /*************************************/
1229+ 
1230+-int process_local_file_hdr(__G)    /* return PK-type error code */
1231+-    __GDEF
1232++/* return PK-type error code */
1233++int process_local_file_hdr(__GPRO)
1234+ {
1235+     local_byte_hdr byterec;
1236+ 
1237+@@ -1902,10 +1892,11 @@ int process_local_file_hdr(__G)    /* return PK-type error code */
1238+ /* Function getZip64Data() */
1239+ /*******************************/
1240+ 
1241+-int getZip64Data(__G__ ef_buf, ef_len)
1242+-    __GDEF
1243+-    ZCONST uch *ef_buf; /* buffer containing extra field */
1244+-    unsigned ef_len;    /* total length of extra field */
1245++int getZip64Data(
1246++    __GPRO__
1247++    ZCONST uch *ef_buf, /* buffer containing extra field */
1248++    unsigned ef_len     /* total length of extra field */
1249++)
1250+ {
1251+     unsigned eb_id;
1252+     unsigned eb_len;
1253+@@ -2009,10 +2000,11 @@ int getZip64Data(__G__ ef_buf, ef_len)
1254+ /* Function getUnicodeData() */
1255+ /*******************************/
1256+ 
1257+-int getUnicodeData(__G__ ef_buf, ef_len)
1258+-    __GDEF
1259+-    ZCONST uch *ef_buf; /* buffer containing extra field */
1260+-    unsigned ef_len;    /* total length of extra field */
1261++int getUnicodeData(
1262++    __GPRO__
1263++    ZCONST uch *ef_buf, /* buffer containing extra field */
1264++    unsigned ef_len     /* total length of extra field */
1265++)
1266+ {
1267+     unsigned eb_id;
1268+     unsigned eb_len;
1269+@@ -2157,8 +2149,7 @@ static int utf8_to_ucs4_string OF((ZCONST char *utf8, ulg *ucs4buf,
1270+  * Returns the number of bytes used by the first character in a UTF-8
1271+  * string, or -1 if the UTF-8 is invalid or null.
1272+  */
1273+-static int utf8_char_bytes(utf8)
1274+-  ZCONST char *utf8;
1275++static int utf8_char_bytes(ZCONST char *utf8)
1276+ {
1277+   int      t, r;
1278+   unsigned lead;
1279+@@ -2196,8 +2187,7 @@ static int utf8_char_bytes(utf8)
1280+  * Returns ~0 (= -1 in twos-complement notation) and does not advance the
1281+  * pointer when input is ill-formed.
1282+  */
1283+-static ulg ucs4_char_from_utf8(utf8)
1284+-  ZCONST char **utf8;
1285++static ulg ucs4_char_from_utf8(ZCONST char **utf8)
1286+ {
1287+   ulg  ret;
1288+   int  t, bytes;
1289+@@ -2224,9 +2214,7 @@ static ulg ucs4_char_from_utf8(utf8)
1290+  * Returns the number of bytes put into utf8buf to represent ch, from 1 to 6,
1291+  * or -1 if ch is too large to represent.  utf8buf must have room for 6 bytes.
1292+  */
1293+-static int utf8_from_ucs4_char(utf8buf, ch)
1294+-  char *utf8buf;
1295+-  ulg ch;
1296++static int utf8_from_ucs4_char(char *utf8buf, ulg ch)
1297+ {
1298+   int trailing = 0;
1299+   int leadmask = 0x80;
1300+@@ -2264,10 +2252,7 @@ static int utf8_from_ucs4_char(utf8buf, ch)
1301+  *
1302+  * Return UCS count.  Now returns int so can return -1.
1303+  */
1304+-static int utf8_to_ucs4_string(utf8, ucs4buf, buflen)
1305+-  ZCONST char *utf8;
1306+-  ulg *ucs4buf;
1307+-  int buflen;
1308++static int utf8_to_ucs4_string(ZCONST char *utf8, ulg *ucs4buf, int buflen)
1309+ {
1310+   int count = 0;
1311+ 
1312+@@ -2293,10 +2278,7 @@ static int utf8_to_ucs4_string(utf8, ucs4buf, buflen)
1313+  *
1314+  *
1315+  */
1316+-static int ucs4_string_to_utf8(ucs4, utf8buf, buflen)
1317+-  ZCONST ulg *ucs4;
1318+-  char *utf8buf;
1319+-  int buflen;
1320++static int ucs4_string_to_utf8(ZCONST ulg *ucs4, char *utf8buf, int buflen)
1321+ {
1322+   char mb[6];
1323+   int  count = 0;
1324+@@ -2327,8 +2309,7 @@ static int ucs4_string_to_utf8(ucs4, utf8buf, buflen)
1325+  *
1326+  * Wrapper: counts the actual unicode characters in a UTF-8 string.
1327+  */
1328+-static int utf8_chars(utf8)
1329+-  ZCONST char *utf8;
1330++static int utf8_chars(ZCONST char *utf8)
1331+ {
1332+   return utf8_to_ucs4_string(utf8, NULL, 0);
1333+ }
1334+@@ -2353,8 +2334,7 @@ static int utf8_chars(utf8)
1335+ /* is_ascii_string
1336+  * Checks if a string is all ascii
1337+  */
1338+-int is_ascii_string(mbstring)
1339+-  ZCONST char *mbstring;
1340++int is_ascii_string(ZCONST char *mbstring)
1341+ {
1342+   char *p;
1343+   uch c;
1344+@@ -2368,8 +2348,7 @@ int is_ascii_string(mbstring)
1345+ }
1346+ 
1347+ /* local to UTF-8 */
1348+-char *local_to_utf8_string(local_string)
1349+-  ZCONST char *local_string;
1350++char *local_to_utf8_string(ZCONST char *local_string)
1351+ {
1352+   return wide_to_utf8_string(local_to_wide_string(local_string));
1353+ }
1354+@@ -2408,8 +2387,7 @@ char *local_to_utf8_string(local_string)
1355+  /* set this to the max bytes an escape can be */
1356+ #define MAX_ESCAPE_BYTES 8
1357+ 
1358+-char *wide_to_escape_string(wide_char)
1359+-  zwchar wide_char;
1360++char *wide_to_escape_string(zwchar wide_char)
1361+ {
1362+   int i;
1363+   zwchar w = wide_char;
1364+@@ -2447,8 +2425,7 @@ char *wide_to_escape_string(wide_char)
1365+ 
1366+ #if 0 /* currently unused */
1367+ /* returns the wide character represented by the escape string */
1368+-zwchar escape_string_to_wide(escape_string)
1369+-  ZCONST char *escape_string;
1370++zwchar escape_string_to_wide(ZCONST char *escape_string)
1371+ {
1372+   int i;
1373+   zwchar w;
1374+@@ -2497,9 +2474,7 @@ zwchar escape_string_to_wide(escape_string)
1375+ 
1376+ #ifndef WIN32  /* WIN32 supplies a special variant of this function */
1377+ /* convert wide character string to multi-byte character string */
1378+-char *wide_to_local_string(wide_string, escape_all)
1379+-  ZCONST zwchar *wide_string;
1380+-  int escape_all;
1381++char *wide_to_local_string(ZCONST zwchar *wide_string, int escape_all)
1382+ {
1383+   int i;
1384+   wchar_t wc;
1385+@@ -2591,8 +2566,7 @@ char *wide_to_local_string(wide_string, escape_all)
1386+ 
1387+ #if 0 /* currently unused */
1388+ /* convert local string to display character set string */
1389+-char *local_to_display_string(local_string)
1390+-  ZCONST char *local_string;
1391++char *local_to_display_string(ZCONST char *local_string)
1392+ {
1393+   char *display_string;
1394+ 
1395+@@ -2624,9 +2598,7 @@ char *local_to_display_string(local_string)
1396+ #endif /* unused */
1397+ 
1398+ /* UTF-8 to local */
1399+-char *utf8_to_local_string(utf8_string, escape_all)
1400+-  ZCONST char *utf8_string;
1401+-  int escape_all;
1402++char *utf8_to_local_string(ZCONST char *utf8_string, int escape_all)
1403+ {
1404+   zwchar *wide;
1405+   char *loc = NULL;
1406+@@ -2645,8 +2617,7 @@ char *utf8_to_local_string(utf8_string, escape_all)
1407+ 
1408+ #if 0 /* currently unused */
1409+ /* convert multi-byte character string to wide character string */
1410+-zwchar *local_to_wide_string(local_string)
1411+-  ZCONST char *local_string;
1412++zwchar *local_to_wide_string(ZCONST char *local_string)
1413+ {
1414+   int wsize;
1415+   wchar_t *wc_string;
1416+@@ -2679,8 +2650,7 @@ zwchar *local_to_wide_string(local_string)
1417+ 
1418+ 
1419+ /* convert wide string to UTF-8 */
1420+-char *wide_to_utf8_string(wide_string)
1421+-  ZCONST zwchar *wide_string;
1422++char *wide_to_utf8_string(ZCONST zwchar *wide_string)
1423+ {
1424+   int mbcount;
1425+   char *utf8_string;
1426+@@ -2701,8 +2671,7 @@ char *wide_to_utf8_string(wide_string)
1427+ #endif /* unused */
1428+ 
1429+ /* convert UTF-8 string to wide string */
1430+-zwchar *utf8_to_wide_string(utf8_string)
1431+-  ZCONST char *utf8_string;
1432++zwchar *utf8_to_wide_string(ZCONST char *utf8_string)
1433+ {
1434+   int wcount;
1435+   zwchar *wide_string;
1436+@@ -2729,10 +2698,11 @@ zwchar *utf8_to_wide_string(utf8_string)
1437+ #ifdef USE_EF_UT_TIME
1438+ 
1439+ #ifdef IZ_HAVE_UXUIDGID
1440+-static int read_ux3_value(dbuf, uidgid_sz, p_uidgid)
1441+-    ZCONST uch *dbuf;   /* buffer a uid or gid value */
1442+-    unsigned uidgid_sz; /* size of uid/gid value */
1443+-    ulg *p_uidgid;      /* return storage: uid or gid value */
1444++static int read_ux3_value(
1445++    ZCONST uch *dbuf,   /* buffer a uid or gid value */
1446++    unsigned uidgid_sz, /* size of uid/gid value */
1447++    ulg *p_uidgid       /* return storage: uid or gid value */
1448++)
1449+ {
1450+     zusz_t uidgid64;
1451+ 
1452+@@ -2763,14 +2733,14 @@ static int read_ux3_value(dbuf, uidgid_sz, p_uidgid)
1453+ /* Function ef_scan_for_izux() */
1454+ /*******************************/
1455+ 
1456+-unsigned ef_scan_for_izux(ef_buf, ef_len, ef_is_c, dos_mdatetime,
1457+-                          z_utim, z_uidgid)
1458+-    ZCONST uch *ef_buf; /* buffer containing extra field */
1459+-    unsigned ef_len;    /* total length of extra field */
1460+-    int ef_is_c;        /* flag indicating "is central extra field" */
1461+-    ulg dos_mdatetime;  /* last_mod_file_date_time in DOS format */
1462+-    iztimes *z_utim;    /* return storage: atime, mtime, ctime */
1463+-    ulg *z_uidgid;      /* return storage: uid and gid */
1464++unsigned ef_scan_for_izux(
1465++    ZCONST uch *ef_buf, /* buffer containing extra field */
1466++    unsigned ef_len,    /* total length of extra field */
1467++    int ef_is_c,        /* flag indicating "is central extra field" */
1468++    ulg dos_mdatetime,  /* last_mod_file_date_time in DOS format */
1469++    iztimes *z_utim,    /* return storage: atime, mtime, ctime */
1470++    ulg *z_uidgid       /* return storage: uid and gid */
1471++)
1472+ {
1473+     unsigned flags = 0;
1474+     unsigned eb_id;
1475+@@ -3138,9 +3108,10 @@ unsigned ef_scan_for_izux(ef_buf, ef_len, ef_is_c, dos_mdatetime,
1476+ /* Function getRISCOSexfield() */
1477+ /*******************************/
1478+ 
1479+-zvoid *getRISCOSexfield(ef_buf, ef_len)
1480+-    ZCONST uch *ef_buf; /* buffer containing extra field */
1481+-    unsigned ef_len;    /* total length of extra field */
1482++zvoid *getRISCOSexfield(
1483++    ZCONST uch *ef_buf, /* buffer containing extra field */
1484++    unsigned ef_len     /* total length of extra field */
1485++)
1486+ {
1487+     unsigned eb_id;
1488+     unsigned eb_len;
1489+diff --git a/ttyio.c b/ttyio.c
1490+index a1a13b1..f71e97f 100644
1491+--- a/ttyio.c
1492++++ b/ttyio.c
1493+@@ -303,9 +303,10 @@ int tt_getch()
1494+ /*
1495+  * Turn echo off for file descriptor f.  Assumes that f is a tty device.
1496+  */
1497+-void Echoff(__G__ f)
1498+-    __GDEF
1499+-    int f;                    /* file descriptor for which to turn echo off */
1500++void Echoff(
1501++    __GPRO__
1502++    int f                     /* file descriptor for which to turn echo off */
1503++)
1504+ {
1505+     struct sgttyb sg;         /* tty device structure */
1506+ 
1507+@@ -318,8 +319,7 @@ void Echoff(__G__ f)
1508+ /*
1509+  * Turn echo back on for file descriptor echofd.
1510+  */
1511+-void Echon(__G)
1512+-    __GDEF
1513++void Echon(__GPRO)
1514+ {
1515+     struct sgttyb sg;         /* tty device structure */
1516+ 
1517+@@ -350,9 +350,7 @@ void Echon(__G)
1518+ 
1519+ #if (defined(TIOCGWINSZ) && !defined(M_UNIX))
1520+ 
1521+-int screensize(tt_rows, tt_cols)
1522+-    int *tt_rows;
1523+-    int *tt_cols;
1524++int screensize(int *tt_rows, int *tt_cols)
1525+ {
1526+     struct winsize wsz;
1527+ #ifdef DEBUG_WINSZ
1528+@@ -436,9 +434,10 @@ int screensize(tt_rows, tt_cols)
1529+ /*
1530+  * Get a character from the given file descriptor without echo or newline.
1531+  */
1532+-int zgetch(__G__ f)
1533+-    __GDEF
1534+-    int f;                      /* file descriptor from which to read */
1535++int zgetch(
1536++    __GPRO__
1537++    int f                       /* file descriptor from which to read */
1538++)
1539+ {
1540+ #if (defined(USE_SYSV_TERMIO) || defined(USE_POSIX_TERMIOS))
1541+     char oldmin, oldtim;
1542+@@ -481,9 +480,10 @@ int zgetch(__G__ f)
1543+ #ifndef VMS     /* VMS supplies its own variant of getch() */
1544+ 
1545+ 
1546+-int zgetch(__G__ f)
1547+-    __GDEF
1548+-    int f;    /* file descriptor from which to read (must be open already) */
1549++int zgetch(
1550++    __GPRO__
1551++    int f     /* file descriptor from which to read (must be open already) */
1552++)
1553+ {
1554+     char c, c2;
1555+ 
1556+@@ -547,11 +547,12 @@ int zgetch(__G__ f)
1557+ /* This is the getp() function for all systems (with TTY type user interface)
1558+  * that supply a working `non-echo' getch() function for "raw" console input.
1559+  */
1560+-char *getp(__G__ m, p, n)
1561+-    __GDEF
1562+-    ZCONST char *m;             /* prompt for password */
1563+-    char *p;                    /* return value: line input */
1564+-    int n;                      /* bytes available in p[] */
1565++char *getp(
1566++    __GPRO__
1567++    ZCONST char *m,             /* prompt for password */
1568++    char *p,                    /* return value: line input */
1569++    int n                       /* bytes available in p[] */
1570++)
1571+ {
1572+     char c;                     /* one-byte buffer for read() to use */
1573+     int i;                      /* number of characters input */
1574+@@ -599,11 +600,12 @@ char *getp(__G__ m, p, n)
1575+ #  endif
1576+ #endif
1577+ 
1578+-char *getp(__G__ m, p, n)
1579+-    __GDEF
1580+-    ZCONST char *m;             /* prompt for password */
1581+-    char *p;                    /* return value: line input */
1582+-    int n;                      /* bytes available in p[] */
1583++char *getp(
1584++    __GPRO__
1585++    ZCONST char *m,             /* prompt for password */
1586++    char *p,                    /* return value: line input */
1587++    int n                       /* bytes available in p[] */
1588++)
1589+ {
1590+     char c;                     /* one-byte buffer for read() to use */
1591+     int i;                      /* number of characters input */
1592+@@ -652,11 +654,11 @@ char *getp(__G__ m, p, n)
1593+ 
1594+ #if (defined(VMS) || defined(CMS_MVS))
1595+ 
1596+-char *getp(__G__ m, p, n)
1597+-    __GDEF
1598+-    ZCONST char *m;             /* prompt for password */
1599+-    char *p;                    /* return value: line input */
1600+-    int n;                      /* bytes available in p[] */
1601++char *getp(
1602++    __GPRO__
1603++    ZCONST char *m,             /* prompt for password */
1604++    char *p,                    /* return value: line input */
1605++    int n                       /* bytes available in p[] */
1606+ {
1607+     char c;                     /* one-byte buffer for read() to use */
1608+     int i;                      /* number of characters input */
1609+diff --git a/ubz2err.c b/ubz2err.c
1610+index f384489..5293b1f 100644
1611+--- a/ubz2err.c
1612++++ b/ubz2err.c
1613+@@ -45,8 +45,7 @@
1614+  * BZ_NO_STDIO), required to handle fatal internal bug-type errors of
1615+  * the bzip2 library.
1616+  */
1617+-void bz_internal_error(bzerrcode)
1618+-    int bzerrcode;
1619++void bz_internal_error(int bzerrcode)
1620+ {
1621+     GETGLOBALS();
1622+ 
1623+diff --git a/unix/configure b/unix/configure
1624+index 785d8dd..dffebcf 100755
1625+--- a/unix/configure
1626++++ b/unix/configure
1627+@@ -189,11 +189,6 @@ if [ $? -ne 0 ]; then
1628+   done
1629+ fi
1630+ 
1631+-echo Check for prototypes
1632+-echo "int main(int argc, char *argv[]) { return 0; }" > conftest.c
1633+-$CC $CFLAGS -c conftest.c > /dev/null 2>/dev/null
1634+-[ $? -ne 0 ] && CFLAGSR="${CFLAGSR} -DNO_PROTO"
1635+-
1636+ # const check currently handles mips cc and non ANSI compilers.
1637+ # does it need more ?
1638+ echo Check the handling of const
1639+diff --git a/unix/unix.c b/unix/unix.c
1640+index 816e3da..9d14cdf 100644
1641+--- a/unix/unix.c
1642++++ b/unix/unix.c
1643+@@ -186,9 +186,8 @@ struct dirent *readdir(dirp)
1644+ /* Function do_wild() */   /* for porting: dir separator; match(ignore_case) */
1645+ /**********************/
1646+ 
1647+-char *do_wild(__G__ wildspec)
1648+-    __GDEF
1649+-    ZCONST char *wildspec;  /* only used first time on a given dir */
1650++/* only used first time on a given dir */
1651++char *do_wild(__GPRO__ ZCONST char *wildspec)
1652+ {
1653+ /* these statics are now declared in SYSTEM_SPECIFIC_GLOBALS in unxcfg.h:
1654+     static DIR *wild_dir = (DIR *)NULL;
1655+@@ -328,9 +327,7 @@ char *do_wild(__G__ wildspec)
1656+  * file as the user or group.  The new option -K bypasses this check.
1657+  */
1658+ 
1659+-static unsigned filtattr(__G__ perms)
1660+-    __GDEF
1661+-    unsigned perms;
1662++static unsigned filtattr(__GPRO__ unsigned perms)
1663+ {
1664+     /* keep setuid/setgid/tacky perms? */
1665+     if (!uO.K_flag)
1666+@@ -347,8 +344,7 @@ static unsigned filtattr(__G__ perms)
1667+ /* Function mapattr() */
1668+ /**********************/
1669+ 
1670+-int mapattr(__G)
1671+-    __GDEF
1672++int mapattr(__GPRO)
1673+ {
1674+     int r;
1675+     ulg tmp = G.crec.external_file_attributes;
1676+@@ -495,9 +491,6 @@ int mapattr(__G)
1677+ /*  Function mapname()  */
1678+ /************************/
1679+ 
1680+-int mapname(__G__ renamed)
1681+-    __GDEF
1682+-    int renamed;
1683+ /*
1684+  * returns:
1685+  *  MPN_OK          - no problem detected
1686+@@ -508,6 +501,7 @@ int mapname(__G__ renamed)
1687+  *  MPN_NOMEM       - error (memory allocation failed) -> skip entry
1688+  *  [also MPN_VOL_LABEL, MPN_CREATED_DIR]
1689+  */
1690++int mapname(__GPRO__ int renamed)
1691+ {
1692+     char pathcomp[FILNAMSIZ];      /* path-component buffer */
1693+     char *pp, *cp=(char *)NULL;    /* character pointers */
1694+@@ -748,10 +742,6 @@ int mapname(__G__ renamed)
1695+ /* Function checkdir() */
1696+ /***********************/
1697+ 
1698+-int checkdir(__G__ pathcomp, flag)
1699+-    __GDEF
1700+-    char *pathcomp;
1701+-    int flag;
1702+ /*
1703+  * returns:
1704+  *  MPN_OK          - no problem detected
1705+@@ -762,6 +752,7 @@ int checkdir(__G__ pathcomp, flag)
1706+  *  MPN_ERR_TOOLONG - path is too long
1707+  *  MPN_NOMEM       - can't allocate memory for filename buffers
1708+  */
1709++int checkdir(__GPRO__ char *pathcomp, int flag)
1710+ {
1711+  /* static int rootlen = 0; */  /* length of rootpath */
1712+  /* static char *rootpath;  */  /* user's "extract-to" directory */
1713+@@ -1039,12 +1030,7 @@ int mkdir(path, mode)
1714+ 
1715+ 
1716+ #if (!defined(MTS) || defined(SET_DIR_ATTRIB))
1717+-static int get_extattribs OF((__GPRO__ iztimes *pzt, ulg z_uidgid[2]));
1718+-
1719+-static int get_extattribs(__G__ pzt, z_uidgid)
1720+-    __GDEF
1721+-    iztimes *pzt;
1722+-    ulg z_uidgid[2];
1723++static int get_extattribs(__GPRO__ iztimes *pzt, ulg z_uidgid[2])
1724+ {
1725+ /*---------------------------------------------------------------------------
1726+     Convert from MSDOS-format local time and date to Unix-format 32-bit GMT
1727+@@ -1099,8 +1085,8 @@ static int get_extattribs(__G__ pzt, z_uidgid)
1728+ /* Function close_outfile() */
1729+ /****************************/
1730+ 
1731+-void close_outfile(__G)    /* GRR: change to return PK-style warning level */
1732+-    __GDEF
1733++/* GRR: change to return PK-style warning level */
1734++void close_outfile(__GPRO)
1735+ {
1736+     union {
1737+         iztimes t3;             /* mtime, atime, ctime */
1738+@@ -1273,9 +1259,7 @@ void close_outfile(__G)    /* GRR: change to return PK-style warning level */
1739+ 
1740+ 
1741+ #if (defined(SYMLINKS) && defined(SET_SYMLINK_ATTRIBS))
1742+-int set_symlnk_attribs(__G__ slnk_entry)
1743+-    __GDEF
1744+-    slinkentry *slnk_entry;
1745++int set_symlnk_attribs(__GPRO__ slinkentry *slnk_entry)
1746+ {
1747+     if (slnk_entry->attriblen > 0) {
1748+ # if (!defined(NO_LCHOWN))
1749+@@ -1321,9 +1305,7 @@ int set_symlnk_attribs(__G__ slnk_entry)
1750+ #  endif
1751+ 
1752+ 
1753+-int defer_dir_attribs(__G__ pd)
1754+-    __GDEF
1755+-    direntry **pd;
1756++int defer_dir_attribs(__GPRO__ direntry **pd)
1757+ {
1758+     uxdirattr *d_entry;
1759+ 
1760+@@ -1343,9 +1325,7 @@ int defer_dir_attribs(__G__ pd)
1761+ } /* end function defer_dir_attribs() */
1762+ 
1763+ 
1764+-int set_direc_attribs(__G__ d)
1765+-    __GDEF
1766+-    direntry *d;
1767++int set_direc_attribs(__GPRO__ direntry *d)
1768+ {
1769+     int errval = PK_OK;
1770+ 
1771+@@ -1394,9 +1374,7 @@ int set_direc_attribs(__G__ d)
1772+ /*  Function stamp_file()  */
1773+ /***************************/
1774+ 
1775+-int stamp_file(fname, modtime)
1776+-    ZCONST char *fname;
1777+-    time_t modtime;
1778++int stamp_file(ZCONST char *fname, time_t modtime)
1779+ {
1780+     ztimbuf tp;
1781+ 
1782+@@ -1416,8 +1394,7 @@ int stamp_file(fname, modtime)
1783+ /*  Function version()  */
1784+ /************************/
1785+ 
1786+-void version(__G)
1787+-    __GDEF
1788++void version(__GPRO)
1789+ {
1790+ #if (defined(__GNUC__) && defined(NX_CURRENT_COMPILER_RELEASE))
1791+     char cc_namebuf[40];
1792+@@ -1784,10 +1761,7 @@ static ulg LG(ulg val)
1793+ 
1794+ 
1795+ 
1796+-static void qlfix(__G__ ef_ptr, ef_len)
1797+-    __GDEF
1798+-    uch *ef_ptr;
1799+-    unsigned ef_len;
1800++static void qlfix(__GPRO__ uch *ef_ptr, unsigned ef_len)
1801+ {
1802+     while (ef_len >= EB_HEADSIZE)
1803+     {
1804+diff --git a/unshrink.c b/unshrink.c
1805+index ae993e9..2c3e781 100644
1806+--- a/unshrink.c
1807++++ b/unshrink.c
1808+@@ -97,8 +97,7 @@ static void  partial_clear  OF((__GPRO__ int lastcodeused));
1809+ /* Function unshrink() */
1810+ /***********************/
1811+ 
1812+-int unshrink(__G)
1813+-     __GDEF
1814++int unshrink(__GPRO)
1815+ {
1816+     uch *stacktop = stack + (HSIZE - 1);
1817+     register uch *newstr;
1818+@@ -304,9 +303,7 @@ int unshrink(__G)
1819+ /* Function partial_clear() */      /* no longer recursive... */
1820+ /****************************/
1821+ 
1822+-static void partial_clear(__G__ lastcodeused)
1823+-    __GDEF
1824+-    int lastcodeused;
1825++static void partial_clear(__GPRO__ int lastcodeused)
1826+ {
1827+     register shrint code;
1828+ 
1829+diff --git a/unzip.c b/unzip.c
1830+index 1abaccb..9a2cf60 100644
1831+--- a/unzip.c
1832++++ b/unzip.c
1833+@@ -710,9 +710,8 @@ See \"unzip -hh\" or unzip.txt for more help.  Examples:\n\
1834+ /*  main() / UzpMain() stub  */
1835+ /*****************************/
1836+ 
1837+-int MAIN(argc, argv)   /* return PK-type error code (except under VMS) */
1838+-    int argc;
1839+-    char *argv[];
1840++/* return PK-type error code (except under VMS) */
1841++int MAIN(int argc, char *argv[])
1842+ {
1843+     int r;
1844+ 
1845+@@ -729,10 +728,7 @@ int MAIN(argc, argv)   /* return PK-type error code (except under VMS) */
1846+ /*  Primary UnZip entry point  */
1847+ /*******************************/
1848+ 
1849+-int unzip(__G__ argc, argv)
1850+-    __GDEF
1851+-    int argc;
1852+-    char *argv[];
1853++int unzip(__GPRO__ int argc, char *argv[])
1854+ {
1855+ #ifndef NO_ZIPINFO
1856+     char *p;
1857+@@ -1286,12 +1282,8 @@ cleanup_and_exit:
1858+ /* Function setsignalhandler() */
1859+ /*******************************/
1860+ 
1861+-static int setsignalhandler(__G__ p_savedhandler_chain, signal_type,
1862+-                            newhandler)
1863+-    __GDEF
1864+-    savsigs_info **p_savedhandler_chain;
1865+-    int signal_type;
1866+-    void (*newhandler)(int);
1867++static int setsignalhandler(__GPRO__ savsigs_info **p_savedhandler_chain, int signal_type,
1868++                            void (*newhandler)(int))
1869+ {
1870+     savsigs_info *savsig;
1871+ 
1872+@@ -1323,10 +1315,7 @@ static int setsignalhandler(__G__ p_savedhandler_chain, signal_type,
1873+ /* Function uz_opts() */
1874+ /**********************/
1875+ 
1876+-int uz_opts(__G__ pargc, pargv)
1877+-    __GDEF
1878+-    int *pargc;
1879+-    char ***pargv;
1880++int uz_opts(__GPRO__ int *pargc, char ***pargv)
1881+ {
1882+     char **argv, *s;
1883+     int argc, c, error=FALSE, negative=0, showhelp=0;
1884+@@ -1971,9 +1960,8 @@ opts_done:  /* yes, very ugly...but only used by UnZipSFX with -x xlist */
1885+ #    endif
1886+ #  endif
1887+ 
1888+-int usage(__G__ error)   /* return PK-type error code */
1889+-    __GDEF
1890+-    int error;
1891++/* return PK-type error code */
1892++int usage(__GPRO__ int error)
1893+ {
1894+     Info(slide, error? 1 : 0, ((char *)slide, LoadFarString(UnzipSFXBanner),
1895+       UZ_MAJORVER, UZ_MINORVER, UZ_PATCHLEVEL, UZ_BETALEVEL,
1896+@@ -2005,9 +1993,8 @@ int usage(__G__ error)   /* return PK-type error code */
1897+ #    define QUOTS ""
1898+ #  endif
1899+ 
1900+-int usage(__G__ error)   /* return PK-type error code */
1901+-    __GDEF
1902+-    int error;
1903++/* return PK-type error code */
1904++int usage(__GPRO__ int error)
1905+ {
1906+     int flag = (error? 1 : 0);
1907+ 
1908+@@ -2082,8 +2069,7 @@ You must quote non-lowercase options and filespecs, unless SET PROC/PARSE=EXT.\
1909+ #ifndef SFX
1910+ 
1911+ /* Print extended help to stdout. */
1912+-static void help_extended(__G)
1913+-    __GDEF
1914++static void help_extended(__GPRO)
1915+ {
1916+     extent i;             /* counter for help array */
1917+ 
1918+@@ -2332,8 +2318,7 @@ extern char *getenv();
1919+ /* Function show_version_info() */
1920+ /********************************/
1921+ 
1922+-static void show_version_info(__G)
1923+-    __GDEF
1924++static void show_version_info(__GPRO)
1925+ {
1926+     if (uO.qflag > 3)                           /* "unzip -vqqqq" */
1927+         Info(slide, 0, ((char *)slide, "%d\n",
1928+diff --git a/unzip.h b/unzip.h
1929+index ed24a5b..9891467 100644
1930+--- a/unzip.h
1931++++ b/unzip.h
1932+@@ -211,51 +211,33 @@ freely, subject to the above disclaimer and the following restrictions:
1933+  * or Convex?, or AtheOS, or BeOS.
1934+  */
1935+ #if (defined(__STDC__) || defined(MSDOS) || defined(OS2) || defined(WIN32))
1936+-#  ifndef PROTO
1937+-#    define PROTO
1938+-#  endif
1939+ #  ifndef MODERN
1940+ #    define MODERN
1941+ #  endif
1942+ #endif
1943+ #if (defined(__IBMC__) || defined(__BORLANDC__) || defined(__WATCOMC__))
1944+-#  ifndef PROTO
1945+-#    define PROTO
1946+-#  endif
1947+ #  ifndef MODERN
1948+ #    define MODERN
1949+ #  endif
1950+ #endif
1951+ #if (defined(__EMX__) || defined(__CYGWIN__))
1952+-#  ifndef PROTO
1953+-#    define PROTO
1954+-#  endif
1955+ #  ifndef MODERN
1956+ #    define MODERN
1957+ #  endif
1958+ #endif
1959+ #if (defined(MACOS) || defined(ATARI_ST) || defined(RISCOS) || defined(THEOS))
1960+-#  ifndef PROTO
1961+-#    define PROTO
1962+-#  endif
1963+ #  ifndef MODERN
1964+ #    define MODERN
1965+ #  endif
1966+ #endif
1967+ /* Sequent running Dynix/ptx:  non-modern compiler */
1968+ #if (defined(_AIX) || defined(sgi) || (defined(_SEQUENT_) && !defined(PTX)))
1969+-#  ifndef PROTO
1970+-#    define PROTO
1971+-#  endif
1972+ #  ifndef MODERN
1973+ #    define MODERN
1974+ #  endif
1975+ #endif
1976+ #if (defined(CMS_MVS) || defined(__ATHEOS__) || defined(__BEOS__))
1977+ /* || defined(CONVEX) ? */
1978+-#  ifndef PROTO
1979+-#    define PROTO
1980+-#  endif
1981+ #  ifndef MODERN
1982+ #    define MODERN
1983+ #  endif
1984+@@ -267,17 +249,7 @@ freely, subject to the above disclaimer and the following restrictions:
1985+ #  endif
1986+ #endif
1987+ 
1988+-/* turn off prototypes if requested */
1989+-#if (defined(NOPROTO) && defined(PROTO))
1990+-#  undef PROTO
1991+-#endif
1992+-
1993+-/* used to remove arguments in function prototypes for non-ANSI C */
1994+-#ifdef PROTO
1995+-#  define OF(a) a
1996+-#else
1997+-#  define OF(a) ()
1998+-#endif
1999++#define OF(a) a
2000+ 
2001+ /* enable the "const" keyword only if MODERN and if not otherwise instructed */
2002+ #ifdef MODERN
2003+@@ -405,24 +377,15 @@ typedef unsigned long   ulg;    /*  predefined on some systems) & match zip  */
2004+ #endif /* !_IZ_TYPES_DEFINED */
2005+ 
2006+ /* InputFn is not yet used and is likely to change: */
2007+-#ifdef PROTO
2008+-   typedef int   (UZ_EXP MsgFn)     (zvoid *pG, uch *buf, ulg size, int flag);
2009+-   typedef int   (UZ_EXP InputFn)   (zvoid *pG, uch *buf, int *size, int flag);
2010+-   typedef void  (UZ_EXP PauseFn)   (zvoid *pG, ZCONST char *prompt, int flag);
2011+-   typedef int   (UZ_EXP PasswdFn)  (zvoid *pG, int *rcnt, char *pwbuf,
2012+-                                     int size, ZCONST char *zfn,
2013+-                                     ZCONST char *efn);
2014+-   typedef int   (UZ_EXP StatCBFn)  (zvoid *pG, int fnflag, ZCONST char *zfn,
2015+-                                     ZCONST char *efn, ZCONST zvoid *details);
2016+-   typedef void  (UZ_EXP UsrIniFn)  (void);
2017+-#else /* !PROTO */
2018+-   typedef int   (UZ_EXP MsgFn)     ();
2019+-   typedef int   (UZ_EXP InputFn)   ();
2020+-   typedef void  (UZ_EXP PauseFn)   ();
2021+-   typedef int   (UZ_EXP PasswdFn)  ();
2022+-   typedef int   (UZ_EXP StatCBFn)  ();
2023+-   typedef void  (UZ_EXP UsrIniFn)  ();
2024+-#endif /* ?PROTO */
2025++typedef int   (UZ_EXP MsgFn)     (zvoid *pG, uch *buf, ulg size, int flag);
2026++typedef int   (UZ_EXP InputFn)   (zvoid *pG, uch *buf, int *size, int flag);
2027++typedef void  (UZ_EXP PauseFn)   (zvoid *pG, ZCONST char *prompt, int flag);
2028++typedef int   (UZ_EXP PasswdFn)  (zvoid *pG, int *rcnt, char *pwbuf,
2029++                                  int size, ZCONST char *zfn,
2030++                                  ZCONST char *efn);
2031++typedef int   (UZ_EXP StatCBFn)  (zvoid *pG, int fnflag, ZCONST char *zfn,
2032++                                  ZCONST char *efn, ZCONST zvoid *details);
2033++typedef void  (UZ_EXP UsrIniFn)  (void);
2034+ 
2035+ typedef struct _UzpBuffer {    /* rxstr */
2036+     ulg   strlength;           /* length of string */
2037+diff --git a/zipinfo.c b/zipinfo.c
2038+index 0be3e5b..94d5430 100644
2039+--- a/zipinfo.c
2040++++ b/zipinfo.c
2041+@@ -446,10 +446,7 @@ static ZCONST char Far DecimalTime[] = "%04u%02u%02u.%02u%02u%02u";
2042+ /*  Function zi_opts()  */
2043+ /************************/
2044+ 
2045+-int zi_opts(__G__ pargc, pargv)
2046+-    int *pargc;
2047+-    char ***pargv;
2048+-    __GDEF
2049++int zi_opts(__GPRO__ int *pargc, char ***pargv)
2050+ {
2051+     char   **argv, *s;
2052+     int    argc, c, error=FALSE, negative=0;
2053+@@ -635,8 +632,7 @@ int zi_opts(__G__ pargc, pargv)
2054+ /*  Function zi_end_central()  */
2055+ /*******************************/
2056+ 
2057+-void zi_end_central(__G)
2058+-    __GDEF
2059++void zi_end_central(__GPRO)
2060+ {
2061+ /*---------------------------------------------------------------------------
2062+     Print out various interesting things about the zipfile.
2063+@@ -702,8 +698,8 @@ void zi_end_central(__G)
2064+ /*  Function zipinfo()  */
2065+ /************************/
2066+ 
2067+-int zipinfo(__G)   /* return PK-type error code */
2068+-    __GDEF
2069++/* return PK-type error code */
2070++int zipinfo(__GPRO)
2071+ {
2072+     int do_this_file=FALSE, error, error_in_archive=PK_COOL;
2073+     int *fn_matched=NULL, *xn_matched=NULL;
2074+@@ -984,11 +980,12 @@ int zipinfo(__G)   /* return PK-type error code */
2075+ /*  Function zi_long()  */
2076+ /************************/
2077+ 
2078+-static int zi_long(__G__ pEndprev, error_in_archive)
2079+-    /* return PK-type error code */
2080+-    __GDEF
2081+-    zusz_t *pEndprev;                /* for zi_long() check of extra bytes */
2082+-    int error_in_archive;            /* may signal premature return */
2083++/* return PK-type error code */
2084++static int zi_long(
2085++    __GPRO__
2086++    zusz_t *pEndprev,                /* for zi_long() check of extra bytes */
2087++    int error_in_archive             /* may signal premature return */
2088++)
2089+ {
2090+ #ifdef USE_EF_UT_TIME
2091+     iztimes z_utime;
2092+@@ -1872,8 +1869,8 @@ ef_default_display:
2093+ /*  Function zi_short()  */
2094+ /*************************/
2095+ 
2096+-static int zi_short(__G)   /* return PK-type error code */
2097+-    __GDEF
2098++/* return PK-type error code */
2099++static int zi_short(__GPRO)
2100+ {
2101+ #ifdef USE_EF_UT_TIME
2102+     iztimes     z_utime;
2103+@@ -2207,9 +2204,7 @@ static int zi_short(__G)   /* return PK-type error code */
2104+ /*  Function zi_showMacTypeCreator()  */
2105+ /**************************************/
2106+ 
2107+-static void zi_showMacTypeCreator(__G__ ebfield)
2108+-    __GDEF
2109+-    uch *ebfield;
2110++static void zi_showMacTypeCreator(__GPRO__ uch *ebfield)
2111+ {
2112+     /* not every Type / Creator character is printable */
2113+     if (isprint(native(ebfield[0])) && isprint(native(ebfield[1])) &&
2114+@@ -2242,11 +2237,7 @@ static void zi_showMacTypeCreator(__G__ ebfield)
2115+ /*  Function zi_time()  */
2116+ /************************/
2117+ 
2118+-static char *zi_time(__G__ datetimez, modtimez, d_t_str)
2119+-    __GDEF
2120+-    ZCONST ulg *datetimez;
2121+-    ZCONST time_t *modtimez;
2122+-    char *d_t_str;
2123++static char *zi_time(__GPRO__ ZCONST ulg *datetimez, ZCONST time_t *modtimez, char *d_t_str)
2124+ {
2125+     unsigned yr, mo, dy, hh, mm, ss;
2126+     char monthbuf[4];
2127+-- 
2128+2.49.0
2129+
+1, -1
1@@ -1 +1 @@
2-6.0-29 r0
3+6.0-29 r1