warnings: fix -Wmissing-prototypes issues

* src/counterexample.c, src/lssi.c, src/parse-simulation.c,
* src/state-item.c:
Here.
This commit is contained in:
Akim Demaille
2020-06-03 08:26:23 +02:00
parent 7e16bd2cae
commit ae03b16785
4 changed files with 26 additions and 24 deletions

View File

@@ -60,7 +60,7 @@
#define CUMULATIVE_TIME_LIMIT 120.0f
// This is the fastest way to get the tail node from the gl_list API.
gl_list_node_t
static gl_list_node_t
list_get_end (gl_list_t list)
{
gl_list_node_t sentinel = gl_list_add_last (list, NULL);
@@ -77,7 +77,7 @@ typedef struct
bool timeout;
} counterexample;
counterexample *
static counterexample *
new_counterexample (derivation *d1, derivation *d2,
bool u, bool t)
{
@@ -89,7 +89,7 @@ new_counterexample (derivation *d1, derivation *d2,
return res;
}
void
static void
free_counterexample (counterexample *cex)
{
derivation_free (cex->d1);
@@ -97,7 +97,7 @@ free_counterexample (counterexample *cex)
free (cex);
}
void
static void
print_counterexample (counterexample *cex)
{
FILE *out = stderr;
@@ -133,7 +133,7 @@ typedef struct si_bfs_node
int reference_count;
} si_bfs_node;
si_bfs_node *
static si_bfs_node *
si_bfs_new (state_item_number si, si_bfs_node *parent)
{
si_bfs_node *res = xcalloc (1, sizeof (si_bfs_node));
@@ -154,7 +154,7 @@ si_bfs_contains (const si_bfs_node *n, state_item_number sin)
return false;
}
void
static void
si_bfs_free (si_bfs_node *n)
{
if (n == NULL)
@@ -384,11 +384,10 @@ complete_diverging_example (symbol_number conflict_sym,
return res;
}
/* iterates backwards through the shifts of the path in the
reduce conflict, and finds a path of shifts from the shift
conflict that goes through the same states.
*/
gl_list_t
/* Iterate backwards through the shifts of the path in the reduce
conflict, and find a path of shifts from the shift conflict that
goes through the same states. */
static gl_list_t
nonunifying_shift_path (gl_list_t reduce_path, state_item *shift_conflict)
{
gl_list_node_t tmp = gl_list_add_last (reduce_path, NULL);
@@ -483,7 +482,7 @@ nonunifying_shift_path (gl_list_t reduce_path, state_item *shift_conflict)
* Construct a nonunifying counterexample from the shortest
* lookahead-sensitive path.
*/
counterexample *
static counterexample *
example_from_path (bool shift_reduce,
state_item_number itm2,
gl_list_t shortest_path, symbol_number next_sym)
@@ -604,7 +603,7 @@ ss_set_parse_state (search_state *ss, int idx, parse_state *ps)
* which has its parse states unified at the beginning
* but not the end of the example.
*/
counterexample *
static counterexample *
complete_diverging_examples(search_state *ss,
symbol_number next_sym)
{
@@ -630,7 +629,8 @@ typedef struct
gl_list_t states;
int complexity;
} search_state_bundle;
void
static void
ssb_free (search_state_bundle *ssb)
{
gl_list_free (ssb->states);
@@ -797,7 +797,7 @@ reduction_step (search_state *ss, const item_number *conflict_item,
* the given subsequent next symbol on each path. If a reverse transition
* cannot be made on both states, possible reverse productions are prepended
*/
void
static void
search_state_prepend (search_state *ss, symbol_number sym, bitset guide)
{
(void) sym; // FIXME: Unused.
@@ -1042,7 +1042,7 @@ generate_next_states (search_state *ss, state_item *conflict1,
* we are at and gives the appropriate counterexample
* type based off of time constraints.
*/
counterexample *
static counterexample *
unifying_example (state_item_number itm1,
state_item_number itm2,
bool shift_reduce,

View File

@@ -38,7 +38,7 @@ typedef struct lssi
bool free_lookahead;
} lssi;
lssi *
static lssi *
new_lssi (state_item_number si, lssi *p, bitset l, bool free_l)
{
lssi *res = xmalloc (sizeof *res);
@@ -49,7 +49,7 @@ new_lssi (state_item_number si, lssi *p, bitset l, bool free_l)
return res;
}
void
static void
lssi_free (lssi *sn)
{
if (sn == NULL)
@@ -117,7 +117,7 @@ lssi_print (lssi *l)
* Compute the set of state-items that can reach the given conflict item via
* a combination of transitions or production steps.
*/
bitset
static bitset
eligible_state_items (state_item *target)
{
bitset result = bitset_create (nstate_items, BITSET_FIXED);

View File

@@ -272,7 +272,8 @@ typedef void (*chunk_append_fn) (gl_list_t, const void *);
// A version of gl_list_add_last which has the chunk_append_fn
// signature.
void list_add_last (gl_list_t list, const void *elt)
static void
list_add_last (gl_list_t list, const void *elt)
{
gl_list_add_last (list, elt);
}
@@ -316,7 +317,8 @@ parse_state_list_new (void)
true);
}
void parse_state_list_append (parse_state_list pl, parse_state *ps)
static void
parse_state_list_append (parse_state_list pl, parse_state *ps)
{
parse_state_retain (ps);
gl_list_add_last (pl, ps);
@@ -407,7 +409,7 @@ parse_state_lists (parse_state *ps, gl_list_t *sitems,
* Compute the parse states that result from taking a transition on
* nullable symbols whenever possible from the given state_item.
*/
void
static void
nullable_closure (parse_state *ps, state_item *si, parse_state_list state_list)
{
parse_state *current_ps = ps;

View File

@@ -61,7 +61,7 @@ hash_pair_free (hash_pair *hp)
free (hp);
}
Hash_table *
static Hash_table *
hash_pair_table_create (int size)
{
return hash_xinitialize (size,
@@ -333,7 +333,7 @@ gen_lookaheads (void)
bitsetv firsts = NULL;
void
static void
init_firsts (void)
{
firsts = bitsetv_create (nvars, nsyms, BITSET_FIXED);