From patchwork Wed Apr 30 17:08:23 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Ellcey X-Patchwork-Id: 764 X-Patchwork-Delegate: carlos@redhat.com Return-Path: X-Original-To: siddhesh@wilcox.dreamhost.com Delivered-To: siddhesh@wilcox.dreamhost.com Received: from homiemail-mx20.g.dreamhost.com (mx2.sub5.homie.mail.dreamhost.com [208.113.200.128]) by wilcox.dreamhost.com (Postfix) with ESMTP id 3426C360072 for ; Wed, 30 Apr 2014 10:08:33 -0700 (PDT) Received: by homiemail-mx20.g.dreamhost.com (Postfix, from userid 14307373) id DD3264135F288; Wed, 30 Apr 2014 10:08:32 -0700 (PDT) X-Original-To: glibc@patchwork.siddhesh.in Delivered-To: x14307373@homiemail-mx20.g.dreamhost.com 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 homiemail-mx20.g.dreamhost.com (Postfix) with ESMTPS id B355141362A14 for ; Wed, 30 Apr 2014 10:08:32 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:subject:from:to:cc:date:in-reply-to :references:content-type:content-transfer-encoding:mime-version; q=dns; s=default; b=Zb9d1OUYVCfHciVL5Fl4zxQ40IJ3wnvW/3XjO5tuoAz 6H2jBtUc0woI+MaUyG8HAQ/fy948OqEwoDXwAg2mllwZyQ9CofohQ31htQTFAeqY nxdPBmnVHUceoVIgEx54IiwJcPj7yk38Xydr7m7yEWy4+hxTYGnFey0UjluLMw5g = 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:message-id:subject:from:to:cc:date:in-reply-to :references:content-type:content-transfer-encoding:mime-version; s=default; bh=bQgFSgvCjL/drr+BF8eLK0eNXZ0=; b=dg4RwEdaZTjqjy8tE nqF4PdgB5e2DirVT/JTGqyyuk9HOm+5pm03ZBFShuPRyWnlRaVCMot/HcAlZrQPn RvpCIb2VfBbh5+M7ACiP5AJFDS0uMQ6n5CCu7gJEZEp/I98VK/YaywHwfMFdnu88 7G0SYE11/lbPWmiVn0ympT5/7E= Received: (qmail 26571 invoked by alias); 30 Apr 2014 17:08:31 -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 26561 invoked by uid 89); 30 Apr 2014 17:08:30 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mailapp01.imgtec.com Message-ID: <1398877703.5201.10.camel@ubuntu-sellcey> Subject: Re: [Patch] Fix ONE_DIRECTION undef warnings. From: Steve Ellcey To: Carlos O'Donell CC: Roland McGrath , Date: Wed, 30 Apr 2014 10:08:23 -0700 In-Reply-To: <5360162B.90303@redhat.com> References: <20140428174126.18CE02C3A00@topped-with-meat.com> <535FFE81.4060104@redhat.com> <1398802315.14541.48.camel@ubuntu-sellcey> <5360162B.90303@redhat.com> MIME-Version: 1.0 X-DH-Original-To: glibc@patchwork.siddhesh.in On Tue, 2014-04-29 at 17:14 -0400, Carlos O'Donell wrote: > Lastly, I hope that we can all agree that: > > #ifndef ONE_DIRECTION > #define ONE_DIRECTION > #endif > > Isn't quite what we want since it silently accepts a particular > configuration. We also didn't do a good job of documenting this > particular default :-( OK, Here is a new (partial) patch for the undef's involving ONE_DIRECTION. It undoes my earlier patch and includes defines of ONE_DIRECTION in gconv_simple.c, 8bit-generic.c, and 8bit-generic.c. This does not fix all the warnings involving ONE_DIRECTION but it gets rid of several hundred and I would like to get this approved and checked in before attacking the rest. Unfortunately, it looks like fixing the remaining 100 undefs will require one line fixes to 100 different files in iconvdata all of which include skeleton.c. OK to check this in? Steve Ellcey sellcey@mips.com 2014-04-30 Steve Ellcey * intl/iconv/skeleton.c (ONE_DIRECTION): Remove define. * iconv/gconv_simple.c (ONE_DIRECTION): Define. * iconvdata/8bit-gap.c (ONE_DIRECTION): Ditto. * iconvdata/8bit-generic.c (ONE_DIRECTION): Ditto. diff --git a/iconv/gconv_simple.c b/iconv/gconv_simple.c index f357713..4ed4505 100644 --- a/iconv/gconv_simple.c +++ b/iconv/gconv_simple.c @@ -68,6 +68,7 @@ __gconv_btwoc_ascii (struct __gconv_step *step, unsigned char c) #define FROM_LOOP internal_ucs4_loop #define TO_LOOP internal_ucs4_loop /* This is not used. */ #define FUNCTION_NAME __gconv_transform_internal_ucs4 +#define ONE_DIRECTION 0 static inline int @@ -222,6 +223,7 @@ internal_ucs4_loop_single (struct __gconv_step *step, #define FROM_LOOP ucs4_internal_loop #define TO_LOOP ucs4_internal_loop /* This is not used. */ #define FUNCTION_NAME __gconv_transform_ucs4_internal +#define ONE_DIRECTION 0 static inline int @@ -433,6 +435,7 @@ ucs4_internal_loop_single (struct __gconv_step *step, #define FROM_LOOP internal_ucs4le_loop #define TO_LOOP internal_ucs4le_loop /* This is not used. */ #define FUNCTION_NAME __gconv_transform_internal_ucs4le +#define ONE_DIRECTION 0 static inline int @@ -590,6 +593,7 @@ internal_ucs4le_loop_single (struct __gconv_step *step, #define FROM_LOOP ucs4le_internal_loop #define TO_LOOP ucs4le_internal_loop /* This is not used. */ #define FUNCTION_NAME __gconv_transform_ucs4le_internal +#define ONE_DIRECTION 0 static inline int diff --git a/iconv/skeleton.c b/iconv/skeleton.c index 1908949..73dc186 100644 --- a/iconv/skeleton.c +++ b/iconv/skeleton.c @@ -163,11 +163,6 @@ # endif #endif -#ifndef ONE_DIRECTION -# define ONE_DIRECTION 0 -#endif - - /* How many bytes are needed at most for the from-charset. */ #ifndef MAX_NEEDED_FROM # define MAX_NEEDED_FROM MIN_NEEDED_FROM diff --git a/iconvdata/8bit-gap.c b/iconvdata/8bit-gap.c index b33a6ea..3bd7149 100644 --- a/iconvdata/8bit-gap.c +++ b/iconvdata/8bit-gap.c @@ -42,6 +42,7 @@ struct gap #define DEFINE_FINI 1 #define MIN_NEEDED_FROM 1 #define MIN_NEEDED_TO 4 +#define ONE_DIRECTION 0 /* First define the conversion function from the 8bit charset to UCS4. */ diff --git a/iconvdata/8bit-generic.c b/iconvdata/8bit-generic.c index 20066aa..efc0fd5 100644 --- a/iconvdata/8bit-generic.c +++ b/iconvdata/8bit-generic.c @@ -26,6 +26,7 @@ #define DEFINE_FINI 1 #define MIN_NEEDED_FROM 1 #define MIN_NEEDED_TO 4 +#define ONE_DIRECTION 0 /* First define the conversion function from the 8bit charset to UCS4. */