X-Git-Url: https://review.openocd.org/gitweb?a=blobdiff_plain;ds=sidebyside;f=src%2Fhelper%2Fjim.c;h=117ec56f42b390591bef8a45045feb6e8ba0b006;hb=82fc2f9628e0f1dbd9010e0146ff63832e4a77a1;hp=c1ba0d9da97a7ea09c22c7614c4e2b547b56e75e;hpb=7393fcfc900b720271ab048a0e0b441897a97a37;p=openocd.git diff --git a/src/helper/jim.c b/src/helper/jim.c index c1ba0d9da9..117ec56f42 100644 --- a/src/helper/jim.c +++ b/src/helper/jim.c @@ -3,11 +3,14 @@ * Copyright 2005 Salvatore Sanfilippo * Copyright 2005 Clemens Hintze * Copyright 2005 patthoyts - Pat Thoyts - * Copyright 2008 oharboe - Øyvind Harboe - oyvind.harboe@zylin.com + * Copyright 2008,2009 oharboe - Øyvind Harboe - oyvind.harboe@zylin.com * Copyright 2008 Andrew Lunn * Copyright 2008 Duane Ellis * Copyright 2008 Uwe Klein * Copyright 2008 Steve Bennett + * Copyright 2009 Nico Coesel + * Copyright 2009 Zachary T Welch zw@superlucidity.net + * Copyright 2009 David Brownell * * The FreeBSD license * @@ -50,6 +53,9 @@ #include #include #include + +typedef CYG_ADDRWORD intptr_t; + #include #include #include @@ -4751,7 +4757,7 @@ const char *Jim_GetSharedString(Jim_Interp *interp, const char *str) Jim_AddHashEntry(&interp->sharedStrings, strCopy, (void*)1); return strCopy; } else { - long refCount = (long) he->val; + intptr_t refCount = (intptr_t) he->val; refCount++; he->val = (void*) refCount; @@ -4761,13 +4767,13 @@ const char *Jim_GetSharedString(Jim_Interp *interp, const char *str) void Jim_ReleaseSharedString(Jim_Interp *interp, const char *str) { - long refCount; + intptr_t refCount; Jim_HashEntry *he = Jim_FindHashEntry(&interp->sharedStrings, str); if (he == NULL) Jim_Panic(interp,"Jim_ReleaseSharedString called with " "unknown shared string '%s'", str); - refCount = (long) he->val; + refCount = (intptr_t) he->val; refCount--; if (refCount == 0) { Jim_DeleteHashEntry(&interp->sharedStrings, str);