Tidy coding questions

Dave,

This report is to draw your attention to a couple of coding oddities that I found with Tidy in translating it to the more strongly-typed Java.

(1) In parser.c ParseBody (line 2227) there is the following if statement:

                if (!node->tag->model & (CM_ROW | CM_FIELD))

    In C, the operator '!' has higher precedence than '&', furthermore,
    according to K & R, '!' converts a non-zero operand to 0 and 0 to 1.
    So, I doubt that this is what you intended.  Did you intend the following?

                if (!(node->tag->model & (CM_ROW | CM_FIELD)))

(2) In parser.c ParseDocument (line 2715) there is this function call:

        ParseHTML(lexer, html, no);

    But the prototype of ParseHTML is as follows:

        void ParseHTML(Lexer *lexer, Node *html, uint mode)

    Did you intend to pass IgnoreWhitespace (0) as the mode (since 'no' is
    the first element of the enum Bool).

Regards,

Andy Quick

Received on Saturday, 12 June 1999 15:30:38 UTC