error: statically allocate error symbol hash table
This will allow calling errSymbolAdd before errSymBld, therefore, a function adding error symbols can now be run before iocInit or errlogInit
This commit is contained in:
@@ -39,7 +39,7 @@ typedef struct errnumnode {
|
||||
long pad;
|
||||
} ERRNUMNODE;
|
||||
|
||||
static ERRNUMNODE **hashtable;
|
||||
static ERRNUMNODE *hashtable[NHASH];
|
||||
static int initialized = 0;
|
||||
extern ERRSYMTAB_ID errSymTbl;
|
||||
|
||||
@@ -59,9 +59,6 @@ int errSymBld(void)
|
||||
if (initialized)
|
||||
return(0);
|
||||
|
||||
hashtable = (ERRNUMNODE**)callocMustSucceed
|
||||
(NHASH, sizeof(ERRNUMNODE*),"errSymBld");
|
||||
|
||||
for (i = 0; i < errSymTbl->nsymbols; i++, errArray++) {
|
||||
if (errSymbolAdd(errArray->errNum, errArray->name)) {
|
||||
fprintf(stderr, "errSymBld: ERROR - errSymbolAdd() failed \n");
|
||||
|
||||
Reference in New Issue
Block a user