From e69b222d530becf495f9c4e28feff829fbbc72fb Mon Sep 17 00:00:00 2001 From: oharboe Date: Sat, 2 May 2009 12:26:10 +0000 Subject: [PATCH] Zach Welch fix warnings git-svn-id: svn://svn.berlios.de/openocd/trunk@1589 b42882b7-edfa-0310-969c-e2dbd0fdcd60 --- src/helper/jim.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/helper/jim.c b/src/helper/jim.c index 5da0aa114..ad2d6ec5c 100644 --- a/src/helper/jim.c +++ b/src/helper/jim.c @@ -89,7 +89,7 @@ #endif /* WIN32 */ #endif /* JIM_DYNLIB */ -#ifndef WIN32 +#ifdef HAVE_UNISTD_H #include #endif @@ -118,7 +118,7 @@ static void JimChangeCallFrameId(Jim_Interp *interp, Jim_CallFrame *cf); static void JimFreeCallFrame(Jim_Interp *interp, Jim_CallFrame *cf, int flags); static void JimRegisterCoreApi(Jim_Interp *interp); -static Jim_HashTableType JimVariablesHashTableType; +static Jim_HashTableType *getJimVariablesHashTableType(void); /* ----------------------------------------------------------------------------- * Utility functions @@ -3237,7 +3237,7 @@ int Jim_CreateProcedure(Jim_Interp *interp, const char *cmdName, Jim_ListLength(interp, staticsListObjPtr, &len); if (len != 0) { cmdPtr->staticVars = Jim_Alloc(sizeof(Jim_HashTable)); - Jim_InitHashTable(cmdPtr->staticVars, &JimVariablesHashTableType, + Jim_InitHashTable(cmdPtr->staticVars, getJimVariablesHashTableType(), interp); for (i = 0; i < len; i++) { Jim_Obj *objPtr, *initObjPtr, *nameObjPtr; @@ -3440,6 +3440,11 @@ static Jim_HashTableType JimVariablesHashTableType = { JimVariablesHTValDestructor /* val destructor */ }; +static Jim_HashTableType *getJimVariablesHashTableType(void) +{ + return &JimVariablesHashTableType; +} + /* ----------------------------------------------------------------------------- * Variable object * ---------------------------------------------------------------------------*/