bug-gzip
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 2/7] maint: remove all uses of OF((...)) prototype-hiding macro


From: Jim Meyering
Subject: [PATCH 2/7] maint: remove all uses of OF((...)) prototype-hiding macro
Date: Mon, 9 May 2011 20:05:17 +0200

From: Jim Meyering <address@hidden>

* bits.c: Remove all uses of OF.
* deflate.c: Likewise.
* gzip.c: Likewise.
* inflate.c: Likewise.
* lzw.h: Likewise.
* trees.c: Likewise.
* unlzh.c: Likewise.
* unpack.c: Likewise.
* util.c: Likewise.
* gzip.h: Likewise.
(OF): Remove its definition, too.
---
 bits.c    |    2 +-
 deflate.c |   10 +++---
 gzip.c    |   50 +++++++++++++++++-----------------
 gzip.h    |   86 ++++++++++++++++++++++++++++--------------------------------
 inflate.c |   18 ++++++------
 lzw.h     |    8 +----
 trees.c   |   22 ++++++++--------
 unlzh.c   |   24 ++++++++--------
 unpack.c  |    4 +-
 util.c    |    2 +-
 10 files changed, 108 insertions(+), 118 deletions(-)

diff --git a/bits.c b/bits.c
index 646b338..6db2caa 100644
--- a/bits.c
+++ b/bits.c
@@ -94,7 +94,7 @@ local int bi_valid;
  * are always zero.
  */

-int (*read_buf) OF((char *buf, unsigned size));
+int (*read_buf) (char *buf, unsigned size);
 /* Current input function. Set to mem_read for in-memory compression */

 #ifdef DEBUG
diff --git a/deflate.c b/deflate.c
index 423b288..316ec8b 100644
--- a/deflate.c
+++ b/deflate.c
@@ -254,16 +254,16 @@ local config configuration_table[10] = {
 /* ===========================================================================
  *  Prototypes for local functions.
  */
-local void fill_window   OF((void));
-local off_t deflate_fast OF((void));
+local void fill_window   (void);
+local off_t deflate_fast (void);

-      int  longest_match OF((IPos cur_match));
+      int  longest_match (IPos cur_match);
 #ifdef ASMV
-      void match_init OF((void)); /* asm code initialization */
+      void match_init (void); /* asm code initialization */
 #endif

 #ifdef DEBUG
-local  void check_match OF((IPos start, IPos match, int length));
+local  void check_match (IPos start, IPos match, int length);
 #endif

 /* ===========================================================================
diff --git a/gzip.c b/gzip.c
index 98441c5..4739dbe 100644
--- a/gzip.c
+++ b/gzip.c
@@ -118,7 +118,7 @@ static char const *const license_msg[] = {
 #endif

 #ifdef off_t
-  off_t lseek OF((int fd, off_t offset, int whence));
+  off_t lseek (int fd, off_t offset, int whence);
 #endif

 #ifndef OFF_T_MIN
@@ -284,32 +284,32 @@ struct option longopts[] =

 /* local functions */

-local void try_help     OF((void)) ATTRIBUTE_NORETURN;
-local void help         OF((void));
-local void license      OF((void));
-local void version      OF((void));
-local int input_eof    OF((void));
-local void treat_stdin  OF((void));
-local void treat_file   OF((char *iname));
-local int create_outfile OF((void));
-local char *get_suffix  OF((char *name));
-local int  open_input_file OF((char *iname, struct stat *sbuf));
-local void discard_input_bytes OF((size_t nbytes, unsigned int flags));
-local int  make_ofname  OF((void));
-local void shorten_name  OF((char *name));
-local int  get_method   OF((int in));
-local void do_list      OF((int ifd, int method));
-local int  check_ofname OF((void));
-local void copy_stat    OF((struct stat *ifstat));
-local void install_signal_handlers OF((void));
-local void remove_output_file OF((void));
-local RETSIGTYPE abort_gzip_signal OF((int));
-local void do_exit      OF((int exitcode)) ATTRIBUTE_NORETURN;
-      int main          OF((int argc, char **argv));
-int (*work) OF((int infile, int outfile)) = zip; /* function to call */
+local void try_help     (void) ATTRIBUTE_NORETURN;
+local void help         (void);
+local void license      (void);
+local void version      (void);
+local int input_eof    (void);
+local void treat_stdin  (void);
+local void treat_file   (char *iname);
+local int create_outfile (void);
+local char *get_suffix  (char *name);
+local int  open_input_file (char *iname, struct stat *sbuf);
+local void discard_input_bytes (size_t nbytes, unsigned int flags);
+local int  make_ofname  (void);
+local void shorten_name  (char *name);
+local int  get_method   (int in);
+local void do_list      (int ifd, int method);
+local int  check_ofname (void);
+local void copy_stat    (struct stat *ifstat);
+local void install_signal_handlers (void);
+local void remove_output_file (void);
+local RETSIGTYPE abort_gzip_signal (int);
+local void do_exit      (int exitcode) ATTRIBUTE_NORETURN;
+      int main          (int argc, char **argv);
+int (*work) (int infile, int outfile) = zip; /* function to call */

 #if ! NO_DIR
-local void treat_dir    OF((int fd, char *dir));
+local void treat_dir    (int fd, char *dir);
 #endif

 #define strequ(s1, s2) (strcmp((s1),(s2)) == 0)
diff --git a/gzip.h b/gzip.h
index d06413d..5f6791b 100644
--- a/gzip.h
+++ b/gzip.h
@@ -19,12 +19,6 @@
    along with this program; if not, write to the Free Software Foundation,
    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */

-#if defined(__STDC__) || defined(PROTO)
-#  define OF(args)  args
-#else
-#  define OF(args)  ()
-#endif
-
 #ifdef __STDC__
    typedef void *voidp;
 #else
@@ -271,63 +265,63 @@ extern int save_orig_name; /* set if original name must 
be saved */
                    if (exit_code == OK) exit_code = WARNING;}

         /* in zip.c: */
