From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22187 invoked by alias); 4 Jul 2011 18:09:21 -0000 Received: (qmail 22179 invoked by uid 22791); 4 Jul 2011 18:09:21 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 04 Jul 2011 18:09:07 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 432BB2BB209; Mon, 4 Jul 2011 14:09:07 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id sjkhZyExubsc; Mon, 4 Jul 2011 14:09:07 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 1A7272BB207; Mon, 4 Jul 2011 14:09:06 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id DAE7E145615; Mon, 4 Jul 2011 11:09:02 -0700 (PDT) Date: Mon, 04 Jul 2011 18:12:00 -0000 From: Joel Brobecker To: Andrew Burgess Cc: "gdb-patches@sourceware.org" Subject: Re: [PATCH] Display var_zinteger as signed Message-ID: <20110704180902.GO2407@adacore.com> References: <4E11976B.9030100@broadcom.com> <4E11A672.5020808@broadcom.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4E11A672.5020808@broadcom.com> User-Agent: Mutt/1.5.20 (2009-06-14) Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-07/txt/msg00103.txt.bz2 > 2011-07-04 Andrew Burgess > > * cli/cli-setshow.c (do_setshow_command): Display var_zinteger > variables as signed, not unsigned. I'm not a fan of fall throughs, like this, because I think it makes the code harder to read, but if no other maintainer has an objection to it, then the patch is OK (please wait for a couple of days to give everyone else a little time to comment on this). > case var_integer: > if (*(int *) c->var == INT_MAX) > { > fputs_filtered ("unlimited", stb->stream); > + break; > } > - else > - fprintf_filtered (stb->stream, "%d", *(int *) c->var); > + /* else fall through */ > + case var_zinteger: > + fprintf_filtered (stb->stream, "%d", *(int *) c->var); > break; I'd personally write this: case var_integer: case var_zinteger: if (c->var_type == var_integer && *(int *) c->var == INT_MAX) fputs_filtered ("unlimited", stb->stream); else fprintf_filtered (stb->stream, "%d", *(int *) c->var); -- Joel