From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24374 invoked by alias); 29 Nov 2002 05:04:17 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 24361 invoked from network); 29 Nov 2002 05:04:16 -0000 Received: from unknown (HELO mta02bw.bigpond.com) (144.135.24.138) by sources.redhat.com with SMTP; 29 Nov 2002 05:04:16 -0000 Received: from bubble.local ([144.135.24.78]) by mta02bw.bigpond.com (Netscape Messaging Server 4.15 mta02bw Jul 16 2002 22:47:55) with SMTP id H6BNF200.8DJ for ; Fri, 29 Nov 2002 15:04:14 +1000 Received: from CPE-144-136-184-243.sa.bigpond.net.au ([144.136.184.243]) by bwmam04.mailsvc.email.bigpond.com(MailRouter V3.0n 35/12576189); 29 Nov 2002 15:04:36 Received: (qmail 14920 invoked by uid 179); 29 Nov 2002 05:04:13 -0000 Date: Thu, 28 Nov 2002 21:04:00 -0000 From: Alan Modra To: binutils@sources.redhat.com, gdb@sources.redhat.com Subject: Re: [RFA] Replace strdup with xstrdup in tic30-dis.c Message-ID: <20021129050413.GI949@bubble.sa.bigpond.net.au> Mail-Followup-To: binutils@sources.redhat.com, gdb@sources.redhat.com References: <20021128223919.GG949@bubble.sa.bigpond.net.au> <3DE6A57E.9020704@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3DE6A57E.9020704@redhat.com> User-Agent: Mutt/1.4i X-SW-Source: 2002-11/txt/msg00422.txt.bz2 On Thu, Nov 28, 2002 at 06:23:42PM -0500, Andrew Cagney wrote: > >OK, OK. :) "typedef int bfd_boolean" it is. Plain 0 and 1 for values. > > You ment 0 and !0 right? :-^ Actually, having started to do the edit, I'm having second thoughts about using plain old 0 and 1. I think I'll use FALSE and TRUE, and #undef and #define these macros in bfd-in.h. Besides being consistent with a "boolean" type, it means less formatting changes. Anyone have any objections? A whinge. This style of function declaration is a pain: boolean function_with_a_long_name_or_lots_of_params PARAMS ((type1 arg1, type2 arg2, typen argn)); This is much better: boolean function_with_a_long_name_or_lots_of_params PARAMS ((type1 arg1, type2 arg2, typen argn)); The first style means more editing when changing the return type or function name as all the following lines need re-indenting. Same goes for definitions. This is a pain: int some_func (a, b, c) boolean a; all_lined_up_sweetly * b; int c; Writing code this way almost guarantees that over time your code will end up looking like: int some_func (a, b, c) bfd_boolean a; not_lined_up * b; int c; Ditto local vars. -- Alan Modra IBM OzLabs - Linux Technology Centre