Re: [RFC/RFA] add struct parse_context to all command functions

Tom Tromey
2008-10-28T17:52:29Z

>>>>> "Ulrich" == Ulrich Weigand <uweigand@de.ibm.com> writes:

Ulrich> This is OK, thanks!

Thanks -- I checked it in.

Ulrich> - As all the top-level val_print callers set deref_ref to 1, maybe the
Ulrich> default user_print_options should have that value, making most (all?)
Ulrich> of the explicit opts.deref_ref = 1 statements obsolete.

Ulrich> - Maybe the "size" argument (to the print_formatted routines) should
Ulrich> also move into the struct, together with "format"?

I'll look at these two.

Ulrich> - In some cases (e.g. print_subexp_standard) you have multiple instances
Ulrich> within the same function where a local "opts" variable is created;
Ulrich> maybe it would be clearer to have a common "opts" initialized once
Ulrich> for the whole function?

In a long function, like print_subexp_standard, I find it clearer to
have variables declared as locally as possible, because it is simpler
to see all the code referencing the local at once.

Tom