diff --git a/Sources/Plasma/CoreLib/hsExceptions.h b/Sources/Plasma/CoreLib/hsExceptions.h index 134afdce..0265ecc0 100644 --- a/Sources/Plasma/CoreLib/hsExceptions.h +++ b/Sources/Plasma/CoreLib/hsExceptions.h @@ -45,11 +45,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "HeadSpin.h" #include -// #define HS_NO_EXCEPTIONS -- this will turn off execptions you might want -// to do it with -D or equivalent instead of here since who knows who includes this. - - - enum hsErrorEnum { kNo_hsError, kNilParam_hsError, @@ -94,12 +89,7 @@ public: ///////////////////////////////////////////////////////////////////////////////// -#ifndef HS_NO_EXCEPTIONS -#define hsThrow(a) {hsAssert(0,#a);throw a;} -#define hsCatch(a) catch (a) -#define hsCatch2(a,b) catch (a b) - -#define hsTry try +#define hsThrow(a) { hsAssert(0,#a); throw a; } inline void hsThrowIfNilParam(const void* p) { @@ -164,48 +154,4 @@ inline void hsThrowIfFalse(bool condition, const char message[]) } } -#else -#define hsThrow(a) {hsAssert(0,#a);} -#define hsCatch(a) if(0) -#define hsCatch2(a,b) if(0) -#define hsTry - -inline void hsThrowIfNilParam(const void* p) -{ - hsAssert(p!=nil,"hsThrowIfNilParam"); -} - -inline void hsThrowIfBadParam(bool trueIfBadParam) -{ - hsAssert(!trueIfBadParam,"hsThrowIfBadParam"); -} - -inline void hsThrowIfOSErr(long osErr) -{ - hsAssert(osErr==0,"hsThrowIfOSErr"); -} - -inline void hsThrowIfTrue(bool condition) -{ - hsAssert(!condition,"hsThrowIfTrue"); -} - -inline void hsThrowIfFalse(bool condition) -{ - hsAssert(condition,"hsThrowIfFalse"); -} - -inline void hsThrowIfTrue(bool condition, const char message[]) -{ - hsAssert(!condition,message); -} - -inline void hsThrowIfFalse(bool condition, const char message[]) -{ - hsAssert(condition,message); -} - - -#endif - #endif diff --git a/Sources/Plasma/CoreLib/hsMemory.cpp b/Sources/Plasma/CoreLib/hsMemory.cpp index e73946b8..fdd18685 100644 --- a/Sources/Plasma/CoreLib/hsMemory.cpp +++ b/Sources/Plasma/CoreLib/hsMemory.cpp @@ -184,19 +184,6 @@ void* hsChunkAllocator::Allocate(uint32_t size, const void* data) return addr; } -void* hsChunkAllocator::SoftAllocate(uint32_t size, const void* data) -{ - void* addr; - - hsTry { - addr = this->Allocate(size, data); - } - hsCatch(...) { - addr = nil; - } - return addr; -} - ////////////////////////////////////////////////////////////////////////////////////// struct hsAppenderHead { diff --git a/Sources/Plasma/CoreLib/hsMemory.h b/Sources/Plasma/CoreLib/hsMemory.h index ab2a169b..0b5d8c5e 100644 --- a/Sources/Plasma/CoreLib/hsMemory.h +++ b/Sources/Plasma/CoreLib/hsMemory.h @@ -108,8 +108,7 @@ public: void Reset(); void SetChunkSize(uint32_t size); - void* Allocate(uint32_t size, const void* data = nil); // throws if fails - void* SoftAllocate(uint32_t size, const void* data = nil); // returns nil if fails + void* Allocate(uint32_t size, const void* data = nil); }; ///////////////////////////////////////////////////////////////////////////////////////////