diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2022-12-25 14:53:47 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2022-12-25 16:13:10 -0800 |
commit | 96cd660ad06675e811505229c029004efe9a3a8f (patch) | |
tree | ede3f4eaa8033bb31dbbec104d9ef24c3cf2b279 /sample | |
parent | 8ae183ff73ff5827a6e0f260ad591fe5fae33127 (diff) | |
download | gzip-96cd660ad06675e811505229c029004efe9a3a8f.tar.gz |
maint: port function definitions to C23
C23 does not allow K&R style function definitions.
Use protyped definitions. However, don't bother with (void) in
function definitions since C23 prefers (); so prefer () to (void) as
this will work with older compilers anyway.
Diffstat (limited to 'sample')
-rw-r--r-- | sample/add.c | 3 | ||||
-rw-r--r-- | sample/makecrc.c | 3 | ||||
-rw-r--r-- | sample/sub.c | 5 | ||||
-rw-r--r-- | sample/zread.c | 5 |
4 files changed, 8 insertions, 8 deletions
diff --git a/sample/add.c b/sample/add.c index cadbc3a..d51288c 100644 --- a/sample/add.c +++ b/sample/add.c @@ -16,7 +16,8 @@ char a[MAX_DIST]; /* last byte buffer for up to MAX_DIST differences */ -int main() +int +main () { int n; /* number of differences */ int i; /* difference counter */ diff --git a/sample/makecrc.c b/sample/makecrc.c index 8fa2959..bf789d3 100644 --- a/sample/makecrc.c +++ b/sample/makecrc.c @@ -3,7 +3,8 @@ #include <config.h> #include <stdio.h> -main() +int +main () /* Generate a table for a byte-wise 32-bit CRC calculation on the polynomial: x^32+x^26+x^23+x^22+x^16+x^12+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x+1. diff --git a/sample/sub.c b/sample/sub.c index a06cc9b..ce83a98 100644 --- a/sample/sub.c +++ b/sample/sub.c @@ -43,9 +43,8 @@ char a[MAX_DIST]; /* last byte buffer for up to MAX_DIST differences */ -int main(argc, argv) - int argc; - char **argv; +int +main (int argc, char **argv) { int n = 1; /* number of differences */ int i; /* difference counter */ diff --git a/sample/zread.c b/sample/zread.c index e20de49..e38095c 100644 --- a/sample/zread.c +++ b/sample/zread.c @@ -10,9 +10,8 @@ * Usage: zread [file[.gz]] * This programs assumes that gzip is somewhere in your path. */ -int main(argc, argv) - int argc; - char **argv; +int +main (int argc, char **argv) { FILE *infile; char cmd[256]; |