bug-gnulib
[Top][All Lists]
Advanced

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

[PATCH] Use consistent style to check DEBUG macro in regex_internal.c


From: Siddhesh Poyarekar
Subject: [PATCH] Use consistent style to check DEBUG macro in regex_internal.c
Date: Fri, 1 Aug 2014 02:14:53 +0530
User-agent: Mutt/1.5.22.1-rc1 (2013-10-16)

Hi,

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.

Siddhesh

2014-07-31  Siddhesh Poyarekar  <address@hidden>

        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.

diff --git a/lib/regex_internal.c b/lib/regex_internal.c
index 79181a3..92d48b5 100644
--- a/lib/regex_internal.c
+++ b/lib/regex_internal.c
@@ -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

Attachment: pgpLhQ0QWhLTD.pgp
Description: PGP signature


reply via email to

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