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

Joel Brobecker
2010-08-30T14:15:11Z

> 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