Re: [xml] Fixing *parser.c macros

Date view Thread view Subject view Author view

From: Daniel Veillard (Daniel.Veillard@w3.org)
Date: Tue Oct 24 2000 - 04:35:40 EDT


On Mon, Oct 23, 2000 at 11:03:38AM -0700, Wayne Davison wrote:
> There are a number of problems with the macros in the *parser.c files.
> Several of them have trailing ';'s, which cause an extra (empty) statement
> to be included in the code (which can cause problems before an "else", for
> instance). Quite a few of them have multiple statements, and one such
> macro (NEXT) got used in such a way as to dribble an extra statement past
> the control of an "if" or a "while" (in {HTML,SGML}parser.c, but not
> parser.c).
>
> The appended patch removes trailing semi-colons, uses a comma in the bogus
> version of the NEXT macro, and wraps up other more complex multi-statement
> macros using this idiom:
>
> do { multi; statements; here; } while (0)
>
> This allows the macros to be used anywhere a single statement is valid.

  Okay, this looks good ! I applied it,

  thanks for the patch,

Daniel

-- 
Daniel.Veillard@w3.org | W3C, INRIA Rhone-Alpes  | libxml Gnome XML toolkit
Tel : +33 476 615 257  | 655, avenue de l'Europe | http://xmlsoft.org/
Fax : +33 476 615 207  | 38330 Montbonnot FRANCE | Rpmfind search site
 http://www.w3.org/People/all#veillard%40w3.org  | http://rpmfind.net/
----
Message from the list xml@rpmfind.net
Archived at : http://xmlsoft.org/messages/
to unsubscribe: echo "unsubscribe xml" | mail  majordomo@rpmfind.net


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Tue Oct 24 2000 - 04:44:51 EDT