X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=nucleus%2Flibrary%2Fbasis%2Ffunctions.h;h=4b2c6eb689f24b349065e240dfd923d1e65665d1;hb=c3206cdf9dd132c4f1d0d0e9300991d284e2bc78;hp=777461a9002eeece963f4e92d2d85ea758077304;hpb=3ea085ec301ed1399dfa1e9f3a240312dc95410b;p=feisty_meow.git diff --git a/nucleus/library/basis/functions.h b/nucleus/library/basis/functions.h index 777461a9..4b2c6eb6 100644 --- a/nucleus/library/basis/functions.h +++ b/nucleus/library/basis/functions.h @@ -67,7 +67,7 @@ bool operator >= (const T1 &x, const T2 &y) { return !(x < y); } template target_type *cast_or_throw(source_type &to_cast, const target_type &ignored) { - if (!&ignored) {} // do nothing. +// if (!&ignored) {} // do nothing. target_type *cast = dynamic_cast(&to_cast); if (!cast) throw "error: casting problem, unknown RTTI cast."; return cast; @@ -77,7 +77,7 @@ target_type *cast_or_throw(source_type &to_cast, const target_type &ignored) template const target_type *cast_or_throw(const source_type &to_cast, const target_type &ignored) { - if (!&ignored) {} // do nothing. +// if (!&ignored) {} // do nothing. const target_type *cast = dynamic_cast(&to_cast); if (!cast) throw "error: casting problem, unknown RTTI cast."; return cast; @@ -114,11 +114,11 @@ template type sign(type a) //! deletion with clearing of the pointer. /*! this function simplifies the two step process of deleting a pointer and -then clearing it to NIL. this makes debugging a bit easier since an access -of NIL should always cause a fault, rather than looking like a possibly +then clearing it to NULL_POINTER. this makes debugging a bit easier since an access +of NULL_POINTER should always cause a fault, rather than looking like a possibly valid object. */ template -void WHACK(contents * &ptr) { if (ptr) { delete ptr; ptr = NIL; } } +void WHACK(contents * &ptr) { if (ptr) { delete ptr; ptr = NULL_POINTER; } } //! Returns an object that is defined statically. /*! Thus the returned object will never be recreated once this function