bug-gnulib
[Top][All Lists]
Advanced

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

FYI: regex_internal.c: avoid a warning


From: Jim Meyering
Subject: FYI: regex_internal.c: avoid a warning
Date: Fri, 15 Sep 2006 18:41:36 +0200

Since this file is already different from libc, this shouldn't hurt...

2006-09-15  Jim Meyering  <address@hidden>

        Avoid a warning about an unused variable.
        * regex_internal.c (re_dfa_add_node): Move declaration of "type"
        into the #ifdef block where it's used.

Index: regex_internal.c
===================================================================
RCS file: /sources/gnulib/gnulib/lib/regex_internal.c,v
retrieving revision 1.22
diff -u -r1.22 regex_internal.c
--- regex_internal.c    11 Aug 2006 18:28:44 -0000      1.22
+++ regex_internal.c    15 Sep 2006 16:39:39 -0000
@@ -1340,7 +1340,6 @@
 internal_function
 re_dfa_add_node (re_dfa_t *dfa, re_token_t token)
 {
-  int type = token.type;
   if (BE (dfa->nodes_len >= dfa->nodes_alloc, 0))
     {
       size_t new_nodes_alloc = dfa->nodes_alloc * 2;
@@ -1376,8 +1375,11 @@
   dfa->nodes[dfa->nodes_len] = token;
   dfa->nodes[dfa->nodes_len].constraint = 0;
 #ifdef RE_ENABLE_I18N
+  {
+  int type = token.type;
   dfa->nodes[dfa->nodes_len].accept_mb =
     (type == OP_PERIOD && dfa->mb_cur_max > 1) || type == COMPLEX_BRACKET;
+  }
 #endif
   dfa->nexts[dfa->nodes_len] = REG_MISSING;
   re_node_set_init_empty (dfa->edests + dfa->nodes_len);




reply via email to

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