From owner-svn-src-all@FreeBSD.ORG Mon Nov 5 22:31:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 43071D6E; Mon, 5 Nov 2012 22:31:26 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) by mx1.freebsd.org (Postfix) with ESMTP id CF8388FC14; Mon, 5 Nov 2012 22:31:24 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 3C026358C61; Mon, 5 Nov 2012 23:31:23 +0100 (CET) Received: by snail.stack.nl (Postfix, from userid 1677) id 27CE62848C; Mon, 5 Nov 2012 23:31:23 +0100 (CET) Date: Mon, 5 Nov 2012 23:31:23 +0100 From: Jilles Tjoelker To: Pawel Jakub Dawidek Subject: Re: svn commit: r242620 - head/bin/sh Message-ID: <20121105223122.GA67582@stack.nl> References: <201211051752.qA5HqI6m050154@svn.freebsd.org> <20121105213448.GA1399@garage.freebsd.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20121105213448.GA1399@garage.freebsd.pl> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2012 22:31:26 -0000 On Mon, Nov 05, 2012 at 10:34:48PM +0100, Pawel Jakub Dawidek wrote: > On Mon, Nov 05, 2012 at 05:52:18PM +0000, Jilles Tjoelker wrote: > > Author: jilles > > Date: Mon Nov 5 17:52:18 2012 > > New Revision: 242620 > > URL: http://svnweb.freebsd.org/changeset/base/242620 > > Log: > > sh: Change cmdtype in tblentry from short to signed char. > > If this is a smaller type than int anyway, we can make it the smallest > > possible. > > Modified: > > head/bin/sh/exec.c > > Modified: head/bin/sh/exec.c > > ============================================================================== > > --- head/bin/sh/exec.c Mon Nov 5 17:50:40 2012 (r242619) > > +++ head/bin/sh/exec.c Mon Nov 5 17:52:18 2012 (r242620) > > @@ -85,7 +85,7 @@ struct tblentry { > > struct tblentry *next; /* next entry in hash chain */ > > union param param; /* definition of builtin function */ > > int special; /* flag for special builtin commands */ > > - short cmdtype; /* index identifying command */ > > + signed char cmdtype; /* index identifying command */ > Why not simply 'char'? Because 'char' may be signed or unsigned depending on architecture and we store the value -1 in it (CMDUNKNOWN). In particular, on ARM 'char' is unsigned. -- Jilles Tjoelker