[PATCH 1/5] cex: style: prefer FOO_print to print_FOO

Akim Demaille <[email protected]>
Newsgroups gmane.comp.parsers.bison.patches
Message-ID <[email protected]>
* src/state-item.h, src/state-item.c (print_state_item): Rename as...
(state_item_print): this.
---
 src/counterexample.c   | 10 +++++-----
 src/lssi.c             |  2 +-
 src/parse-simulation.c |  4 ++--
 src/state-item.c       |  6 +++---
 src/state-item.h       |  3 ++-
 5 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/counterexample.c b/src/counterexample.c
index 4dc5c708..8391770c 100644
--- a/src/counterexample.c
+++ b/src/counterexample.c
@@ -526,7 +526,7 @@ nonunifying_shift_path (state_item_list reduce_path, state_item *shift_conflict)
       for (gl_list_iterator_t it = gl_list_iterator (result);
            state_item_list_next (&it, &sip);
            )
-        print_state_item (sip, stderr, "");
+        state_item_print (sip, stderr, "");
     }
   return result;
 }
@@ -1290,8 +1290,8 @@ counterexample_report_shift_reduce (state_item_number itm1, state_item_number it
   // In the report, print the items.
   if (out != stderr || trace_flag & trace_cex)
     {
-      print_state_item (&state_items[itm1], out, prefix);
-      print_state_item (&state_items[itm2], out, prefix);
+      state_item_print (&state_items[itm1], out, prefix);
+      state_item_print (&state_items[itm2], out, prefix);
     }
   counterexample_report (itm1, itm2, next_sym, true, out, prefix);
 }
@@ -1334,8 +1334,8 @@ counterexample_report_reduce_reduce (state_item_number itm1, state_item_number i
   // In the report, print the items.
   if (out != stderr || trace_flag & trace_cex)
     {
-      print_state_item (&state_items[itm1], out, prefix);
-      print_state_item (&state_items[itm2], out, prefix);
+      state_item_print (&state_items[itm1], out, prefix);
+      state_item_print (&state_items[itm2], out, prefix);
     }
   counterexample_report (itm1, itm2, bitset_first (conflict_syms),
                          false, out, prefix);
diff --git a/src/lssi.c b/src/lssi.c
index 8448482c..a5ab8a79 100644
--- a/src/lssi.c
+++ b/src/lssi.c
@@ -256,7 +256,7 @@ shortest_path_from_start (state_item_number target, symbol_number next_sym)
       gl_list_iterator_t it = gl_list_iterator (res);
       const void *sip;
       while (gl_list_iterator_next (&it, &sip, NULL))
-        print_state_item ((state_item *) sip, stdout, "");
+        state_item_print ((state_item *) sip, stdout, "");
     }
   return res;
 }
diff --git a/src/parse-simulation.c b/src/parse-simulation.c
index bbf029b6..d3a2d1a7 100644
--- a/src/parse-simulation.c
+++ b/src/parse-simulation.c
@@ -594,8 +594,8 @@ print_parse_state (parse_state *ps)
   FILE *out = stderr;
   fprintf (out, "(size %zu depth %d rc %d)\n",
           ps->state_items.total_size, ps->depth, ps->reference_count);
-  print_state_item (ps->state_items.head_elt, out, "");
-  print_state_item (ps->state_items.tail_elt, out, "");
+  state_item_print (ps->state_items.head_elt, out, "");
+  state_item_print (ps->state_items.tail_elt, out, "");
   if (ps->derivs.total_size > 0)
     derivation_print (ps->derivs.head_elt, out, "");
   putc ('\n', out);
diff --git a/src/state-item.c b/src/state-item.c
index d7d1ff8a..a0c5a31a 100644
--- a/src/state-item.c
+++ b/src/state-item.c
@@ -475,7 +475,7 @@ prune_disabled_paths (void)
 }
 
 void
-print_state_item (const state_item *si, FILE *out, const char *prefix)
+state_item_print (const state_item *si, FILE *out, const char *prefix)
 {
   fputs (prefix, out);
   item_print (si->item, NULL, out);
@@ -506,7 +506,7 @@ state_items_report (void)
           if (si->trans >= 0)
             {
               fputs ("    -> ", stdout);
-              print_state_item (&state_items[si->trans], stdout, "");
+              state_item_print (&state_items[si->trans], stdout, "");
             }
 
           bitset sets[2] = { si->prods, si->revs };
@@ -521,7 +521,7 @@ state_items_report (void)
                   BITSET_FOR_EACH (biter, b, sin, 0)
                     {
                       fputs (txt[seti], stdout);
-                      print_state_item (&state_items[sin], stdout, "");
+                      state_item_print (&state_items[sin], stdout, "");
                     }
                 }
             }
diff --git a/src/state-item.h b/src/state-item.h
index dc2b36c8..a0a3d36f 100644
--- a/src/state-item.h
+++ b/src/state-item.h
@@ -90,9 +90,10 @@ state_item_index_lookup (state_number s, state_item_number off)
 }
 
 void state_items_init (void);
-void print_state_item (const state_item *si, FILE *out, const char *prefix);
 void state_items_free (void);
 
+void state_item_print (const state_item *si, FILE *out, const char *prefix);
+
 bool production_allowed (const state_item *si, const state_item *next);
 
 // Iterating on a state_item_list.
-- 
2.27.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.