- From: Wayne Davison <wayne@clari.net>
- Date: Sun, 6 Aug 2000 20:55:16 -0700 (PDT)
- To: www-lib@w3.org
Back on March 2nd, I sent in a patch for the HTArray_firstObject() macro that was not applied to the code. Here it is again (with a slightly enhanced explanation). The HTArray_firstObject() macro is defined such that if the caller doesn't pass in a variable named exactly "data" as the second parameter, there will either be a syntax error generated during the compilation OR the wrong structure element will get referenced. This is because the macro argument "data" is the same name as the HTArray structure element that is being referenced in the macro. I suggest changing the macro argument from "data" to "dp". Here's a patch for the HTArray.html file: --- HTArray.html 1998/05/14 02:10:14 2.7 +++ HTArray.html 2000/03/02 22:43:41 @@ -82,10 +82,10 @@ Fast macros to traverse a macro ending in a NULL element. <PRE> -#define HTArray_firstObject(me, data) \ - ((me) && ((data)=(me)->data) ? *(data)++ : NULL) -#define HTArray_nextObject(me, data) \ - ((me) && (data) ? *(data)++ : NULL) +#define HTArray_firstObject(me, dp) \ + ((me) && ((dp)=(me)->data) ? *(dp)++ : NULL) +#define HTArray_nextObject(me, dp) \ + ((me) && (dp) ? *(dp)++ : NULL) </PRE> <H2>Sort an Array</H2> ..wayne..
Received on Sunday, 6 August 2000 23:55:26 UTC