From 3c6becec37726233969348635557ace46c938263 Mon Sep 17 00:00:00 2001 From: janwas Date: Fri, 18 Jun 2004 13:24:59 +0000 Subject: [PATCH] was thinking about documenting the whole lib design goals/rationale, added a few notes. This was SVN commit r530. --- source/lib/lib.h | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/source/lib/lib.h b/source/lib/lib.h index aebe25e522..ecc10e3365 100755 --- a/source/lib/lib.h +++ b/source/lib/lib.h @@ -83,8 +83,8 @@ STMT(\ -// useful because VC6 returns 0 on failure, instead of throwing. -// causes calling function to return a negative error code on failure. +// useful because VC may return 0 on failure, instead of throwing. +// this wraps the exception handling, and creates a NULL pointer on failure. #define SAFE_NEW(type, ptr)\ type* ptr;\ try\ @@ -94,10 +94,7 @@ STMT(\ catch(std::bad_alloc)\ {\ ptr = 0;\ - }\ - if(!ptr)\ - return ERR_NO_MEM; - + } enum LibError @@ -280,17 +277,12 @@ extern u16 fp_to_u16(double in); // big endian! extern void base32(const int len, const u8* in, u8* out); -#ifndef _WIN32 - -char *_itoa(int, char *, int radix); -char *_ultoa(unsigned long int, char*, int radix); -char *_ltoa(long, char *, int radix); - -#endif - - +// design goals: +// fast (including startup time) +// portable +// reusable across projects (i.e. no dependency on "parent" that calls modules) #endif // #ifndef LIB_H