]> git.sur5r.net Git - openocd/commitdiff
Zach Welch <zw@superlucidity.net> fix warnings
authoroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Sat, 2 May 2009 12:26:10 +0000 (12:26 +0000)
committeroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Sat, 2 May 2009 12:26:10 +0000 (12:26 +0000)
git-svn-id: svn://svn.berlios.de/openocd/trunk@1589 b42882b7-edfa-0310-969c-e2dbd0fdcd60

src/helper/jim.c

index 5da0aa114b34d7bb29db1cab69b884c88d898dac..ad2d6ec5cb8e534cad5c668e48d8d5e91ed677d9 100644 (file)
@@ -89,7 +89,7 @@
 #endif /* WIN32 */
 #endif /* JIM_DYNLIB */
 
-#ifndef WIN32
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #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
  * ---------------------------------------------------------------------------*/