CCDICT_FOREACH macro bug report

Hello,

I think I have found a bug in CCDICT_FOREACH macro. Here’s what’s happening:

When I have a dictionary which has other dictionaries inside e.g. “package.plist” has dictionaries inside like: “textures”, “sounds”, “stringTables” etc. and each of them has got several keys that I want to read, the 1st time I use the CCDICT_FOREACH to read all keys from any of the sub-dicts e.g. “textures” everything is working as it should. When I use CCDICT_FOREACH macro again (after reading “textures” keys) on other sub-dict e.g. “sounds” the 1st CCDictElement returned is NULL even though that valid element does exist.

Something is wrong with the macro, since when I used the same “raw” code from that macro everything works fine:

//———— WORKS FINE:

CCDictionary* currentDict = static_cast<CCDictionary*>(desc~~>objectForKey);
CCDictElement* el = NULL;
CCDictElement* tmp = NULL;
CCDictElement* head = currentDict~~>m_pElements;

for(el=head,tmp=DECLTYPE (el)(head?head~~>hh.next:NULL); el; el=tmp,tmp=DECLTYPE )
{
//this WORKS FINE! el ptr is valid
}
//———— NOT working~~ BROKEN:

CCDictionary* currentDict = static_cast<CCDictionary*>(desc->objectForKey(“sounds”));
CCDictElement* el = NULL;
CCDICT_FOREACH(currentDict, el)
{
//BROKEN! el == NULL on 2nd sub-dictionary
}

Kind Regards,

Pawel