bison-patches
[Top][All Lists]
Advanced

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

style: fix syntax-check issues


From: Akim Demaille
Subject: style: fix syntax-check issues
Date: Sun, 7 Jun 2020 09:19:18 +0200

commit 421662ec88797e249ae1eced9e1e1f05ffaf0abe
Author: Akim Demaille <akim.demaille@gmail.com>
Date:   Sun Jun 7 09:14:43 2020 +0200

    style: fix syntax-check issues
    
    * src/counterexample.c, src/files.c, src/files.h, src/lssi.c,
    * src/state-item.c: here.

diff --git a/src/counterexample.c b/src/counterexample.c
index 1eb83451..c11213a2 100644
--- a/src/counterexample.c
+++ b/src/counterexample.c
@@ -219,7 +219,7 @@ expand_to_conflict (state_item_number start, symbol_number 
conflict_sym)
     {
       gl_list_free (queue);
       fputs ("Error expanding derivation\n", stderr);
-      exit (1);
+      abort ();
     }
 
   derivation *dinit = derivation_new_leaf (conflict_sym);
@@ -295,7 +295,7 @@ complete_diverging_example (symbol_number conflict_sym,
       item_number pos = *item;
       // symbols after dot
       if (gl_list_size (result) == 1 && !item_number_is_rule_number (pos)
-          && gl_list_get_at (result, 0) == derivation_dot() )
+          && gl_list_get_at (result, 0) == derivation_dot ())
         {
           derivation_list_append (result,
             derivation_new_leaf (item_number_as_symbol_number (pos)));
@@ -604,8 +604,8 @@ ss_set_parse_state (search_state *ss, int idx, parse_state 
*ps)
  * but not the end of the example.
  */
 static counterexample *
-complete_diverging_examples(search_state *ss,
-                            symbol_number next_sym)
+complete_diverging_examples (search_state *ss,
+                             symbol_number next_sym)
 {
   derivation *new_derivs[2];
   for (int i = 0; i < 2; ++i)
@@ -634,7 +634,7 @@ static void
 ssb_free (search_state_bundle *ssb)
 {
   gl_list_free (ssb->states);
-  free(ssb);
+  free (ssb);
 }
 
 static size_t
diff --git a/src/files.c b/src/files.c
index 76c3a7e5..1f72730d 100644
--- a/src/files.c
+++ b/src/files.c
@@ -76,7 +76,7 @@ static int generated_files_size = 0;
 uniqstr grammar_file = NULL;
 
 /* If --output=dir/foo.c was specified,
-   DIR_PREFIX is 'dir/' and ALL_BUT_EXT and ALL_BUT_TAB_EXT are 'dir/foo'.
+   DIR_PREFIX gis 'dir/' and ALL_BUT_EXT and ALL_BUT_TAB_EXT are 'dir/foo'.
 
    If --output=dir/foo.tab.c was specified, DIR_PREFIX is 'dir/',
    ALL_BUT_EXT is 'dir/foo.tab', and ALL_BUT_TAB_EXT is 'dir/foo'.
@@ -219,7 +219,7 @@ prefix_map_free (struct prefix_map *p)
 /*  Adds a new file prefix mapping. If a file path starts with oldprefix, it
     will be replaced with newprefix */
 void
-add_prefix_map(char const* oldprefix, char const* newprefix)
+add_prefix_map (char const *oldprefix, char const *newprefix)
 {
   if (!prefix_maps)
     prefix_maps = gl_list_create_empty (GL_ARRAY_LIST,
diff --git a/src/files.h b/src/files.h
index 17b434cf..22d1d750 100644
--- a/src/files.h
+++ b/src/files.h
@@ -92,6 +92,6 @@ void xfclose (FILE *ptr);
 FILE *xfdopen (int fd, char const *mode);
 
 char *map_file_name (char const *filename);
-void add_prefix_map(char const* oldprefix, char const* newprefix);
+void add_prefix_map (char const *oldprefix, char const *newprefix);
 
 #endif /* !FILES_H_ */
diff --git a/src/lssi.c b/src/lssi.c
index b3512f0f..6bd09551 100644
--- a/src/lssi.c
+++ b/src/lssi.c
@@ -238,7 +238,7 @@ shortest_path_from_start (state_item_number target, 
symbol_number next_sym)
     {
       gl_list_free (queue);
       fputs ("Cannot find shortest path to conflict state.", stderr);
-      exit (1);
+      abort ();
     }
   gl_list_t res =
     gl_list_create_empty (GL_LINKED_LIST, NULL, NULL, NULL, true);
diff --git a/src/state-item.c b/src/state-item.c
index b3e8cdfc..21b276d3 100644
--- a/src/state-item.c
+++ b/src/state-item.c
@@ -563,7 +563,7 @@ void
 state_items_free (void)
 {
   for (int i = 0; i < nstate_items; ++i)
-    if (!SI_DISABLED(i))
+    if (!SI_DISABLED (i))
       {
         state_item *si = state_items + i;
         if (si->prods)




reply via email to

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