]> Savannah Git Hosting - gnulib.git/commitdiff
Use consistent style to check DEBUG macro in regex_internal.c
authorSiddhesh Poyarekar <siddhesh@redhat.com>
Fri, 1 Aug 2014 02:04:42 +0000 (07:34 +0530)
committerSiddhesh Poyarekar <siddhesh@redhat.com>
Fri, 1 Aug 2014 02:07:45 +0000 (07:37 +0530)
The DEBUG macro is checked using both #if and #ifdef in
regex_internal.c.  Make this consistent with mktime, where we use "#if
defined DEBUG && DEBUG", to be compatible with gnulib as well as glibc
style.

        regex: Make #if/#ifdef usage consistent for DEBUG
        * lib/regex_internal.c: Use "#if defined DEBUG && DEBUG" instead
        of the inconsistent usage of #if and #ifdef as that works with
        both Glibc and Gnulib's style.

ChangeLog
lib/regex_internal.c

index 1fbf438015bc10b35dc9e4bcb3506ae251cd4888..59ce3dcca297522c27dbf9bb12fc3c7813a6d1d2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2014-08-01  Siddhesh Poyarekar  <siddhesh@redhat.com>
+
+       regex: Make #if/#ifdef usage consistent for DEBUG
+       * lib/regex_internal.c: Use "#if defined DEBUG && DEBUG" instead
+       of the inconsistent usage of #if and #ifdef as that works with
+       both Glibc and Gnulib's style.
+
 2014-07-31  Eric Blake  <eblake@redhat.com>
 
        openat-die: use _Noreturn markup
index 79181a331490f42b547e28954b1e7217097f9546..92d48b523254f2c7900d0dd4e192f2cb390e8d05 100644 (file)
@@ -677,7 +677,7 @@ re_string_reconstruct (re_string_t *pstr, Idx idx, int eflags)
                         pstr->valid_len - offset);
              pstr->valid_len -= offset;
              pstr->valid_raw_len -= offset;
-#if DEBUG
+#if defined DEBUG && DEBUG
              assert (pstr->valid_len > 0);
 #endif
            }
@@ -936,7 +936,7 @@ re_string_context_at (const re_string_t *input, Idx idx, int eflags)
       Idx wc_idx = idx;
       while(input->wcs[wc_idx] == WEOF)
        {
-#ifdef DEBUG
+#if defined DEBUG && DEBUG
          /* It must not happen.  */
          assert (REG_VALID_INDEX (wc_idx));
 #endif