Article # 184, added by Geoworks, historical record
| first | previous | index | next | last |

C stub for ChunkArrayEnum has a bug.




The C version of ChunkArrayEnum() that shipped on GEOS 2.0 and 2.1
devices (Z-7000, Ensemble, Omni Go 100) had a bug.  This bug prevents
a callback function from being able to correctly referenced global
variables.  This is caused by the ds register not being properly
updated between calls to the callback function. 

For example, the following code may not work because "Test String" is 
(effectively) a global variable.  The second time MyCallBack is called, 
the pointer to "Test String" may instead point somewhere else. The 
workaround is not to use global variables.


@method MyProcessClass, MSG_MY_PROCESS_SEND {
    ...
    ChunkArrayEnumHandles( aBlock, theList, &theID, MyCallBack );
    ...
}

Boolean _pascal
MyCallBack( void * el,
            void * retVal )
{
    ...
    cmpResult = LocalCmpStrings( "Test String", el->field1, 0 );
    ...
}