From patchwork Thu Jul 31 20:41:56 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siddhesh Poyarekar X-Patchwork-Id: 375423 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id DCA21140140 for ; Fri, 1 Aug 2014 06:42:09 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:mime-version :content-type; q=dns; s=default; b=bV+2GUpPIRwO6rTBl9PGrmieXeXQe kfZYLu/+cOyIGupUauoTqPEyKmNHdq00KWBJfMxnbHoMu4U/RDBDKkezN3P427u2 39xZYHPkF4esh+7WB8EmWGAiRUGYbN7MnZUgb2ChcfHkkjoufAzey7zoSHcI8g9w MwAZ3ahGabVqMM= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:mime-version :content-type; s=default; bh=WpqfX3WRcoYMrPwTqp6XKuT5y24=; b=MmP 3X8ShMEaqlc3mICo+UhZH4sF2T1NxcD6vNSte2Nw9fgIu8LBfGyVGvUeLfUfQWHk tznKX0/4Q23kwDQHDjXHlmnVo6yuvcu6gNQ/Ustd7VPC4t8ZE0zm3pfN5TAdJxCO up2FG86cnfie31452wE4cJH72euO/awi08fPC2bQ= Received: (qmail 4789 invoked by alias); 31 Jul 2014 20:42:04 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 4778 invoked by uid 89); 31 Jul 2014 20:42:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.8 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Date: Fri, 1 Aug 2014 02:11:56 +0530 From: Siddhesh Poyarekar To: libc-alpha@sourceware.org Subject: [PATCH] Check if DEBUG is defined in regex_internal.h Message-ID: <20140731204156.GN16739@spoyarek.pnq.redhat.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.22.1-rc1 (2013-10-16) Hi, The DEBUG macro is checked for its value in one place and if it is defined in another. Make this consistent across the two cases and use the same style that we did in mktime.c, which is to check if the macro is defined and it is set. Siddhesh * posix/regex_internal.c: Check if DEBUG is defined and is set. diff --git a/posix/regex_internal.c b/posix/regex_internal.c index 7eebf46..86c04a8 100644 --- a/posix/regex_internal.c +++ b/posix/regex_internal.c @@ -679,7 +679,7 @@ re_string_reconstruct (re_string_t *pstr, int 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, int idx, int eflags) int wc_idx = idx; while(input->wcs[wc_idx] == WEOF) { -#ifdef DEBUG +#if defined DEBUG && DEBUG /* It must not happen. */ assert (wc_idx >= 0); #endif