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: -var-info-path-expression


On Sunday 28 January 2007 11:34, Nick Roberts wrote:
>  > > and propagate these changes back to struct language_specific so we have:
>  > > 
>  > > static char *
>  > > name_of_child (struct varobj *var, int index)
>  > > {
>  > >   return (char *) (*var->root->lang->describe_child) (CHILD_NAME, var, index);
>  > 
>  > And have casts from void* to the right type? I'm not sure that's any
>  > advantage.
> 
> Maybe using making a cast is as sinful as using a goto statement, I wouldn't
> know, but I would call having four times fewer functions an advantage.

"functions"? You mean having just one function pointer in language_specific? Yes,
I agree that would be superiour and I plan to make such a change, separately.

> Perhaps it would be better to use a macro e.g
> 
> #define name_of_child(var, index)   \
> (char *) (*var->root->lang->describe_child) (CHILD_NAME, var, index)

I'm not sure, I don't quite see reason to introduce macros if we can 
avoid them.

- Volodya




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