I've written an application that appears to run correctly on M68K Palm devices
ranging from a Palm IIIe to much newer systems as well as emulator on Windows.
It was compiled with the gcc 68k compiler that is part of the new release of
Palm OS Developer Suite using the Palm OS SDK version 4.0.
When the application is run on an ARM-powered device (Tungsten T2 and E models)
it hangs when an entry is selected in a certain pop-up list.
The popSelectEvent is handled with the following code.
struct SizeData {
UInt16 flags;
Char *name;
long int size;
};
struct SizeData sizes[] = { /* complete initialization */ };
int iSize;
Int16 i;
enum EquipType {A, B, C, D} equipType;
switch (eventP->eType) {
case popSelectEvent:
switch (eventP->data.popSelect.listID) {
case ID_DRIVE_SIZE:
iSize = -1;
for (i = eventP->data.popSelect.selection; i>=0; i--)
while ((sizes[++iSize].flags&1<<equipType)==0) ;
Calculate();
break;
/* other cases */ }
}
When this code is executed, equipType must alread be set to one of its enum
values (0-3). The initialization of the sizes[] array ensures that each flags
member has one or more of the low-order four bits set.
Bearing in mind that this code works correctly on M68K-powered Palm systems, on
the Emulator, and on the Windows and WindowsCE platforms from which it was
ported, is it possible that the emulator in the ARM-powered Palm doesn't
execute it properly? I can
see how it might loop forever if it somehow failed to increment iSize in the
while loop.
Norm
--
For information on using the Palm Developer Forums, or to unsubscribe, please
see http://www.palmos.com/dev/support/forums/