stuff
This commit is contained in:
parent
0cf89f6d48
commit
355489f4b4
@ -27,6 +27,7 @@
|
|||||||
data
|
data
|
||||||
- added string->double transform for cmdline args
|
- added string->double transform for cmdline args
|
||||||
- merged class-params branch back into trunk
|
- merged class-params branch back into trunk
|
||||||
|
- IM_FREE() can do "const char*" variables
|
||||||
|
|
||||||
11/9/08 started 7.16.3
|
11/9/08 started 7.16.3
|
||||||
- oop typo in manpage for im_project()
|
- oop typo in manpage for im_project()
|
||||||
|
@ -155,13 +155,24 @@ extern "C" {
|
|||||||
#define IM_NEW(IM,A) ((A *)im_malloc((IM),sizeof(A)))
|
#define IM_NEW(IM,A) ((A *)im_malloc((IM),sizeof(A)))
|
||||||
#define IM_NUMBER(R) ((int)(sizeof(R)/sizeof(R[0])))
|
#define IM_NUMBER(R) ((int)(sizeof(R)/sizeof(R[0])))
|
||||||
#define IM_ARRAY(IM,N,T) ((T *)im_malloc((IM),(N) * sizeof(T)))
|
#define IM_ARRAY(IM,N,T) ((T *)im_malloc((IM),(N) * sizeof(T)))
|
||||||
|
|
||||||
#define IM_FREEF( F, S ) do { \
|
#define IM_FREEF( F, S ) do { \
|
||||||
if( S ) { \
|
if( S ) { \
|
||||||
(void) F( (S) ); \
|
(void) F( (S) ); \
|
||||||
(S) = 0; \
|
(S) = 0; \
|
||||||
} \
|
} \
|
||||||
} while( 0 )
|
} while( 0 )
|
||||||
#define IM_FREE( A ) IM_FREEF( im_free, A )
|
|
||||||
|
/* Can't just use IM_FREEF(), we want the extra cast to void on the argument
|
||||||
|
* to im_free() to make sure we can work for "const char *" variables.
|
||||||
|
*/
|
||||||
|
#define IM_FREE( S ) do { \
|
||||||
|
if( S ) { \
|
||||||
|
(void) im_free( (void *) (S) ); \
|
||||||
|
(S) = 0; \
|
||||||
|
} \
|
||||||
|
} while( 0 )
|
||||||
|
|
||||||
#define IM_SETSTR( S, V ) do { \
|
#define IM_SETSTR( S, V ) do { \
|
||||||
const char *sst = (V); \
|
const char *sst = (V); \
|
||||||
\
|
\
|
||||||
|
Loading…
Reference in New Issue
Block a user