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: [RFA] Cleanup: constify struct linespec


>>>>> "Keith" == Keith Seitz <keiths@redhat.com> writes:

Keith> 2012-07-17  Keith Seitz  <keiths@redhat.com>
Keith> 	* linespec.c (struct linespec): Constify expression,
Keith> 	source_filename, function_name, and label_name.
Keith> 	(symbol_not_found_error): Make all parameters const.
Keith> 	(linespec_parser_delete): No need to check for NULL
Keith> 	when using xfree. Cast const char * to char * for xfree.

Ok.

FWIW I generally don't like casts like this:

+  xfree ((char *) PARSER_RESULT (parser)->expression);

... but in this case I agree that constifying the struct outweighs this.

Tom


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