0001-require-standard-C-function-prototype-support.patch (3773B)
- From 32ae5e241237d325b8108660f82419ce684a62a8 Mon Sep 17 00:00:00 2001
- From: Mike Frysinger <vapier@gmail.com>
- Date: Mon, 8 Feb 2021 00:28:08 -0500
- Subject: [PATCH] require standard C function prototype support
- We can drop the main prototype entirely as we don't need it.
- ---
- Changes | 3 +++
- compress.c | 58 +++++++++++++++++++-----------------------------------
- 2 files changed, 23 insertions(+), 38 deletions(-)
- diff --git a/Changes b/Changes
- index 5bef4ec..40cd58d 100644
- --- a/Changes
- +++ b/Changes
- @@ -1,3 +1,6 @@
- +(N)compress version 5.1
- + * Use modern standard C function prototypes
- +
- (N)compress version 5.0
- * New stream for cleanups
- * Drop support for 2.0 output & -C option
- diff --git a/compress.c b/compress.c
- index 66cacf1..691ff2b 100644
- --- a/compress.c
- +++ b/compress.c
- @@ -168,12 +168,6 @@
- };
- #endif
- -#ifdef __STDC__
- -# define ARGS(a) a
- -#else
- -# define ARGS(a) ()
- -#endif
- -
- #ifndef SIG_TYPE
- # define SIG_TYPE void (*)()
- #endif
- @@ -527,17 +521,16 @@ long bytes_out; /* Total number of byte to output */
- } ;
- #endif
- -int main ARGS((int,char **));
- -void Usage ARGS((int));
- -void comprexx ARGS((const char *));
- -void compdir ARGS((char *));
- -void compress ARGS((int,int));
- -void decompress ARGS((int,int));
- -void read_error ARGS((void));
- -void write_error ARGS((void));
- -void abort_compress ARGS((void));
- -void prratio ARGS((FILE *,long,long));
- -void about ARGS((void));
- +void Usage (int);
- +void comprexx (const char *);
- +void compdir (char *);
- +void compress (int, int);
- +void decompress (int, int);
- +void read_error (void);
- +void write_error (void);
- +void abort_compress (void);
- +void prratio (FILE *, long, long);
- +void about (void);
- /*****************************************************************
- * TAG( main )
- @@ -580,9 +573,7 @@ void about ARGS((void));
- * procedure needs no input table, but tracks the way the table was built.
- */
- int
- -main(argc, argv)
- - int argc;
- - char *argv[];
- +main(int argc, char *argv[])
- {
- char **filelist;
- char **fileptr;
- @@ -794,8 +785,7 @@ Usage: %s [-dfhvcVr] [-b maxbits] [--] [path ...]\n\
- }
- void
- -comprexx(fileptr)
- - const char *fileptr;
- +comprexx(const char *fileptr)
- {
- int fdin = -1;
- int fdout = -1;
- @@ -1144,8 +1134,7 @@ error:
- #ifdef RECURSIVE
- void
- -compdir(dir)
- - char *dir;
- +compdir(char *dir)
- {
- struct dirent *dp;
- DIR *dirp;
- @@ -1221,9 +1210,7 @@ compdir(dir)
- * questions about this implementation to ames!jaw.
- */
- void
- -compress(fdin, fdout)
- - int fdin;
- - int fdout;
- +compress(int fdin, int fdout)
- {
- long hp;
- int rpos;
- @@ -1460,9 +1447,7 @@ endlop: if (fcode.e.ent >= FIRST && rpos < rsize)
- */
- void
- -decompress(fdin, fdout)
- - int fdin;
- - int fdout;
- +decompress(int fdin, int fdout)
- {
- char_type *stackp;
- code_int code;
- @@ -1687,7 +1672,7 @@ resetbuf: ;
- }
- void
- -read_error()
- +read_error(void)
- {
- fprintf(stderr, "\nread error on");
- perror((ifname[0] != '\0') ? ifname : "stdin");
- @@ -1695,7 +1680,7 @@ read_error()
- }
- void
- -write_error()
- +write_error(void)
- {
- fprintf(stderr, "\nwrite error on");
- perror(ofname ? ofname : "stdout");
- @@ -1703,7 +1688,7 @@ write_error()
- }
- void
- -abort_compress()
- +abort_compress(void)
- {
- if (remove_ofname)
- unlink(ofname);
- @@ -1712,10 +1697,7 @@ abort_compress()
- }
- void
- -prratio(stream, num, den)
- - FILE *stream;
- - long int num;
- - long int den;
- +prratio(FILE *stream, long int num, long int den)
- {
- int q; /* Doesn't need to be long */
- @@ -1739,7 +1721,7 @@ prratio(stream, num, den)
- }
- void
- -about()
- +about(void)
- {
- printf("Compress version: %s\n", version_id);
- printf("Compile options:\n ");
- --
- 2.49.0