This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] Code cleanup: Make function typedef for find memory region
- From: Pedro Alves <pedro at codesourcery dot com>
- To: gdb-patches at sourceware dot org
- Cc: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- Date: Mon, 30 Aug 2010 11:43:55 +0100
- Subject: Re: [patch] Code cleanup: Make function typedef for find memory region
- References: <20100830085953.GA25961@host1.dyn.jankratochvil.net>
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