This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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/libiberty]: Rewrite of ada_demangle


> include/
> 2009-12-09 ?Tristan Gingold ?<gingold@adacore.com>
>
> ? ? ? ?* demangle.h (ada_demangle): Add prototype.
>
> libiberty/
> 2009-12-09 ?Tristan Gingold ?<gingold@adacore.com>
>
> ? ? ? ?* cplus-dem.c (ada_demangle): Remove prototype.
> ? ? ? ?(grow_vect): Removed.
> ? ? ? ?(ada_demangle): Rewritten.
> ? ? ? ?(cplus_demangle): Fix indentation.
> ? ? ? ?* testsuite/demangle-expected: Add tests for Ada.



> + ? ? ? ? ? ? ?int l = strlen (operators[k][0]);
> + ? ? ? ? ? ? ?if (!strncmp (p, operators[k][0], l))

Please write strncmp (p, operators[k][0], l) == 0.

The variable name "l" may be confusing in a code sequence which also
uses "1".  You may want to consider renaming the variable to be "len"
or something along those lines.

> + ? ? ? ? ?/* Operator not found. ?*/
> + ? ? ? ? ?if (!operators[k][0])
> + ? ? ? ? ? ?goto unknown;

Please write operators[k][0] == NULL.

This is OK with those changes, assuming it passes a gcc bootstrap.

Thanks.

Ian


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