diff options
Diffstat (limited to 'src/misc')
-rw-r--r-- | src/misc/nm/nmApi.c | 4 | ||||
-rw-r--r-- | src/misc/st/st.c | 16 |
2 files changed, 17 insertions, 3 deletions
diff --git a/src/misc/nm/nmApi.c b/src/misc/nm/nmApi.c index f7bb0fe7..05fe80a1 100644 --- a/src/misc/nm/nmApi.c +++ b/src/misc/nm/nmApi.c @@ -175,9 +175,9 @@ char * Nm_ManCreateUniqueName( Nm_Man_t * p, int ObjId ) int i; if ( pEntry = Nm_ManTableLookupId(p, ObjId) ) return pEntry->Name; - sprintf( NameStr, "[%d]", ObjId ); + sprintf( NameStr, "n%d", ObjId ); for ( i = 1; Nm_ManTableLookupName(p, NameStr, -1); i++ ) - sprintf( NameStr, "[%d]_%d", ObjId, i ); + sprintf( NameStr, "n%d_%d", ObjId, i ); return NameStr; } diff --git a/src/misc/st/st.c b/src/misc/st/st.c index e1e5022a..892a33af 100644 --- a/src/misc/st/st.c +++ b/src/misc/st/st.c @@ -8,13 +8,27 @@ * */ #include <stdio.h> -#include "extra.h" +//#include "extra.h" #include "st.h" #ifndef ABS # define ABS(a) ((a) < 0 ? -(a) : (a)) #endif +#ifndef ALLOC +#define ALLOC(type, num) ((type *) malloc(sizeof(type) * (num))) +#endif + +#ifndef FREE +#define FREE(obj) ((obj) ? (free((char *) (obj)), (obj) = 0) : 0) +#endif + +#ifndef REALLOC +#define REALLOC(type, obj, num) \ + ((obj) ? ((type *) realloc((char *)(obj), sizeof(type) * (num))) : \ + ((type *) malloc(sizeof(type) * (num)))) +#endif + #define ST_NUMCMP(x,y) ((x) != (y)) #define ST_NUMHASH(x,size) (ABS((long)x)%(size)) #define ST_PTRHASH(x,size) ((int)((unsigned long)(x)>>2)%size) |