diff --git a/macosx/Pcsxr-QL/PSXMemEnumerator.m b/macosx/Pcsxr-QL/PSXMemEnumerator.m index b5545da2..4cba0ef7 100644 --- a/macosx/Pcsxr-QL/PSXMemEnumerator.m +++ b/macosx/Pcsxr-QL/PSXMemEnumerator.m @@ -156,7 +156,7 @@ NSArray *CreateArrayByEnumeratingMemoryCardAtURL(NSURL *location) i++; continue; } - do { + while (i + x < MAX_MEMCARD_BLOCKS) { McdBlock tmpBlock; GetSoloBlockInfo((unsigned char *)memPtr, i + x + 1, &tmpBlock); if ((tmpBlock.Flags & 0x3) == 0x3) { @@ -167,7 +167,7 @@ NSArray *CreateArrayByEnumeratingMemoryCardAtURL(NSURL *location) } else { break; } - } while (i + x - 1 < MAX_MEMCARD_BLOCKS); + }; PcsxrMemoryObject *obj = [[PcsxrMemoryObject alloc] initWithMcdBlock:&memBlock startingIndex:i size:x]; i += x; if (MemBlockFlag(memBlock.Flags) == memFlagDeleted) { diff --git a/macosx/Psx-Memcard/GetMetadataForFile.m b/macosx/Psx-Memcard/GetMetadataForFile.m index 41e0e224..78adda93 100644 --- a/macosx/Psx-Memcard/GetMetadataForFile.m +++ b/macosx/Psx-Memcard/GetMetadataForFile.m @@ -172,7 +172,7 @@ Boolean GetMetadataForFile(void *thisInterface, CFMutableDictionaryRef attribute i++; continue; } - do { + while (i + x < MAX_MEMCARD_BLOCKS) { McdBlock tmpBlock; GetSoloBlockInfo((unsigned char *)fileCData, i + x + 1, &tmpBlock); if ((tmpBlock.Flags & 0x3) == 0x3) { @@ -183,7 +183,7 @@ Boolean GetMetadataForFile(void *thisInterface, CFMutableDictionaryRef attribute } else { break; } - } while (i + x - 1 < MAX_MEMCARD_BLOCKS); + }; // Ignore deleted blocks i += x; if (MemBlockFlag(memBlock.Flags) == memFlagDeleted) { diff --git a/macosx/Source/PcsxrMemCardArray.m b/macosx/Source/PcsxrMemCardArray.m index ea739ffb..b7429f20 100644 --- a/macosx/Source/PcsxrMemCardArray.m +++ b/macosx/Source/PcsxrMemCardArray.m @@ -108,7 +108,7 @@ static inline void ClearMemcardData(char *to, int dsti, char *str) i++; continue; } - do { + while (i + x < MAX_MEMCARD_BLOCKS) { McdBlock tmpBlock; GetMcdBlockInfo(carNum, i + x + 1, &tmpBlock); if ((tmpBlock.Flags & 0x3) == 0x3) { @@ -119,7 +119,7 @@ static inline void ClearMemcardData(char *to, int dsti, char *str) } else { break; } - } while (i + x - 1 < MAX_MEMCARD_BLOCKS); + }; @autoreleasepool { PcsxrMemoryObject *obj = [[PcsxrMemoryObject alloc] initWithMcdBlock:&memBlock startingIndex:i size:x]; [tmpMemArray addObject:obj];