bug-patch
[Top][All Lists]
Advanced

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

[bug-patch] [PATCH 1/2] maint: enable the useless_cpp_parens syntax-chec


From: Jim Meyering
Subject: [bug-patch] [PATCH 1/2] maint: enable the useless_cpp_parens syntax-check rule
Date: Sun, 01 Jan 2012 22:40:50 +0100

Hi Andreas,

I noticed that two of the currently-disabled syntax checks
could be easily enabled.  One by removing useless parentheses,
and the other by reversing a few sp-TAB sequences in a single test.
These seem uncontroversial, but I'll wait a little, just in case.


>From d504183866dccdf8e7c09522b601236d91591141 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Sun, 1 Jan 2012 10:54:51 +0100
Subject: [PATCH 1/2] maint: enable the useless_cpp_parens syntax-check rule

* cfg.mk (local-checks-to-skip): Remove sc_useless_cpp_parens,
thus enabling this syntax-check rule.
* src/patch.c: Remove unneeded parentheses.
---
 cfg.mk      |    3 +--
 src/patch.c |    2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/cfg.mk b/cfg.mk
index 2730d3e..63dda64 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -31,8 +31,7 @@ local-checks-to-skip = \
   sc_prohibit_strcmp \
   sc_prohibit_test_minus_ao \
   sc_require_test_exit_idiom \
-  sc_space_tab \
-  sc_useless_cpp_parens
+  sc_space_tab

 exclude_file_name_regexp--sc_prohibit_doubled_word = ^src/util\.c$$
 exclude_file_name_regexp--sc_unmarked_diagnostics = ^src/util\.c$$
diff --git a/src/patch.c b/src/patch.c
index 652db31..9e94823 100644
--- a/src/patch.c
+++ b/src/patch.c
@@ -622,7 +622,7 @@ reinitialize_almost_everything (void)
 }

 static char const shortopts[] = "bB:cd:D:eEfF:g:i:l"
-#if 0 && defined(ENABLE_MERGE)
+#if 0 && defined ENABLE_MERGE
                                "m"
 #endif
                                "nNo:p:r:RstTuvV:x:Y:z:Z";
--
1.7.8.1.391.g2c2ad


>From d0745f417ce32d647ab5a949b6027404da5e98c3 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Sun, 1 Jan 2012 10:57:59 +0100
Subject: [PATCH 2/2] maint: enable the sc_space_tab syntax-check rule

* cfg.mk (local-checks-to-skip): Remove sc_space_tab,
thus enabling this syntax-check rule.
* tests/quoted-filenames: Use TAB-space, not space-TAB.
---
 cfg.mk                 |    3 +--
 tests/quoted-filenames |    8 ++++----
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/cfg.mk b/cfg.mk
index 63dda64..7fef9d0 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -30,8 +30,7 @@ local-checks-to-skip = \
   sc_prohibit_magic_number_exit \
   sc_prohibit_strcmp \
   sc_prohibit_test_minus_ao \
-  sc_require_test_exit_idiom \
-  sc_space_tab
+  sc_require_test_exit_idiom

 exclude_file_name_regexp--sc_prohibit_doubled_word = ^src/util\.c$$
 exclude_file_name_regexp--sc_unmarked_diagnostics = ^src/util\.c$$
diff --git a/tests/quoted-filenames b/tests/quoted-filenames
index ffbac09..d1fbe88 100644
--- a/tests/quoted-filenames
+++ b/tests/quoted-filenames
@@ -18,13 +18,13 @@ use_tmpdir
 #   \ / : * ? " < > |

 cat > d.diff <<EOF
-diff --git " \\t\\040" " \\t\\040"
---- " \\t\\040"
-+++ " \\t\\040"
+diff --git "\\t \\040" "\\t \\040"
+--- "\\t \\040"
++++ "\\t \\040"
 @@ -1 +1 @@
 -one
 +two
 EOF

-ncheck 'echo one > "    "'
+ncheck 'echo one > "     "'
 ncheck 'patch -s -p0 < d.diff'
--
1.7.8.1.391.g2c2ad



reply via email to

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