logo

oasis

Own branch of Oasis Linux (upstream: <https://git.sr.ht/~mcf/oasis/>) git clone https://anongit.hacktivis.me/git/oasis.git

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