Index: generic/nsfEnumerationType.c =================================================================== diff -u -rd29a51c38be834fe558f1c85069d8bc500d201d9 -r92ab630ebd3c1b907e3d0fdf97cc07914245c028 --- generic/nsfEnumerationType.c (.../nsfEnumerationType.c) (revision d29a51c38be834fe558f1c85069d8bc500d201d9) +++ generic/nsfEnumerationType.c (.../nsfEnumerationType.c) (revision 92ab630ebd3c1b907e3d0fdf97cc07914245c028) @@ -31,8 +31,7 @@ static int enumerationTypeRefCount = 0; static NsfMutex enumerationMutex = 0; -static int Register(Tcl_Interp *interp, CONST char* domain, Nsf_TypeConverter *converter); - +static int Register(Tcl_Interp *interp, CONST char* domain, Nsf_TypeConverter *converter) nonnull(1) nonnull(3); /* *---------------------------------------------------------------------- * Nsf_EnumerationTypeInit -- @@ -50,6 +49,8 @@ void Nsf_EnumerationTypeInit(Tcl_Interp *interp) { + assert(interp); + NsfMutexLock(&enumerationMutex); if (enumerationTypeRefCount == 0) { @@ -78,6 +79,9 @@ Nsf_EnumerationTypeRegister(Tcl_Interp *interp, Nsf_EnumeratorConverterEntry *typeRecords) { Nsf_EnumeratorConverterEntry *ePtr; + assert(interp); + assert(typeRecords); + for (ePtr = typeRecords; ePtr->converter; ePtr++) { Register(interp, ePtr->domain, ePtr->converter); } @@ -105,6 +109,8 @@ Tcl_HashSearch hSrch; CONST char* domain = NULL; + assert(converter); + NsfMutexLock(&enumerationMutex); for (hPtr = Tcl_FirstHashEntry(enumerationHashTablePtr, &hSrch); hPtr != NULL; @@ -134,11 +140,15 @@ * *---------------------------------------------------------------------- */ + static int Register(Tcl_Interp *interp, CONST char* domain, Nsf_TypeConverter *converter) { Tcl_HashEntry *hPtr; int isNew; + assert(interp); + assert(converter); + NsfMutexLock(&enumerationMutex); hPtr = Tcl_CreateHashEntry(enumerationHashTablePtr, domain, &isNew); NsfMutexUnlock(&enumerationMutex);