diff options
author | szengel <szengel@140774ce-b5e7-0310-ab8b-a85725594a96> | 2012-05-09 13:25:23 +0000 |
---|---|---|
committer | szengel <szengel@140774ce-b5e7-0310-ab8b-a85725594a96> | 2012-05-09 13:25:23 +0000 |
commit | bd0a9f3196b812b2ee1b13651ad91b843112a66d (patch) | |
tree | fc0885f3776c5848f401dced4447548fb5e0f0a7 /src/regex/regex.c | |
parent | 862ccf4a4ed49792cdf6d0e58870e07576c43e0b (diff) |
Fixed warning
git-svn-id: https://gnunet.org/svn/gnunet@21382 140774ce-b5e7-0310-ab8b-a85725594a96
Diffstat (limited to 'src/regex/regex.c')
-rw-r--r-- | src/regex/regex.c | 33 |
1 files changed, 12 insertions, 21 deletions
diff --git a/src/regex/regex.c b/src/regex/regex.c index 53303c0428..d200becc96 100644 --- a/src/regex/regex.c +++ b/src/regex/regex.c @@ -275,16 +275,15 @@ struct GNUNET_REGEX_StateSet }; /* - * Debug helper function + * Debug helper functions */ -/* -static void debug_print_transition (struct Transition *); +void +debug_print_transitions (struct GNUNET_REGEX_State *); -static void +void debug_print_state (struct GNUNET_REGEX_State *s) { char *proof; - int i; if (NULL == s->proof) proof = "NULL"; @@ -296,26 +295,20 @@ debug_print_state (struct GNUNET_REGEX_State *s) s->id, s->name, s->marked, s->accepting, s->scc_id, s->transition_count, proof); - GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Incoming transitions:\n"); - - for (i=0; i < s->incoming_transition_count; i++) - debug_print_transition (s->incoming_transitions[i]); + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Transitions:\n"); + debug_print_transitions (s); } -static void -debug_print_states (struct GNUNET_REGEX_StateSet *sset) +void +debug_print_states (struct GNUNET_REGEX_Automaton *a) { struct GNUNET_REGEX_State *s; - int i; - for (i = 0; i < sset->len; i++) - { - s = sset->states[i]; + for (s = a->states_head; NULL != s; s = s->next) debug_print_state (s); - } } -static void +void debug_print_transition (struct Transition *t) { char *to_state; @@ -344,7 +337,7 @@ debug_print_transition (struct Transition *t) t->id, from_state, label, to_state); } -static void +void debug_print_transitions (struct GNUNET_REGEX_State *s) { struct Transition *t; @@ -352,7 +345,6 @@ debug_print_transitions (struct GNUNET_REGEX_State *s) for (t = s->transitions_head; NULL != t; t = t->next) debug_print_transition (t); } -*/ /** * Recursive function doing DFS with 'v' as a start, detecting all SCCs inside @@ -421,7 +413,6 @@ scc_tarjan_strongconnect (struct GNUNET_REGEX_Context *ctx, static void scc_tarjan (struct GNUNET_REGEX_Context *ctx, struct GNUNET_REGEX_Automaton *a) { - unsigned int i; int index; struct GNUNET_REGEX_State *v; struct GNUNET_REGEX_State *stack[a->state_count]; @@ -437,7 +428,7 @@ scc_tarjan (struct GNUNET_REGEX_Context *ctx, struct GNUNET_REGEX_Automaton *a) stack_size = 0; index = 0; - for (i = 0, v = a->states_head; NULL != v; v = v->next) + for (v = a->states_head; NULL != v; v = v->next) { if (v->index < 0) scc_tarjan_strongconnect (ctx, v, &index, stack, &stack_size); |