-extern int zip        OF((int in, int out));
-extern int file_read  OF((char *buf,  unsigned size));
+extern int zip        (int in, int out);
+extern int file_read  (char *buf,  unsigned size);

         /* in unzip.c */
-extern int unzip      OF((int in, int out));
-extern int check_zipfile OF((int in));
+extern int unzip      (int in, int out);
+extern int check_zipfile (int in);

         /* in unpack.c */
-extern int unpack     OF((int in, int out));
+extern int unpack     (int in, int out);

         /* in unlzh.c */
-extern int unlzh      OF((int in, int out));
+extern int unlzh      (int in, int out);

         /* in gzip.c */
-void abort_gzip OF((void)) ATTRIBUTE_NORETURN;
+extern void abort_gzip (void) ATTRIBUTE_NORETURN;

         /* in deflate.c */
-void lm_init OF((int pack_level, ush *flags));
-off_t deflate OF((void));
+extern void lm_init (int pack_level, ush *flags);
+extern off_t deflate (void);

         /* in trees.c */
-void ct_init     OF((ush *attr, int *method));
-int  ct_tally    OF((int dist, int lc));
-off_t flush_block OF((char *buf, ulg stored_len, int eof));
+extern void ct_init     (ush *attr, int *method);
+extern int  ct_tally    (int dist, int lc);
+extern off_t flush_block (char *buf, ulg stored_len, int eof);

         /* in bits.c */
-void     bi_init    OF((file_t zipfile));
-void     send_bits  OF((int value, int length));
-unsigned bi_reverse OF((unsigned value, int length));
-void     bi_windup  OF((void));
-void     copy_block OF((char *buf, unsigned len, int header));
-extern   int (*read_buf) OF((char *buf, unsigned size));
+extern void     bi_init    (file_t zipfile);
+extern void     send_bits  (int value, int length);
+extern unsigned bi_reverse (unsigned value, int length);
+extern void     bi_windup  (void);
+extern void     copy_block (char *buf, unsigned len, int header);
+extern int     (*read_buf) (char *buf, unsigned size);

         /* in util.c: */
