diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2006-10-07 08:01:00 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2006-10-07 08:01:00 -0700 |
commit | 73bb7932f7edad95086d67a795444537c438309e (patch) | |
tree | 43ce6255913e15ecb3f4f8a41ac531d6679ddcf1 /src/misc | |
parent | 0da555cb481696efd78d9c5dc6293b6a95d1ffd5 (diff) | |
download | abc-73bb7932f7edad95086d67a795444537c438309e.tar.gz abc-73bb7932f7edad95086d67a795444537c438309e.tar.bz2 abc-73bb7932f7edad95086d67a795444537c438309e.zip |
Version abc61007
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) |