Fix various compiler warnings given by Clang (#170)

This commit is contained in:
bitscher 2022-09-07 11:04:32 -07:00 committed by GitHub
parent 4d1be950e3
commit 4eaa600b57
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 26 additions and 28 deletions

View file

@ -1,5 +1,3 @@
#pragma once
#include "Cafe/OS/libs/coreinit/coreinit_Thread.h"
#include "util/helpers/fspinlock.h"

View file

@ -470,7 +470,7 @@ namespace coreinit
// mark current block as free
block->isFree = _swapEndianU32(1);
// attempt to merge with previous block
if (_swapEndianU32(block->previousBlock) != NULL)
if (_swapEndianU32(block->previousBlock) != MPTR_NULL)
{
MPTR previousBlockMPTR = _swapEndianU32(block->previousBlock);
MEMBlockHeapTrackDEPR* previousBlock = (MEMBlockHeapTrackDEPR*)memory_getPointerFromVirtualOffset(previousBlockMPTR);
@ -494,7 +494,7 @@ namespace coreinit
}
}
// attempt to merge with next block
if (_swapEndianU32(block->nextBlock) != NULL)
if (_swapEndianU32(block->nextBlock) != MPTR_NULL)
{
MPTR nextBlockMPTR = _swapEndianU32(block->nextBlock);
MEMBlockHeapTrackDEPR* nextBlock = (MEMBlockHeapTrackDEPR*)memory_getPointerFromVirtualOffset(nextBlockMPTR);

View file

@ -34,7 +34,7 @@ namespace coreinit
{
debug_printf("coreinitVirtualMemory_alloc(): Unable to allocate memory\n");
debugBreakpoint();
return NULL;
return MPTR_NULL;
}
// check for overlapping regions
OSVirtMemory* virtMemItr = virtualMemoryList;
@ -66,7 +66,7 @@ namespace coreinit
return currentAddress;
}
}
return NULL;
return MPTR_NULL;
}
void coreinitExport_OSGetAvailPhysAddrRange(PPCInterpreter_t* hCPU)

View file

@ -99,7 +99,7 @@ namespace snd_core
}
coreinit::OSInitMutexEx(__AXAppFrameCallbackMutex.GetPtr(), NULL);
for (sint32 i = 0; i < AX_DEV_COUNT; i++)
__AXDeviceFinalMixCallback[i] = NULL;
__AXDeviceFinalMixCallback[i] = MPTR_NULL;
}
sint32 AXRegisterAppFrameCallback(MPTR funcAddr)