gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r21330 - gnunet/src/regex


From: gnunet
Subject: [GNUnet-SVN] r21330 - gnunet/src/regex
Date: Mon, 7 May 2012 19:31:46 +0200

Author: szengel
Date: 2012-05-07 19:31:46 +0200 (Mon, 07 May 2012)
New Revision: 21330

Modified:
   gnunet/src/regex/regex.c
   gnunet/src/regex/test_regex_iterate_api.c
Log:
Fixed compilation warnings


Modified: gnunet/src/regex/regex.c
===================================================================
--- gnunet/src/regex/regex.c    2012-05-07 15:18:35 UTC (rev 21329)
+++ gnunet/src/regex/regex.c    2012-05-07 17:31:46 UTC (rev 21330)
@@ -274,10 +274,17 @@
   unsigned int len;
 };
 
+/*
+ * Debug helper function
+ */
+/*
+static void debug_print_transition (struct Transition *);
+
 static void
 debug_print_state (struct GNUNET_REGEX_State *s)
 {
   char *proof;
+  int i;
 
   if (NULL == s->proof)
     proof = "NULL";
@@ -288,6 +295,11 @@
               "State %i: %s marked: %i accepting: %i scc_id: %i transitions: 
%i proof: %s\n",
               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]);
 }
 
 static void
@@ -340,6 +352,7 @@
   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
@@ -1163,13 +1176,9 @@
             }
           }
         }
-        if (num_equal_edges == 0)
+        if (num_equal_edges != s1->transition_count ||
+            num_equal_edges != s2->transition_count)
         {
-          table[s1->marked][s2->marked] = -1;
-        }
-        else if (num_equal_edges != s1->transition_count ||
-                 num_equal_edges != s2->transition_count)
-        {
           // Make sure ALL edges of possible equal states are the same
           table[s1->marked][s2->marked] = -2;
         }
@@ -1913,7 +1922,6 @@
   // Create proofs for all states
   automaton_traverse (NULL, dfa, &state_create_proof);
 
-
   return dfa;
 }
 

Modified: gnunet/src/regex/test_regex_iterate_api.c
===================================================================
--- gnunet/src/regex/test_regex_iterate_api.c   2012-05-07 15:18:35 UTC (rev 
21329)
+++ gnunet/src/regex/test_regex_iterate_api.c   2012-05-07 17:31:46 UTC (rev 
21330)
@@ -58,31 +58,14 @@
   int error;
   const char *regex;
   struct GNUNET_REGEX_Automaton *dfa;
-  struct GNUNET_REGEX_Automaton *nfa;
 
   error = 0;
-  /*regex = "ab?|xy|(abcd)?"; */
-  /*regex = "(ab|cd|ef)xy"; */
-  /*regex = "(ac|bc)de"; */
-  /*regex = "((a|b)c)de"; */
-  /*regex = "a+X*y+c|p|R|Z*K*y*R+w|Y*6+n+h*k*w+V*F|W*B*e*"; */
   regex = "ab(c|d)+c*(a(b|c)d)+";
-  /*regex = "ab?(abcd)?"; */
-  const char *regex1 = "(ac|bc)de";
-  const char *regex2 = "((a|b)c)de";
 
-  /*nfa = GNUNET_REGEX_construct_nfa (regex, strlen (regex)); */
-  /*GNUNET_REGEX_automaton_save_graph (nfa, "nfa.dot"); */
   dfa = GNUNET_REGEX_construct_dfa (regex, strlen (regex));
   GNUNET_REGEX_automaton_save_graph (dfa, "dfa.dot");
   GNUNET_REGEX_iterate_all_edges (dfa, key_iterator, NULL);
   GNUNET_REGEX_automaton_destroy (dfa);
-  dfa = GNUNET_REGEX_construct_dfa (regex1, strlen (regex1));
-  GNUNET_REGEX_automaton_save_graph (dfa, "dfa1.dot");
-  GNUNET_REGEX_automaton_destroy (dfa);
-  dfa = GNUNET_REGEX_construct_dfa (regex2, strlen (regex2));
-  GNUNET_REGEX_automaton_save_graph (dfa, "dfa2.dot");
-  GNUNET_REGEX_automaton_destroy (dfa);
 
   return error;
 }




reply via email to

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