This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Code cleanup: Make function typedef for find memory region


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]