gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r37695 - gnunet/src/regex
Date: Thu, 11 Aug 2016 14:49:31 +0200

Author: grothoff
Date: 2016-08-11 14:49:31 +0200 (Thu, 11 Aug 2016)
New Revision: 37695

Modified:
   gnunet/src/regex/regex_internal.c
Log:
-fix more shift errors

Modified: gnunet/src/regex/regex_internal.c
===================================================================
--- gnunet/src/regex/regex_internal.c   2016-08-10 18:06:27 UTC (rev 37694)
+++ gnunet/src/regex/regex_internal.c   2016-08-11 12:49:31 UTC (rev 37695)
@@ -606,6 +606,8 @@
     return -1;
   if (s1->slen != s2->slen)
     return -1;
+  if (0 == s1->slen)
+    return 0;
   return memcmp (s1->sbuf, s2->sbuf, s1->slen);
 }
 
@@ -624,6 +626,8 @@
 {
   if (s1->slen != s2->slen)
     return -1;
+  if (0 == s1->slen)
+    return 0;
   return memcmp (s1->sbuf, s2->sbuf, s1->slen);
 }
 
@@ -2011,7 +2015,7 @@
           (!s1->accepting && s2->accepting) )
       {
        idx = (unsigned long long) s1->marked * state_cnt + s2->marked;
-        table[idx / 32] |= (1 << (idx % 32));
+        table[idx / 32] |= (1U << (idx % 32));
       }
 
   /* Find all equal states */
@@ -2024,7 +2028,7 @@
       for (s2 = a->states_head; NULL != s2 && s1 != s2; s2 = s2->next)
       {
        idx = (unsigned long long) s1->marked * state_cnt + s2->marked;
-        if (0 != (table[idx / 32] & (1 << (idx % 32))))
+        if (0 != (table[idx / 32] & (1U << (idx % 32))))
           continue;
         num_equal_edges = 0;
         for (t1 = s1->transitions_head; NULL != t1; t1 = t1->next)
@@ -2040,9 +2044,9 @@
                idx1 = (unsigned long long) t1->to_state->marked * state_cnt + 
t2->to_state->marked;
              else
                idx1 = (unsigned long long) t2->to_state->marked * state_cnt + 
t1->to_state->marked;
-             if (0 != (table[idx1 / 32] & (1 << (idx1 % 32))))
+             if (0 != (table[idx1 / 32] & (1U << (idx1 % 32))))
              {
-               table[idx / 32] |= (1 << (idx % 32));
+               table[idx / 32] |= (1U << (idx % 32));
                change = 1; /* changed a marker, need to run again */
              }
            }
@@ -2052,7 +2056,7 @@
             (num_equal_edges != s2->transition_count) )
         {
           /* Make sure ALL edges of possible equal states are the same */
-         table[idx / 32] |= (1 << (idx % 32));
+         table[idx / 32] |= (1U << (idx % 32));
          change = 1;  /* changed a marker, need to run again */
         }
       }
@@ -2067,7 +2071,7 @@
     {
       s2_next = s2->next;
       idx = (unsigned long long) s1->marked * state_cnt + s2->marked;
-      if (0 == (table[idx / 32] & (1 << (idx % 32))))
+      if (0 == (table[idx / 32] & (1U << (idx % 32))))
         automaton_merge_states (ctx, a, s1, s2);
     }
   }




reply via email to

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