From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29842 invoked by alias); 30 Aug 2010 10:44:08 -0000 Received: (qmail 29828 invoked by uid 22791); 30 Aug 2010 10:44:06 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 30 Aug 2010 10:44:00 +0000 Received: (qmail 18246 invoked from network); 30 Aug 2010 10:43:58 -0000 Received: from unknown (HELO orlando.localnet) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 30 Aug 2010 10:43:58 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: [patch] Code cleanup: Make function typedef for find memory region Date: Mon, 30 Aug 2010 10:44:00 -0000 User-Agent: KMail/1.13.2 (Linux/2.6.33-29-realtime; KDE/4.4.2; x86_64; ; ) Cc: Jan Kratochvil References: <20100830085953.GA25961@host1.dyn.jankratochvil.net> In-Reply-To: <20100830085953.GA25961@host1.dyn.jankratochvil.net> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201008301143.55582.pedro@codesourcery.com> X-IsSubscribed: yes 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: 2010-08/txt/msg00503.txt.bz2 On Monday 30 August 2010 09:59:53, Jan Kratochvil wrote: > Hi, > > This is a code cleanup without any compiled code changes. > > Currently > int (*func) (CORE_ADDR, unsigned long, int, int, int, void *), > > is used on many places to find memory regions. Changing the prototype > requires even changes on places which would not have to be changed otherwise. > > I see I have chosen the *_t type name again, I suggest you don't use _t for this. Most of our function typedefs use the *_ftype prefix, a few _func, and only a couple _fn or _t. Try something like: $ grep -rn "_ftype)" * | grep -v ChangeLog | grep typedef | wc -l 155 $ grep -rn "_func)" * | grep -v ChangeLog | grep typedef | wc -l 15 ... So, I'd suggest something like: find_memory_regions_callback_ftype find_memory_regions_ftype find_memory_region_callback_ftype find_memory_region_ftype -- Pedro Alves