diff options
-rw-r--r-- | jim-eventloop.c | 5 | ||||
-rw-r--r-- | jim.c | 34 |
2 files changed, 21 insertions, 18 deletions
diff --git a/jim-eventloop.c b/jim-eventloop.c index 2dbb47c..af30f2e 100644 --- a/jim-eventloop.c +++ b/jim-eventloop.c @@ -49,8 +49,7 @@ #define __JIM_EVENTLOOP_CORE__ #ifdef __ECOS #include <pkgconf/jimtcl.h> -#endif -#ifdef __ECOS +#include <sys/time.h> #include <cyg/jimtcl/jim.h> #include <cyg/jimtcl/jim-eventloop.h> #else @@ -504,7 +503,7 @@ static int JimELAfterCommand(Jim_Interp *interp, int argc, int tlen ; jim_wide remain = 0; const char *tok = Jim_GetString(argv[2], &tlen); - if ( sscanf(tok,"after#%lld",&id) == 1) { + if (sscanf(tok,"after#%" JIM_WIDE_MODIFIER, &id) == 1) { remain = Jim_DeleteTimeHandler(interp, id); if (remain > -2) { Jim_SetResult(interp, Jim_NewIntObj(interp, remain)); @@ -2,13 +2,16 @@ * * Copyright 2005 Salvatore Sanfilippo <antirez@invece.org> * Copyright 2005 Clemens Hintze <c.hintze@gmx.net> - * Copyright 2005 patthoyts - Pat Thoyts <patthoyts@users.sf.net> - * Copyright 2008 oharboe - �yvind Harboe - oyvind.harboe@zylin.com + * Copyright 2005 patthoyts - Pat Thoyts <patthoyts@users.sf.net> + * Copyright 2008,2009 oharboe - Øyvind Harboe - oyvind.harboe@zylin.com * Copyright 2008 Andrew Lunn <andrew@lunn.ch> * Copyright 2008 Duane Ellis <openocd@duaneellis.com> * Copyright 2008 Uwe Klein <uklein@klein-messgeraete.de> * Copyright 2008 Steve Bennett <steveb@workware.net.au> - * + * Copyright 2009 Nico Coesel <ncoesel@dealogic.nl> + * Copyright 2009 Zachary T Welch zw@superlucidity.net + * Copyright 2009 David Brownell + * * The FreeBSD license * * Redistribution and use in source and binary forms, with or without @@ -44,13 +47,11 @@ #ifdef __ECOS #include <pkgconf/jimtcl.h> -#endif -#ifndef JIM_ANSIC -#define JIM_DYNLIB /* Dynamic library support for UNIX and WIN32 */ -#endif /* JIM_ANSIC */ - #include <stdio.h> #include <stdlib.h> + +typedef CYG_ADDRWORD intptr_t; + #include <string.h> #include <stdarg.h> #include <ctype.h> @@ -58,6 +59,13 @@ #include <assert.h> #include <errno.h> #include <time.h> +#endif +#ifndef JIM_ANSIC +#define JIM_DYNLIB /* Dynamic library support for UNIX and WIN32 */ +#endif /* JIM_ANSIC */ + +#include <stdarg.h> +#include <limits.h> /* Include the platform dependent libraries for * dynamic loading of libraries. */ @@ -79,10 +87,6 @@ #endif /* WIN32 */ #endif /* JIM_DYNLIB */ -#ifndef WIN32 -#include <unistd.h> -#endif - #ifdef __ECOS #include <cyg/jimtcl/jim.h> #else @@ -4687,7 +4691,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; @@ -4697,13 +4701,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); |