opkg

statically linked package installer
git clone anongit@rnpnr.xyz:opkg.git
Log | Files | Refs | Feed | Submodules | README | LICENSE

0032-Remove-use-of-non-prototype-function-definitions.patch (69952B)


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