-extern int copy           OF((int in, int out));
-extern ulg  updcrc        OF((uch *s, unsigned n));
-extern void clear_bufs    OF((void));
-extern int  fill_inbuf    OF((int eof_ok));
-extern void flush_outbuf  OF((void));
-extern void flush_window  OF((void));
-extern void write_buf     OF((int fd, voidp buf, unsigned cnt));
-extern int read_buffer    OF((int fd, voidp buf, unsigned int cnt));
-extern char *strlwr       OF((char *s));
-extern char *gzip_base_name OF((char *fname));
-extern int xunlink        OF((char *fname));
-extern void make_simple_name OF((char *name));
-extern char *add_envopt   OF((int *argcp, char ***argvp, char const *env));
-extern void gzip_error    OF((char const *m)) ATTRIBUTE_NORETURN;
-extern void xalloc_die    OF((void)) ATTRIBUTE_NORETURN;
-extern void warning       OF((char const *m));
-extern void read_error    OF((void)) ATTRIBUTE_NORETURN;
-extern void write_error   OF((void)) ATTRIBUTE_NORETURN;
-extern void display_ratio OF((off_t num, off_t den, FILE *file));
-extern void fprint_off    OF((FILE *, off_t, int));
+extern int copy           (int in, int out);
+extern ulg  updcrc        (uch *s, unsigned n);
+extern void clear_bufs    (void);
+extern int  fill_inbuf    (int eof_ok);
+extern void flush_outbuf  (void);
+extern void flush_window  (void);
+extern void write_buf     (int fd, voidp buf, unsigned cnt);
+extern int read_buffer    (int fd, voidp buf, unsigned int cnt);
+extern char *strlwr       (char *s);
+extern char *gzip_base_name (char *fname);
+extern int xunlink        (char *fname);
+extern void make_simple_name (char *name);
+extern char *add_envopt   (int *argcp, char ***argvp, char const *env);
+extern void gzip_error    (char const *m) ATTRIBUTE_NORETURN;
+extern void xalloc_die    (void) ATTRIBUTE_NORETURN;
+extern void warning       (char const *m);
+extern void read_error    (void) ATTRIBUTE_NORETURN;
+extern void write_error   (void) ATTRIBUTE_NORETURN;
+extern void display_ratio (off_t num, off_t den, FILE *file);
+extern void fprint_off    (FILE *, off_t, int);

         /* in inflate.c */
-extern int inflate OF((void));
+extern int inflate (void);

         /* in yesno.c */
