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


> 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 think we should generalize this idea and use function types whenever
possible. Using a function type, for instance, makes it easier for
someone to find the description of that function.  I had that problem
recently, and it took me a long time to find what I was looking for.

I also believe that we should explicitly name the parameters in the
function type declaration.  I think this is important, because I think
that this practice would have helped prevent an unfortunate regression
(filename/fullname confusion in MI command). We should name the parameters
so that we know which parameter is what.  And that also helps IMO writing
the function description.

-- 
Joel


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