maint: enable more syntax checks
authorJim Meyering <meyering@fb.com>
Tue, 19 Aug 2014 15:59:38 +0000 (08:59 -0700)
committerJim Meyering <meyering@fb.com>
Mon, 10 Nov 2014 16:40:00 +0000 (08:40 -0800)
* cfg.mk (local-checks-to-skip): Remove several rule names from this
list, thus enabling the corresponding checks.  To fix some, I made
syntactic changes to source files.  In other cases, I exempted certain
files from the checks.
Add exemptions for these:
  sc_prohibit_atoi_atof = ^(gzip|sample/sub)\.c$$
  sc_space_tab = ^lib/match\.c$$
  sc_useless_cpp_parens = ^(lib/match\.c|tailor\.h)$$
* configure.ac: Add quotes to fix under-quoting.
* deflate.c: Remove unnecessary cpp parentheses.
* tests/Makefile.am (TEST_ENVIRONMENT): Remove space-before-TAB.
* unlzw.c: Change some TABs to spaces.

cfg.mk
configure.ac
deflate.c
tests/Makefile.am
unlzw.c

diff --git a/cfg.mk b/cfg.mk
index b2dc613ea603f326f3e39357de421e699335d91a..4321e64336be0a739201be36f8d371b7804ade8e 100644 (file)
--- a/cfg.mk
+++ b/cfg.mk
@@ -22,16 +22,8 @@ local-checks-to-skip =               \
   sc_bindtextdomain            \
   sc_error_message_period      \
   sc_error_message_uppercase   \
-  sc_m4_quote_check            \
-  sc_obsolete_symbols          \
   sc_program_name              \
-  sc_prohibit_S_IS_definition  \
-  sc_prohibit_atoi_atof                \
-  sc_prohibit_stat_st_blocks   \
-  sc_space_tab                 \
-  sc_texinfo_acronym           \
-  sc_useless_cpp_parens
-
+  sc_texinfo_acronym
 
 # Tools used to bootstrap this package, used for "announcement".
 bootstrap-tools = autoconf,automake,gnulib
@@ -75,6 +67,9 @@ exclude_file_name_regexp--sc_prohibit_empty_lines_at_EOF = \
   ^tests/hufts-segv\.gz$$
 exclude_file_name_regexp--sc_prohibit_strcmp = ^gzip\.c$$
 exclude_file_name_regexp--sc_prohibit_always-defined_macros = ^tailor\.h$$
+exclude_file_name_regexp--sc_prohibit_atoi_atof = ^(gzip|sample/sub)\.c$$
+exclude_file_name_regexp--sc_space_tab = ^lib/match\.c$$
+exclude_file_name_regexp--sc_useless_cpp_parens = ^(lib/match\.c|tailor\.h)$$
 
 exclude_file_name_regexp--sc_prohibit_double_semicolon = ^lib/match\.c$$
 
index 0c15e17bed9f8f3f2f5c63adee880770131576aa..203e371c57570e840c9da662813ac802494139f8 100644 (file)
@@ -228,7 +228,7 @@ AC_CACHE_CHECK([for an assembler syntax supported by this package],
      rm -f conftest* _match.i _match.S match_.s match_.$OBJEXT;;
    esac])
 if test "$gzip_cv_assembler" != no; then
-  AC_DEFINE(ASMV, ,
+  AC_DEFINE([ASMV], ,
     [Define if an assembler version of longest_match is available.])
   AC_LIBOBJ(match)
 fi
index 8a257f37fe110c1083d9f8fa360856405388a534..2a0316b9dc0a4151e937b60dacf2e111c69b40d7 100644 (file)
--- a/deflate.c
+++ b/deflate.c
@@ -307,7 +307,7 @@ void lm_init (pack_level, flags)
     compr_level = pack_level;
 
     /* Initialize the hash table. */
-#if defined(MAXSEG_64K) && HASH_BITS == 15
+#if defined MAXSEG_64K && HASH_BITS == 15
     for (j = 0;  j < HASH_SIZE; j++) head[j] = NIL;
 #else
     memzero((char*)head, HASH_SIZE*sizeof(*head));
@@ -414,7 +414,7 @@ longest_match(IPos cur_match)
         /* Skip to next match if the match length cannot increase
          * or if the match length is less than 2:
          */
-#if (defined(UNALIGNED_OK) && MAX_MATCH == 258)
+#if defined UNALIGNED_OK && MAX_MATCH == 258
         /* This code assumes sizeof(unsigned short) == 2. Do not use
          * UNALIGNED_OK if your compiler uses a different size.
          */
index d1e934e6eb343898e24184640ff3372b7217cf30..25851842862ee04dd726c1aa512ec4a64fff05a9 100644 (file)
@@ -72,7 +72,7 @@ TESTS_ENVIRONMENT =                           \
     fi;                                                \
   };                                           \
   LC_ALL=C; export LC_ALL;                                             \
-  VERSION=$(VERSION); export VERSION;                                          \
+  VERSION=$(VERSION); export VERSION;                                  \
   abs_top_builddir='$(abs_top_builddir)'; export abs_top_builddir;     \
   abs_top_srcdir='$(abs_top_srcdir)'; export abs_top_srcdir;           \
   abs_srcdir='$(abs_srcdir)'; export abs_srcdir;                       \
diff --git a/unlzw.c b/unlzw.c
index 676d58c4b96e4212dfac6fcdc10e0c90032c32ac..867c0eadd65de1605f734638ff54d30581385e09 100644 (file)
--- a/unlzw.c
+++ b/unlzw.c
 #include "gzip.h"
 #include "lzw.h"
 
-typedef        unsigned char   char_type;
-typedef          long   code_int;
-typedef unsigned long  count_int;
-typedef unsigned short count_short;
-typedef unsigned long  cmp_code_int;
+typedef unsigned char char_type;
+typedef          long code_int;
+typedef unsigned long count_int;
+typedef unsigned short count_short;
+typedef unsigned long cmp_code_int;
 
 #define MAXCODE(n)     (1L << (n))