diff options
author | zwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2009-06-23 22:50:08 +0000 |
---|---|---|
committer | zwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2009-06-23 22:50:08 +0000 |
commit | c97caebccd07be7e5bae61d6d40921e01786ba06 (patch) | |
tree | ac6b27c4e75a0b30f2676c8ed7ca70a1048be2c4 /src | |
parent | 2e779198535580515dfa9c8bfe1f3fe08abdb84b (diff) |
Remove whitespace at end of lines, step 2.
- Replace '\s*$' with ''.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2380 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src')
-rw-r--r-- | src/helper/binarybuffer.h | 6 | ||||
-rw-r--r-- | src/helper/command.c | 2 | ||||
-rw-r--r-- | src/helper/fileio.c | 56 | ||||
-rw-r--r-- | src/helper/jim-eventloop.c | 26 | ||||
-rw-r--r-- | src/helper/jim-eventloop.h | 14 | ||||
-rw-r--r-- | src/helper/jim.c | 316 | ||||
-rw-r--r-- | src/helper/jim.h | 70 | ||||
-rw-r--r-- | src/helper/log.h | 16 | ||||
-rw-r--r-- | src/helper/options.c | 20 | ||||
-rw-r--r-- | src/helper/replacements.c | 8 | ||||
-rw-r--r-- | src/helper/time_support.c | 24 | ||||
-rw-r--r-- | src/jtag/arm-jtag-ew.c | 6 | ||||
-rw-r--r-- | src/jtag/core.c | 8 | ||||
-rw-r--r-- | src/jtag/ft2232.c | 22 | ||||
-rw-r--r-- | src/jtag/minidriver.h | 2 | ||||
-rw-r--r-- | src/jtag/presto.c | 4 | ||||
-rw-r--r-- | src/server/server.c | 112 | ||||
-rw-r--r-- | src/server/tcl_server.c | 2 | ||||
-rw-r--r-- | src/svf/svf.c | 20 | ||||
-rw-r--r-- | src/xsvf/xsvf.c | 2 |
20 files changed, 368 insertions, 368 deletions
diff --git a/src/helper/binarybuffer.h b/src/helper/binarybuffer.h index dede72d5..4b8830b2 100644 --- a/src/helper/binarybuffer.h +++ b/src/helper/binarybuffer.h @@ -41,7 +41,7 @@ static inline void buf_set_u32(uint8_t* buffer, unsigned int first, unsigned int } else { unsigned int i; - + for (i = first; i < first + num; i++) { if (((value >> (i-first))&1) == 1) @@ -60,13 +60,13 @@ static inline uint32_t buf_get_u32(const uint8_t* buffer, unsigned int first, un { uint32_t result = 0; unsigned int i; - + for (i = first; i < first + num; i++) { if (((buffer[i/8]>>(i%8))&1) == 1) result |= 1 << (i-first); } - + return result; } } diff --git a/src/helper/command.c b/src/helper/command.c index 94c3e464..c34b51d4 100644 --- a/src/helper/command.c +++ b/src/helper/command.c @@ -896,7 +896,7 @@ DEFINE_PARSE_NUM_TYPE(_llong, long long, strtoll, LLONG_MIN, LLONG_MAX) return ERROR_COMMAND_ARGUMENT_UNDERFLOW; \ *ul = n; \ return ERROR_OK; \ - } + } #define DEFINE_PARSE_ULONG(name, type, min, max) \ DEFINE_PARSE_WRAPPER(name, type, min, max, unsigned long, _ulong) diff --git a/src/helper/fileio.c b/src/helper/fileio.c index 58d2c3a0..0fc1b11d 100644 --- a/src/helper/fileio.c +++ b/src/helper/fileio.c @@ -34,7 +34,7 @@ static inline int fileio_open_local(fileio_t *fileio) { char access[4]; - + switch (fileio->access) { case FILEIO_READ: @@ -47,16 +47,16 @@ static inline int fileio_open_local(fileio_t *fileio) strcpy(access, "w+"); break; case FILEIO_APPEND: - strcpy(access, "a"); + strcpy(access, "a"); break; case FILEIO_APPENDREAD: - strcpy(access, "a+"); + strcpy(access, "a+"); break; default: LOG_ERROR("BUG: access neither read, write nor readwrite"); return ERROR_INVALID_ARGUMENTS; } - + /* win32 always opens in binary mode */ #ifndef _WIN32 if (fileio->type == FILEIO_BINARY) @@ -64,26 +64,26 @@ static inline int fileio_open_local(fileio_t *fileio) { strcat(access, "b"); } - + if (!(fileio->file = open_file_from_path (fileio->url, access))) { LOG_ERROR("couldn't open %s", fileio->url); return ERROR_FILEIO_OPERATION_FAILED; } - + if ((fileio->access != FILEIO_WRITE) || (fileio->access == FILEIO_READWRITE)) { /* NB! Here we use fseek() instead of stat(), since stat is a * more advanced operation that might not apply to e.g. a disk path * that refers to e.g. a tftp client */ int result, result2; - + result = fseek(fileio->file, 0, SEEK_END); fileio->size = ftell(fileio->file); - - result2 = fseek(fileio->file, 0, SEEK_SET); - + + result2 = fseek(fileio->file, 0, SEEK_SET); + if ((fileio->size < 0)||(result < 0)||(result2 < 0)) { fileio_close(fileio); @@ -94,7 +94,7 @@ static inline int fileio_open_local(fileio_t *fileio) { fileio->size = 0x0; } - + return ERROR_OK; } @@ -105,7 +105,7 @@ int fileio_open(fileio_t *fileio, const char *url, enum fileio_access access, en fileio->type = type; fileio->access = access; fileio->url = strdup(url); - + retval = fileio_open_local(fileio); return retval; @@ -127,19 +127,19 @@ static inline int fileio_close_local(fileio_t *fileio) return ERROR_FILEIO_OPERATION_FAILED; } - + return ERROR_OK; } int fileio_close(fileio_t *fileio) { int retval; - + retval = fileio_close_local(fileio); - + free(fileio->url); fileio->url = NULL; - + return retval; } @@ -151,14 +151,14 @@ int fileio_seek(fileio_t *fileio, uint32_t position) LOG_ERROR("couldn't seek file %s: %s", fileio->url, strerror(errno)); return ERROR_FILEIO_OPERATION_FAILED; } - + return ERROR_OK; } static inline int fileio_local_read(fileio_t *fileio, uint32_t size, uint8_t *buffer, uint32_t *size_read) { *size_read = fread(buffer, 1, size, fileio->file); - + return ERROR_OK; } @@ -172,11 +172,11 @@ int fileio_read_u32(fileio_t *fileio, uint32_t *data) uint8_t buf[4]; uint32_t size_read; int retval; - + if ((retval = fileio_local_read(fileio, 4, buf, &size_read)) != ERROR_OK) return retval; *data = be_to_h_u32(buf); - + return ERROR_OK; } @@ -184,7 +184,7 @@ static inline int fileio_local_fgets(fileio_t *fileio, uint32_t size, char *buff { if (fgets(buffer, size, fileio->file) == NULL) return ERROR_FILEIO_OPERATION_FAILED; - + return ERROR_OK; } @@ -196,19 +196,19 @@ int fileio_fgets(fileio_t *fileio, uint32_t size, char *buffer) static inline int fileio_local_write(fileio_t *fileio, uint32_t size, const uint8_t *buffer, uint32_t *size_written) { *size_written = fwrite(buffer, 1, size, fileio->file); - + return ERROR_OK; } int fileio_write(fileio_t *fileio, uint32_t size, const uint8_t *buffer, uint32_t *size_written) { int retval; - + retval = fileio_local_write(fileio, size, buffer, size_written); - + if (retval == ERROR_OK) fileio->size += *size_written; - + return retval;; } @@ -217,11 +217,11 @@ int fileio_write_u32(fileio_t *fileio, uint32_t data) uint8_t buf[4]; uint32_t size_written; int retval; - + h_u32_to_be(buf, data); - + if ((retval = fileio_local_write(fileio, 4, buf, &size_written)) != ERROR_OK) return retval; - + return ERROR_OK; } diff --git a/src/helper/jim-eventloop.c b/src/helper/jim-eventloop.c index 18cb307d..1119cb38 100644 --- a/src/helper/jim-eventloop.c +++ b/src/helper/jim-eventloop.c @@ -2,25 +2,25 @@ * * 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 2005 patthoyts - Pat Thoyts <patthoyts@users.sf.net> * Copyright 2008 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> - * + * * The FreeBSD license - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY THE JIM TCL PROJECT ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A @@ -33,7 +33,7 @@ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation * are those of the authors and should not be interpreted as representing * official policies, either expressed or implied, of the Jim Tcl Project. @@ -133,12 +133,12 @@ void Jim_DeleteFileHandler(Jim_Interp *interp, void *handle) } // The same for signals. -void Jim_CreateSignalHandler(Jim_Interp *interp, int signum, +void Jim_CreateSignalHandler(Jim_Interp *interp, int signum, Jim_FileProc *proc, void *clientData, Jim_EventFinalizerProc *finalizerProc) { } -void Jim_DeleteSignalHandler(Jim_Interp *interp, int signum) +void Jim_DeleteSignalHandler(Jim_Interp *interp, int signum) { } @@ -192,7 +192,7 @@ jim_wide Jim_DeleteTimeHandler(Jim_Interp *interp, jim_wide id) JimGetTime(&cur_sec, &cur_ms); te = eventLoop->timeEventHead; - if (id >= eventLoop->timeEventNextId) + if (id >= eventLoop->timeEventNextId) return -2; /* wrong event ID */ while (te) { if (te->id == id) { @@ -271,7 +271,7 @@ int Jim_ProcessEvents(Jim_Interp *interp, int flags) while (fe != NULL) { int fd = fileno((FILE*)fe->handle); - if (fe->mask & JIM_EVENT_READABLE) + if (fe->mask & JIM_EVENT_READABLE) FD_SET(fd, &rfds); if (fe->mask & JIM_EVENT_WRITABLE) FD_SET(fd, &wfds); if (fe->mask & JIM_EVENT_EXCEPTION) FD_SET(fd, &efds); @@ -419,7 +419,7 @@ void JimELAssocDataDeleProc(Jim_Interp *interp, void *data) Jim_Free(data); } -static int JimELVwaitCommand(Jim_Interp *interp, int argc, +static int JimELVwaitCommand(Jim_Interp *interp, int argc, Jim_Obj *const *argv) { Jim_Obj *oldValue; @@ -461,7 +461,7 @@ void JimAfterTimeEventFinalizer(Jim_Interp *interp, void *clientData) Jim_DecrRefCount(interp, objPtr); } -static int JimELAfterCommand(Jim_Interp *interp, int argc, +static int JimELAfterCommand(Jim_Interp *interp, int argc, Jim_Obj *const *argv) { jim_wide ms, id; @@ -510,7 +510,7 @@ static int JimELAfterCommand(Jim_Interp *interp, int argc, } default: fprintf(stderr,"unserviced option to after %d\n",option); - } + } return JIM_OK; } diff --git a/src/helper/jim-eventloop.h b/src/helper/jim-eventloop.h index cabb88f1..c30812eb 100644 --- a/src/helper/jim-eventloop.h +++ b/src/helper/jim-eventloop.h @@ -2,25 +2,25 @@ * * 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 2005 patthoyts - Pat Thoyts <patthoyts@users.sf.net> * Copyright 2008 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> - * + * * The FreeBSD license - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY THE JIM TCL PROJECT ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A @@ -33,7 +33,7 @@ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation * are those of the authors and should not be interpreted as representing * official policies, either expressed or implied, of the Jim Tcl Project. @@ -64,7 +64,7 @@ typedef void Jim_EventFinalizerProc(Jim_Interp *interp, void *clientData); #define JIM_EVENT_FEOF 8 #define JIM_API(x) x -#define JIM_STATIC +#define JIM_STATIC JIM_STATIC int Jim_EventLoopOnLoad(Jim_Interp *interp); diff --git a/src/helper/jim.c b/src/helper/jim.c index 5d799e24..8257af3b 100644 --- a/src/helper/jim.c +++ b/src/helper/jim.c @@ -2,26 +2,26 @@ * * 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 2005 patthoyts - Pat Thoyts <patthoyts@users.sf.net> * Copyright 2008 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> - * + * * The FreeBSD license - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY THE JIM TCL PROJECT ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A @@ -34,7 +34,7 @@ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation * are those of the authors and should not be interpreted as representing * official policies, either expressed or implied, of the Jim Tcl Project. @@ -143,7 +143,7 @@ jim_vasprintf_done(void *buf) free(buf); #endif } - + /* * Convert a string to a jim_wide INTEGER. @@ -389,7 +389,7 @@ int JimStringCompare(const char *s1, int l1, const char *s2, int l2, } /* Search 's1' inside 's2', starting to search from char 'index' of 's2'. - * The index of the first occurrence of s1 in s2 is returned. + * The index of the first occurrence of s1 in s2 is returned. * If s1 is not found inside s2, -1 is returned. */ int JimStringFirst(const char *s1, int l1, const char *s2, int l2, int index) { @@ -520,7 +520,7 @@ void Jim_Panic(Jim_Interp *interp, const char *fmt, ...) va_list ap; va_start(ap, fmt); - /* + /* * Send it here first.. Assuming STDIO still works */ fprintf(stderr, JIM_NL "JIM INTERPRETER PANIC: "); @@ -542,7 +542,7 @@ void Jim_Panic(Jim_Interp *interp, const char *fmt, ...) fprintf(fp,"[backtrace] of 'nm <executable>' in the bug report." JIM_NL); } #endif - + /* This may actually crash... we do it last */ if (interp && interp->cookie_stderr) { Jim_fprintf(interp, interp->cookie_stderr, JIM_NL "JIM INTERPRETER PANIC: "); @@ -603,7 +603,7 @@ char *Jim_StrDup(const char *s) char *Jim_StrDupLen(const char *s, int l) { char *copy = Jim_Alloc(l + 1); - + memcpy(copy, s, l + 1); copy[l] = 0; /* Just to be sure, original could be substring */ return copy; @@ -726,7 +726,7 @@ int Jim_ExpandHashTable(Jim_HashTable *ht, unsigned int size) Jim_HashEntry *he, *nextHe; if (ht->table[i] == NULL) continue; - + /* For each hash entry on this slot... */ he = ht->table[i]; while (he) { @@ -1162,7 +1162,7 @@ static char *JimParserGetToken(struct JimParserCtx *pc, /* Initialize a parser context. * 'prg' is a pointer to the program text, linenr is the line * number of the first line contained in the program. */ -void JimParserInit(struct JimParserCtx *pc, const char *prg, +void JimParserInit(struct JimParserCtx *pc, const char *prg, int len, int linenr) { pc->prg = prg; @@ -1513,7 +1513,7 @@ static int JimEscape(char *dest, const char *s, int slen) { char *p = dest; int i, len; - + if (slen == -1) slen = strlen(s); @@ -1599,7 +1599,7 @@ static int JimEscape(char *dest, const char *s, int slen) * For exmple the string: * * {expand}$a - * + * * will return as first token "expand", of type JIM_TT_STR * * While the string: @@ -2233,7 +2233,7 @@ static Jim_Obj *JimStringToUpper(Jim_Interp *interp, Jim_Obj *strObjPtr) /* This is the core of the [format] command. * TODO: Lots of things work - via a hack - * However, no format item can be >= JIM_MAX_FMT + * However, no format item can be >= JIM_MAX_FMT */ #define JIM_MAX_FMT 2048 static Jim_Obj *Jim_FormatString_Inner(Jim_Interp *interp, Jim_Obj *fmtObjPtr, @@ -2242,7 +2242,7 @@ static Jim_Obj *Jim_FormatString_Inner(Jim_Interp *interp, Jim_Obj *fmtObjPtr, const char *fmt, *_fmt; int fmtLen; Jim_Obj *resObjPtr; - + fmt = Jim_GetString(fmtObjPtr, &fmtLen); _fmt = fmt; @@ -2299,7 +2299,7 @@ static Jim_Obj *Jim_FormatString_Inner(Jim_Interp *interp, Jim_Obj *fmtObjPtr, case 'u': /* unsigned */ case 'f': /* float */ break; - + /* non-terminals */ case '0': /* zero pad */ zpad = 1; @@ -2325,7 +2325,7 @@ static Jim_Obj *Jim_FormatString_Inner(Jim_Interp *interp, Jim_Obj *fmtObjPtr, altfm = 1; fmt++; fmtLen--; goto next_fmt; - + case '.': inprec = 1; fmt++; fmtLen--; @@ -2382,8 +2382,8 @@ static Jim_Obj *Jim_FormatString_Inner(Jim_Interp *interp, Jim_Obj *fmtObjPtr, goto next_fmt; break; } - - + + if (*fmt != '%') { if (objc == 0) { not_enough_args: @@ -2395,7 +2395,7 @@ static Jim_Obj *Jim_FormatString_Inner(Jim_Interp *interp, Jim_Obj *fmtObjPtr, objc--; } } - + /* * Create the formatter * cause we cheat and use sprintf() @@ -2476,7 +2476,7 @@ static Jim_Obj *Jim_FormatString_Inner(Jim_Interp *interp, Jim_Obj *fmtObjPtr, case 'X': /* jim widevaluse are 64bit */ if (sizeof(jim_wide) == sizeof(long long)) { - *cp++ = 'l'; + *cp++ = 'l'; *cp++ = 'l'; } else { *cp++ = 'l'; @@ -2507,7 +2507,7 @@ static Jim_Obj *Jim_FormatString_Inner(Jim_Interp *interp, Jim_Obj *fmtObjPtr, printf("FMT was: %s\n", fmt_str); printf("RES was: |%s|\n", sprintf_buf); #endif - + sprintf_buf[ JIM_MAX_FMT - 1] = 0; Jim_AppendString(interp, resObjPtr, sprintf_buf, strlen(sprintf_buf)); /* next obj */ @@ -2524,7 +2524,7 @@ Jim_Obj *Jim_FormatString(Jim_Interp *interp, Jim_Obj *fmtObjPtr, char *sprintf_buf = malloc(JIM_MAX_FMT); Jim_Obj *t = Jim_FormatString_Inner(interp, fmtObjPtr, objc, objv, sprintf_buf); free(sprintf_buf); - return t; + return t; } /* ----------------------------------------------------------------------------- @@ -2618,9 +2618,9 @@ int Jim_GetEnum(Jim_Interp *interp, Jim_Obj *objPtr, return JIM_ERR; } -int Jim_GetNvp(Jim_Interp *interp, +int Jim_GetNvp(Jim_Interp *interp, Jim_Obj *objPtr, - const Jim_Nvp *nvp_table, + const Jim_Nvp *nvp_table, const Jim_Nvp ** result) { Jim_Nvp *n; @@ -2735,7 +2735,7 @@ typedef struct ScriptToken { * The command structure is a pre-computed representation of the * command length and arguments structure as a simple liner array * of integers. - * + * * For example the script: * * puts hello @@ -3221,7 +3221,7 @@ int Jim_CreateProcedure(Jim_Interp *interp, const char *cmdName, cmdPtr->arityMin = arityMin; cmdPtr->arityMax = arityMax; cmdPtr->staticVars = NULL; - + /* Create the statics hash table. */ if (staticsListObjPtr) { int len, i; @@ -3319,7 +3319,7 @@ int Jim_DeleteCommand(Jim_Interp *interp, const char *cmdName) return JIM_OK; } -int Jim_RenameCommand(Jim_Interp *interp, const char *oldName, +int Jim_RenameCommand(Jim_Interp *interp, const char *oldName, const char *newName) { Jim_Cmd *cmdPtr; @@ -3737,7 +3737,7 @@ int Jim_UnsetVariable(Jim_Interp *interp, Jim_Obj *nameObjPtr, int flags) const char *name; Jim_Var *varPtr; int err; - + if ((err = SetVariableFromAny(interp, nameObjPtr)) != JIM_OK) { /* Check for [dict] syntax sugar. */ if (err == JIM_DICT_SUGAR) @@ -4037,7 +4037,7 @@ const void *JimReferencesHTKeyDup(void *privdata, const void *key) return copy; } -int JimReferencesHTKeyCompare(void *privdata, const void *key1, +int JimReferencesHTKeyCompare(void *privdata, const void *key1, const void *key2) { JIM_NOTUSED(privdata); @@ -4275,7 +4275,7 @@ int Jim_Collect(Jim_Interp *interp) &objPtr->internalRep.refValue.id, NULL); #ifdef JIM_DEBUG_GC Jim_fprintf(interp,interp->cookie_stdout, - "MARK (reference): %d refcount: %d" JIM_NL, + "MARK (reference): %d refcount: %d" JIM_NL, (int) objPtr->internalRep.refValue.id, objPtr->refCount); #endif @@ -4385,7 +4385,7 @@ void Jim_CollectIfNeeded(Jim_Interp *interp) { jim_wide elapsedId; int elapsedTime; - + elapsedId = interp->referenceNextId - interp->lastCollectId; elapsedTime = time(NULL) - interp->lastCollectTime; @@ -4497,7 +4497,7 @@ void Jim_FreeInterp(Jim_Interp *i) * there is a memory leak. */ if (i->liveList != NULL) { Jim_Obj *objPtr = i->liveList; - + Jim_fprintf(i, i->cookie_stdout,JIM_NL "-------------------------------------" JIM_NL); Jim_fprintf(i, i->cookie_stdout,"Objects still in the free list:" JIM_NL); while (objPtr) { @@ -5231,7 +5231,7 @@ int SetListFromAny(Jim_Interp *interp, struct Jim_Obj *objPtr) return JIM_OK; } -Jim_Obj *Jim_NewListObj(Jim_Interp *interp, Jim_Obj *const *elements, +Jim_Obj *Jim_NewListObj(Jim_Interp *interp, Jim_Obj *const *elements, int len) { Jim_Obj *objPtr; @@ -5433,7 +5433,7 @@ void Jim_ListInsertElements(Jim_Interp *interp, Jim_Obj *listPtr, int index, SetListFromAny(interp, listPtr); if (index >= 0 && index > listPtr->internalRep.listValue.len) index = listPtr->internalRep.listValue.len; - else if (index < 0) + else if (index < 0) index = 0; Jim_InvalidateStringRep(listPtr); ListInsertElements(listPtr, index, objc, objVec); @@ -6352,9 +6352,9 @@ int JimParseExprNumber(struct JimParserCtx *pc) if (*pc->p == '-') { pc->p++; pc->len--; } - while (isdigit((int)*pc->p) + while (isdigit((int)*pc->p) || (allowhex && isxdigit((int)*pc->p)) - || (allowdot && *pc->p == '.') + || (allowdot && *pc->p == '.') || (pc->p-pc->tstart == 1 && *pc->tstart == '0' && (*pc->p == 'x' || *pc->p == 'X')) ) @@ -7235,16 +7235,16 @@ int Jim_GetBoolFromExpr(Jim_Interp *interp, Jim_Obj *exprObjPtr, int *boolPtr) * to be parsed in its entirely first and then, if correct, can be used for * scanning. To avoid endless re-parsing, the parsed representation will be * stored in an internal representation and re-used for performance reason. */ - + /* A ScanFmtPartDescr will held the information of /one/ part of the whole * scanformat string. This part will later be used to extract information * out from the string to be parsed by Jim_ScanString */ - + typedef struct ScanFmtPartDescr { char type; /* Type of conversion (e.g. c, d, f) */ char modifier; /* Modify type (e.g. l - long, h - short */ size_t width; /* Maximal width of input to be converted */ - int pos; /* -1 - no assign, 0 - natural pos, >0 - XPG3 pos */ + int pos; /* -1 - no assign, 0 - natural pos, >0 - XPG3 pos */ char *arg; /* Specification of a CHARSET conversion */ char *prefix; /* Prefix to be scanned literally before conversion */ } ScanFmtPartDescr; @@ -7360,7 +7360,7 @@ static int SetScanFmtFromAny(Jim_Interp *interp, Jim_Obj *objPtr) int width = 0, skip; ScanFmtPartDescr *descr = &fmtObj->descr[curr]; fmtObj->count++; - descr->width = 0; /* Assume width unspecified */ + descr->width = 0; /* Assume width unspecified */ /* Overread and store any "literal" prefix */ if (*fmt != '%' || fmt[1] == '%') { descr->type = 0; @@ -7373,9 +7373,9 @@ static int SetScanFmtFromAny(Jim_Interp *interp, Jim_Obj *objPtr) buffer[i++] = *fmt; } buffer[i++] = 0; - } + } /* Skip the conversion introducing '%' sign */ - ++fmt; + ++fmt; /* End reached due to non-conversion literal only? */ if (fmt >= fmtEnd) goto done; @@ -7436,7 +7436,7 @@ static int SetScanFmtFromAny(Jim_Interp *interp, Jim_Obj *objPtr) if (*fmt != ']') { fmtObj->error = "unmatched [ in format string"; return JIM_ERR; - } + } end = i; buffer[i++] = 0; /* In case a range fence was given "backwards", swap it */ @@ -7455,7 +7455,7 @@ static int SetScanFmtFromAny(Jim_Interp *interp, Jim_Obj *objPtr) /* Remember any valid modifier if given */ if (strchr("hlL", *fmt) != 0) descr->modifier = tolower((int)*fmt++); - + descr->type = *fmt; if (strchr("efgcsndoxui", *fmt) == 0) { fmtObj->error = "bad scan conversion character"; @@ -7489,8 +7489,8 @@ done: ((ScanFmtStringObj*)((_fo_)->internalRep.ptr))->error /* Some Bit testing/setting/cleaning routines. For now only used in handling - * charsets ([a-z123]) within scanning. Later on perhaps a base for a - * bitvector implementation in Jim? */ + * charsets ([a-z123]) within scanning. Later on perhaps a base for a + * bitvector implementation in Jim? */ static int JimTestBit(const char *bitvec, char ch) { @@ -7533,7 +7533,7 @@ JimScanAString(Jim_Interp *interp, const char *sdescr, const char *str) memset(charset, (sdescr ? 0 : 255), sizeof(charset)); if (sdescr) { /* There was a set description given, that means we are parsing - * a specified string. So we have to build a corresponding + * a specified string. So we have to build a corresponding * charset reflecting the description */ int notFlag = 0; /* Should the set be negated at the end? */ @@ -7561,7 +7561,7 @@ JimScanAString(Jim_Interp *interp, const char *sdescr, const char *str) /* Negate the charset if there was a NOT given */ for (i = 0; notFlag && i < sizeof(charset); ++i) charset[i] = ~charset[i]; - } + } /* And after all the mess above, the real work begin ... */ while (str && *str) { if (!sdescr && isspace((int)*str)) @@ -7604,7 +7604,7 @@ static int ScanOneEntry(Jim_Interp *interp, const char *str, long pos, /* If prefix require, skip WS */ if (isspace((int)descr->prefix[i])) while (str[pos] && isspace((int)str[pos])) ++pos; - else if (descr->prefix[i] != str[pos]) + else if (descr->prefix[i] != str[pos]) break; /* Prefix do not match here, leave the loop */ else ++pos; /* Prefix matched so far, next round */ @@ -7649,7 +7649,7 @@ static int ScanOneEntry(Jim_Interp *interp, const char *str, long pos, : descr->type == 'x' ? 16 : descr->type == 'i' ? 0 : 10; - + do { /* Try to scan a number with the given base */ if (descr->modifier == 'l') @@ -7671,7 +7671,7 @@ static int ScanOneEntry(Jim_Interp *interp, const char *str, long pos, } /* If scanning failed, and base was undetermined, simply * put it to 10 and try once more. This should catch the - * case where %i begin to parse a number prefix (e.g. + * case where %i begin to parse a number prefix (e.g. * '0x' but no further digits follows. This will be * handled as a ZERO followed by a char 'x' by Tcl */ if (endp == tok && base == 0) base = 10; @@ -7884,7 +7884,7 @@ static void JimPrngSeed(Jim_Interp *interp, const unsigned char *seed, #ifdef JIM_DYNLIB #ifdef WIN32 #define RTLD_LAZY 0 -void * dlopen(const char *path, int mode) +void * dlopen(const char *path, int mode) { JIM_NOTUSED(mode); @@ -7933,7 +7933,7 @@ int Jim_LoadLibrary(Jim_Interp *interp, const char *pathName) const char *prefix; int prefixlen; Jim_Obj *prefixObjPtr; - + buf[0] = '\0'; if (Jim_ListIndex(interp, libPathObjPtr, i, &prefixObjPtr, JIM_NONE) != JIM_OK) @@ -7943,7 +7943,7 @@ int Jim_LoadLibrary(Jim_Interp *interp, const char *pathName) continue; if (*pathName == '/') { strcpy(buf, pathName); - } + } else if (prefixlen && prefix[prefixlen-1] == '/') sprintf(buf, "%s%s", prefix, pathName); else @@ -8000,7 +8000,7 @@ int Jim_LoadLibrary(Jim_Interp *interp, const char *pathName) #define JIM_PKG_ANY_VERSION -1 /* Convert a string of the type "1.2" into an integer. - * MAJOR.MINOR is converted as MAJOR*100 + MINOR, so "1.2" is converted + * MAJOR.MINOR is converted as MAJOR*100 + MINOR, so "1.2" is converted * to the integer with value 102 */ static int JimPackageVersionToInt(Jim_Interp *interp, const char *v, int *intPtr, int flags) @@ -8958,7 +8958,7 @@ int Jim_EvalFile(Jim_Interp *interp, const char *filename) int nread, totread, maxlen, buflen; int retval; Jim_Obj *scriptObjPtr; - + if ((fp = fopen(filename, "r")) == NULL) { const int cwd_len = 2048; char *cwd = malloc(cwd_len); @@ -9137,7 +9137,7 @@ int Jim_SubstObj(Jim_Interp *interp, Jim_Obj *substObjPtr, * that's: $foo($bar) */ if (script->len == 1 && script->token[0].type == JIM_TT_VAR) { Jim_Obj *varObjPtr = script->token[0].objPtr; - + Jim_IncrRefCount(varObjPtr); resObjPtr = Jim_GetVariable(interp, varObjPtr, JIM_ERRMSG); if (resObjPtr == NULL) { @@ -9162,7 +9162,7 @@ int Jim_SubstObj(Jim_Interp *interp, Jim_Obj *substObjPtr, * to return. */ savedResultObjPtr = interp->result; Jim_IncrRefCount(savedResultObjPtr); - + |