[xml] Fixing *parser.c macros

Date view Thread view Subject view Author view

From: Wayne Davison (wayned@users.sourceforge.net)
Date: Mon Oct 23 2000 - 14:03:38 EDT


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.

..wayne..


----
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 : Mon Oct 23 2000 - 14:43:56 EDT