-extern int yesno OF((void));
+extern int yesno (void);
diff --git a/inflate.c b/inflate.c
index d469242..ba6077a 100644
--- a/inflate.c
+++ b/inflate.c
@@ -141,15 +141,15 @@ struct huft {


 /* Function prototypes */
-int huft_build OF((unsigned *, unsigned, unsigned, ush *, ush *,
-                   struct huft **, int *));
-int huft_free OF((struct huft *));
-int inflate_codes OF((struct huft *, struct huft *, int, int));
-int inflate_stored OF((void));
-int inflate_fixed OF((void));
-int inflate_dynamic OF((void));
-int inflate_block OF((int *));
-int inflate OF((void));
+int huft_build (unsigned *, unsigned, unsigned, ush *, ush *,
+                struct huft **, int *);
+int huft_free (struct huft *);
+int inflate_codes (struct huft *, struct huft *, int, int);
+int inflate_stored (void);
+int inflate_fixed (void);
+int inflate_dynamic (void);
+int inflate_block (int *);
+int inflate (void);


 /* The inflate algorithm uses a sliding 32K byte window on the uncompressed
diff --git a/lzw.h b/lzw.h
index 69c479c..7f78134 100644
--- a/lzw.h
+++ b/lzw.h
@@ -16,10 +16,6 @@
    along with this program; if not, write to the Free Software Foundation,
    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */

-#if !defined(OF) && defined(lint)
-#  include "gzip.h"
-#endif
-
 #ifndef BITS
 #  define BITS 16
 #endif
@@ -50,5 +46,5 @@
 extern int maxbits;      /* max bits per code for LZW */
 extern int block_mode;   /* block compress mode -C compatible with 2.0 */

-extern int lzw    OF((int in, int out));
-extern int unlzw  OF((int in, int out));
+extern int lzw    (int in, int out);
+extern int unlzw  (int in, int out);
diff --git a/trees.c b/trees.c
index 7f0083c..d94f237 100644
--- a/trees.c
+++ b/trees.c
@@ -300,17 +300,17 @@ extern unsigned near strstart; /* window offset of 
current string */
  * Local (static) routines in this file.
  */

-local void init_block     OF((void));
-local void pqdownheap     OF((ct_data near *tree, int k));
-local void gen_bitlen     OF((tree_desc near *desc));
-local void gen_codes      OF((ct_data near *tree, int max_code));
-local void build_tree     OF((tree_desc near *desc));
-local void scan_tree      OF((ct_data near *tree, int max_code));
-local void send_tree      OF((ct_data near *tree, int max_code));
-local int  build_bl_tree  OF((void));
-local void send_all_trees OF((int lcodes, int dcodes, int blcodes));
-local void compress_block OF((ct_data near *ltree, ct_data near *dtree));
-local void set_file_type  OF((void));
+local void init_block     (void);
+local void pqdownheap     (ct_data near *tree, int k);
+local void gen_bitlen     (tree_desc near *desc);
+local void gen_codes      (ct_data near *tree, int max_code);
+local void build_tree     (tree_desc near *desc);
+local void scan_tree      (ct_data near *tree, int max_code);
+local void send_tree      (ct_data near *tree, int max_code);
+local int  build_bl_tree  (void);
+local void send_all_trees (int lcodes, int dcodes, int blcodes);
+local void compress_block (ct_data near *ltree, ct_data near *dtree);
+local void set_file_type  (void);


 #ifndef DEBUG
diff --git a/unlzh.c b/unlzh.c
index 2308e5c..37084fe 100644
--- a/unlzh.c
+++ b/unlzh.c
@@ -12,25 +12,25 @@

 /* decode.c */

-local unsigned  decode  OF((unsigned count, uch buffer[]));
-local void decode_start OF((void));
+local unsigned  decode  (unsigned count, uch buffer[]);
+local void decode_start (void);

 /* huf.c */
-local void huf_decode_start OF((void));
-local unsigned decode_c     OF((void));
-local unsigned decode_p     OF((void));
-local void read_pt_len      OF((int nn, int nbit, int i_special));
-local void read_c_len       OF((void));
+local void huf_decode_start (void);
+local unsigned decode_c     (void);
+local unsigned decode_p     (void);
+local void read_pt_len      (int nn, int nbit, int i_special);
+local void read_c_len       (void);

 /* io.c */
-local void fillbuf      OF((int n));
-local unsigned getbits  OF((int n));
-local void init_getbits OF((void));
+local void fillbuf      (int n);
+local unsigned getbits  (int n);
+local void init_getbits (void);

 /* maketbl.c */

-local void make_table OF((int nchar, uch bitlen[],
-                          int tablebits, ush table[]));
+local void make_table (int nchar, uch bitlen[],
+                       int tablebits, ush table[]);


 #define DICBIT    13    /* 12(-lh4-) or 13(-lh5-) */
diff --git a/unpack.c b/unpack.c
index 9a022e8..276e925 100644
--- a/unpack.c
+++ b/unpack.c
@@ -95,8 +95,8 @@ local int valid;                  /* number of valid bits in 
bitbuf */

 /* Local functions */

-local void read_tree  OF((void));
-local void build_tree OF((void));
+local void read_tree  (void);
+local void build_tree (void);

 /* ===========================================================================
  * Read the Huffman tree.
diff --git a/util.c b/util.c
index ee34a3a..12e37c0 100644
--- a/util.c
+++ b/util.c
@@ -38,7 +38,7 @@
 #  define CHAR_BIT 8
 #endif

-static int write_buffer OF((int, voidp, unsigned int));
+static int write_buffer (int, voidp, unsigned int);

 extern ulg crc_32_tab[];   /* crc table, defined below */

-- 
1.7.5.1.354.g761178




reply via email to

[Prev in Thread] Current Thread [Next in Thread]