diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2022-12-25 19:05:17 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2022-12-25 19:05:48 -0800 |
commit | 46ef963c7b181cf1d8e5c3ae0013ec954df3a33e (patch) | |
tree | dad1c30a84195870146219ff95c2e1c959ef518b | |
parent | bcbb26050fe764bb476a08f5b3087c78159d3913 (diff) | |
download | gzip-46ef963c7b181cf1d8e5c3ae0013ec954df3a33e.tar.gz |
maint: port to gcc -std=c99 -Wstrict-prototypes
This doesn’t fix any bugs, since the code is correct as-is on all
C versions. However, it pacifies gcc -std=c99 -Wstrict-prototypes,
which complains about a function definition without arguments
unless there’s a previous prototype with ‘(void)’.
Most (but not all) of this patch merely reverts some recent
changes to be more consistent when porting to C23.
* dfltcc.c (is_dfltcc_enabled):
* gzip.c (get_input_size_and_time):
* inflate.c (inflate_stored, inflate_fixed, inflate_dynamic):
* unpack.c (read_byte):
-rw-r--r-- | dfltcc.c | 2 | ||||
-rw-r--r-- | gzip.c | 2 | ||||
-rw-r--r-- | inflate.c | 6 | ||||
-rw-r--r-- | unpack.c | 2 |
4 files changed, 6 insertions, 6 deletions
@@ -147,7 +147,7 @@ is_bit_set (const char *bits, int n) } static int -is_dfltcc_enabled () +is_dfltcc_enabled (void) { char facilities[(DFLTCC_FACILITY / 64 + 1) * 8]; @@ -710,7 +710,7 @@ input_eof () } static void -get_input_size_and_time () +get_input_size_and_time (void) { ifile_size = -1; time_stamp.tv_nsec = -1; @@ -627,7 +627,7 @@ inflate_codes(struct huft *tl, struct huft *td, int bl, int bd) /* "decompress" an inflated type 0 (stored) block. */ static int -inflate_stored () +inflate_stored(void) { unsigned n; /* number of bytes in block */ unsigned w; /* current window position */ @@ -683,7 +683,7 @@ inflate_stored () either replace this with a custom decoder, or at least precompute the Huffman tables. */ static int -inflate_fixed () +inflate_fixed(void) { int i; /* temporary variable */ struct huft *tl; /* literal/length code table */ @@ -733,7 +733,7 @@ inflate_fixed () /* decompress an inflated type 2 (dynamic Huffman codes) block. */ static int -inflate_dynamic () +inflate_dynamic(void) { int i; /* temporary variables */ unsigned j; @@ -78,7 +78,7 @@ static int valid; /* number of valid bits in bitbuf */ /* Read an input byte, reporting an error at EOF. */ static unsigned char -read_byte () +read_byte (void) { int b = get_byte (); if (b < 0) |