From fc35912a520106aa33434d6d52a57d07bddcf7a2 Mon Sep 17 00:00:00 2001 From: "Jake.Stine" Date: Mon, 17 Aug 2009 09:52:50 +0000 Subject: [PATCH] Removed duplicate null checks on safe_delete. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1643 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/SafeArray.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pcsx2/SafeArray.h b/pcsx2/SafeArray.h index e115364d09..aa01ca913a 100644 --- a/pcsx2/SafeArray.h +++ b/pcsx2/SafeArray.h @@ -30,16 +30,16 @@ extern void pcsx2_aligned_free(void* pmem); #endif ////////////////////////////////////////////////////////////////////////////////////////// -// Safe deallocation macros -- always check pointer validity (non-null) when needed, -// and set pointer to null after deallocation. +// Safe deallocation macros -- checks pointer validity (non-null) when needed, and sets +// pointer to null after deallocation. #define safe_delete( ptr ) \ - ((void) (( ( ptr != NULL ) && (delete ptr, !!0) ), ptr = NULL)) + ((void) (delete ptr), ptr = NULL) #define safe_delete_array( ptr ) \ - ((void) (( ( ptr != NULL ) && (delete[] ptr, !!0) ), ptr = NULL)) + ((void) (delete[] ptr), ptr = NULL) -// fixme: I'm pretty sure modern libc implementations inder gcc and msvc check null status +// fixme: I'm pretty sure modern libc implementations under gcc and msvc check null status // inside free(), meaning we shouldn't have to do it ourselves. But legacy implementations // didn't always check, so best to be cautious unless absolutely certain it's being covered on // all ported platforms. @@ -50,10 +50,10 @@ extern void pcsx2_aligned_free(void* pmem); // NULL status (our implementation under GCC, and microsoft's under MSVC), so no need to // do it here. #define safe_aligned_free( ptr ) \ - ( (void) ( _aligned_free( ptr ), ptr = NULL ) ) + ((void) ( _aligned_free( ptr ), ptr = NULL )) #define SafeSysMunmap( ptr, size ) \ - ( (void) ( HostSys::Munmap( (uptr)ptr, size ), ptr = NULL ) ) + ((void) ( HostSys::Munmap( (uptr)ptr, size ), ptr = NULL )) ////////////////////////////////////////////////////////////////////////////////////////// // Handy little class for allocating a resizable memory block, complete with