W3C home > Mailing lists > Public > www-lib@w3.org > January to March 2000

Patch for the HTArray_firstObject() macro

From: Wayne Davison <wayne@clari.net>
Date: Thu, 2 Mar 2000 15:44:29 -0800 (PST)
To: www-lib@w3.org
Message-ID: <Pine.GSO.4.10.10003021532390.24691-100000@house.clari.net>
The HTArray_firstObject() macro is defined such that if you don't
use a variable named exactly "data" as the second parameter, you get
a syntax error (because of the reference to the "data" name in the
structure).

I suggest changing the variable in the define from "data" to "dp".
Here's a patch for the HTArray.html file:

--- HTArray.html	Wed May 13 19:10:14 1998
+++ HTArray.html.new	Thu Mar  2 15:43:41 2000
@@ -82,10 +82,10 @@
 Fast macros to traverse a macro ending in a NULL element.
 
 <PRE>
-#define HTArray_firstObject(me, data) \
-	((me) &amp;&amp; ((data)=(me)-&gt;data) ? *(data)++ : NULL)
-#define HTArray_nextObject(me, data) \
-	((me) &amp;&amp; (data) ? *(data)++ : NULL)
+#define HTArray_firstObject(me, dp) \
+	((me) &amp;&amp; ((dp)=(me)-&gt;data) ? *(dp)++ : NULL)
+#define HTArray_nextObject(me, dp) \
+	((me) &amp;&amp; (dp) ? *(dp)++ : NULL)
 </PRE>
 
 <H2>Sort an Array</H2>

..wayne..
Received on Thursday, 2 March 2000 18:44:34 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 23 April 2007 18:18:35 GMT