bison-patches
[Top][All Lists]
Advanced

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

[PATCH 4/5] style changes


From: Victor Santet
Subject: [PATCH 4/5] style changes
Date: Fri, 29 Jun 2012 15:22:12 +0200

* src/complain.c, src/reader.c, src/reduce.c: Fix indentation.
Simplify a bit.
---
 src/complain.c |    4 +---
 src/reader.c   |    3 +--
 src/reduce.c   |   12 ++++++------
 3 files changed, 8 insertions(+), 11 deletions(-)

diff --git a/src/complain.c b/src/complain.c
index 5d9c55c..3b0203c 100644
--- a/src/complain.c
+++ b/src/complain.c
@@ -139,10 +139,8 @@ complains (const location *loc, warnings flags, const char 
*message,
           error_message (loc, flags, _("warning"), message, args);
         }
     }
-  else
+  else if (warnings_flag & flags)
     {
-      if (! (warnings_flag & flags))
-        return;
       set_warning_issued ();
       error_message (loc, flags, _("warning"), message, args);
     }
diff --git a/src/reader.c b/src/reader.c
index 59e56c5..52c0b13 100644
--- a/src/reader.c
+++ b/src/reader.c
@@ -319,8 +319,7 @@ grammar_rule_check (const symbol_list *r)
             /* The default action, $$ = $1, `uses' both.  */
             && (r->action_props.code || (n != 0 && n != 1)))
           {
-            int warn_flag =
-              midrule_warning ? Wmidrule_values : Wother;
+            warnings warn_flag = midrule_warning ? Wmidrule_values : Wother;
             if (n)
               complain_at (r->location, warn_flag, _("unused value: $%d"), n);
             else
diff --git a/src/reduce.c b/src/reduce.c
index 5a60e0a..be7f421 100644
--- a/src/reduce.c
+++ b/src/reduce.c
@@ -384,13 +384,13 @@ reduce_print (void)
 {
   if (nuseless_nonterminals > 0)
     complain (Wother, ngettext ("%d nonterminal useless in grammar",
-                                        "%d nonterminals useless in grammar",
-                                        nuseless_nonterminals),
+                                "%d nonterminals useless in grammar",
+                                nuseless_nonterminals),
               nuseless_nonterminals);
   if (nuseless_productions > 0)
     complain (Wother, ngettext ("%d rule useless in grammar",
-                                        "%d rules useless in grammar",
-                                        nuseless_productions),
+                                "%d rules useless in grammar",
+                                nuseless_productions),
               nuseless_productions);
 }
 
@@ -432,8 +432,8 @@ reduce_grammar (void)
     {
       grammar_dump (stderr, "Reduced Grammar");
 
-      fprintf (stderr, "reduced %s defines %d terminals, %d nonterminals\
-, and %d productions.\n",
+      fprintf (stderr, "reduced %s defines %d terminals, %d nonterminals"
+               ", and %d productions.\n",
                grammar_file, ntokens, nvars, nrules);
     }
 }
-- 
1.7.9.5




reply via email to

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