Re: Crash/Freeze in Xcode debugger w/infinite loop
Re: Crash/Freeze in Xcode debugger w/infinite loop
- Subject: Re: Crash/Freeze in Xcode debugger w/infinite loop
- From: Eric Albert <email@hidden>
- Date: Mon, 24 Apr 2006 20:20:04 +0200
On Apr 23, 2006, at 12:53 PM, Trygve Inda wrote:
I was able to cause Xcode 2.2.1 to freeze with this code:
OSStatus DB_CallbackEndianFlip (OSType dataDomain, OSType dataType,
short
id, void *dataPtr, UInt32 dataSize, Boolean isNative, void *refcon)
{
UInt32 count = dataSize >> 2; // number of 4-byte elements
while (--count >= 0) ((long *)dataPtr)[count] = isNative ?
EndianS32_NtoB (((long *)dataPtr)[count]) :
EndianS32_BtoN (((long *)dataPtr)[count]);
return (noErr);
}
Just a quick note here that you don't need the isNative check.
Instead, I'd suggest this:
UInt32 count = dataSize >> 2;
long *longPtr = (long *) dataPtr;
for(int i = 0; i < count; i++) {
longPtr[i] = Endian32_Swap(longPtr[i]);
}
return noErr;
Hope this helps,
Eric
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden