[brlcad-commits] SF.net SVN: brlcad:[54790] brlcad/trunk/include/bu.h
Open Source Solid Modeling CAD
Brought to you by:
brlcad
From: <br...@us...> - 2013-03-20 21:41:53
|
Revision: 54790 http://brlcad.svn.sourceforge.net/brlcad/?rev=54790&view=rev Author: brlcad Date: 2013-03-20 21:41:46 +0000 (Wed, 20 Mar 2013) Log Message: ----------- intentionally but innocuosly use the type so we can catch errors Modified Paths: -------------- brlcad/trunk/include/bu.h Modified: brlcad/trunk/include/bu.h =================================================================== --- brlcad/trunk/include/bu.h 2013-03-20 21:27:46 UTC (rev 54789) +++ brlcad/trunk/include/bu.h 2013-03-20 21:41:46 UTC (rev 54790) @@ -262,9 +262,9 @@ * with bu_free(), NOT with BU_PUT(). */ #if 0 -#define BU_PUT(_ptr, _type) *(uint8_t *)(_ptr) = /*zap*/ 0; bu_heap_put(_ptr, sizeof(_type)); _ptr = NULL +#define BU_PUT(_ptr, _type) *(uint8_t *)(_ptr) = /*zap*/ 0; bu_heap_put(_ptr, #SO(_type)); _ptr = NULL #else -#define BU_PUT(_ptr, _type) do { *(uint8_t *)(_ptr) = /*zap*/ 0; bu_free(_ptr, #_type " (BU_PUT) " BU_FLSTR); _ptr = NULL; } while (0) +#define BU_PUT(_ptr, _type) do { *(uint8_t *)(_ptr) = /*zap*/ 0; bu_free(_ptr, #_type " (BU_PUT) " BU_FLSTR); _ptr = (_type *)sizeof(_type); _ptr = NULL; } while (0) #endif /** @@ -5372,8 +5372,9 @@ #define bu_strlcpy(dst, src, size) bu_strlcpym(dst, src, size, BU_FLSTR) /** - * Given a string, allocate enough memory to hold it using bu_malloc(), - * duplicate the strings, returns a pointer to the new string. + * Given a string, allocate enough memory to hold it using + * bu_malloc(), duplicate the strings, returns a pointer to the new + * string. * * bu_strdup() is a macro that includes the current file name and line * number that can be used when bu debugging is enabled. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |