W3C home > Mailing lists > Public > www-lib@w3.org > July to September 2000

Bug in HTArray.h

From: Olaf Walkowiak <olaf@sevenval.de>
Date: Tue, 15 Aug 2000 12:44:36 +0200
To: www-lib@w3.org
Message-ID: <20000815124436.A4098@thor.office.sevenval.de>
Hello,

there is a little flaw in HTArray.h:

#define HTArray_firstObject(me, data) \
        ((me) && ((data)=(me)->data) ? *(data)++ : NULL)
#define HTArray_nextObject(me, data) \
        ((me) && (data) ? *(data)++ : NULL)


If you use another name for "data", f.e. :

foo = HTArray_firstObject(pool->pointers, bar);

you get the error message "Structure has no member named bar", since
(me)->data will be replaced by bar->bar, not bar->data.

This will fix it:


#define HTArray_firstObject(me, _data) \
	((me) && ((_data)=(me)->data) ? *(_data)++ : NULL)
#define HTArray_nextObject(me, _data) \
	((me) && (_data) ? *(_data)++ : NULL)

CU
Olaf

-- 
Received on Tuesday, 15 August 2000 06:44:47 GMT

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