From c0fd219230e4295c44743ad165a0d5a1c980b7dc Mon Sep 17 00:00:00 2001 From: stanton Date: Wed, 11 Nov 1998 04:54:06 +0000 Subject: lots of lint wrapped mutex declarations in ifdefs to avoid compiler warnings --- generic/regc_lex.c | 13 ------------- generic/regc_locale.c | 4 ++-- generic/tclAsync.c | 5 ++++- generic/tclBasic.c | 4 +++- generic/tclClock.c | 5 ++++- generic/tclCmdAH.c | 4 ++-- generic/tclCmdMZ.c | 28 +++------------------------- generic/tclCompExpr.c | 5 ++++- generic/tclCompile.c | 5 ++++- generic/tclEncoding.c | 14 ++++++++------ generic/tclEnv.c | 4 +++- generic/tclEvent.c | 4 +++- generic/tclExecute.c | 4 +++- generic/tclFileName.c | 4 +++- generic/tclIOUtil.c | 6 ++++-- generic/tclInterp.c | 4 +++- generic/tclNamesp.c | 4 +++- generic/tclNotify.c | 4 +++- generic/tclObj.c | 6 +++++- generic/tclParse.c | 4 ++-- generic/tclParseExpr.c | 6 +++--- generic/tclPipe.c | 4 +++- generic/tclPreserve.c | 4 +++- generic/tclProc.c | 4 ++-- generic/tclRegexp.c | 30 +++++++++++++++--------------- generic/tclTest.c | 4 +--- generic/tclThread.c | 6 +++--- generic/tclUniData.c | 4 ++-- generic/tclUtil.c | 6 ++++-- tests/expr.test | 31 ++++++++++++++----------------- unix/tclUnixNotfy.c | 4 +++- unix/tclUnixSock.c | 4 +++- unix/tclUnixTime.c | 4 +++- 33 files changed, 125 insertions(+), 117 deletions(-) diff --git a/generic/regc_lex.c b/generic/regc_lex.c index 0eb6c5d..5b93e0b 100644 --- a/generic/regc_lex.c +++ b/generic/regc_lex.c @@ -977,19 +977,6 @@ newline() } /* - - ch - return the chr sequence for locale.c's fake collating element ch - * This helps confine use of CHR to this source file. - ^ static chr *ch(NOPARMS); - */ -static chr * -ch() -{ - static chr chstr[] = { CHR('c'), CHR('h'), CHR('\0') }; - - return chstr; -} - -/* - chrnamed - return the chr known by a given (chr string) name * The code is a bit clumsy, but this routine gets only such specialized * use that it hardly matters. diff --git a/generic/regc_locale.c b/generic/regc_locale.c index 5930378..192b266 100644 --- a/generic/regc_locale.c +++ b/generic/regc_locale.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: regc_locale.c,v 1.1.2.3 1998/11/11 01:44:49 stanton Exp $ + * RCS: @(#) $Id: regc_locale.c,v 1.1.2.4 1998/11/11 04:54:06 stanton Exp $ */ /* ASCII character-name table */ @@ -572,7 +572,7 @@ chr *endp; /* just past the end of the name */ int cases; /* case-independent? */ { size_t len; - struct cvec *cv; + struct cvec *cv = NULL; Tcl_DString ds; char *np, **namePtr; int i, index; diff --git a/generic/tclAsync.c b/generic/tclAsync.c index 8abe3c5..8f04d67 100644 --- a/generic/tclAsync.c +++ b/generic/tclAsync.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclAsync.c,v 1.1.2.2 1998/09/24 23:58:40 stanton Exp $ + * RCS: @(#) $Id: tclAsync.c,v 1.1.2.3 1998/11/11 04:54:06 stanton Exp $ */ #include "tclInt.h" @@ -41,7 +41,10 @@ typedef struct AsyncHandler { static AsyncHandler *firstHandler; /* First handler defined for process, * or NULL if none. */ static AsyncHandler *lastHandler; /* Last handler or NULL. */ + +#ifdef TCL_THREAD static Tcl_Mutex asyncMutex; /* Process-wide async handler lock */ +#endif /* * The variable below is set to 1 whenever a handler becomes ready and diff --git a/generic/tclBasic.c b/generic/tclBasic.c index fcc1f93..f1c0fbd 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclBasic.c,v 1.1.2.4 1998/10/21 20:40:02 stanton Exp $ + * RCS: @(#) $Id: tclBasic.c,v 1.1.2.5 1998/11/11 04:54:07 stanton Exp $ */ #include "tclInt.h" @@ -599,7 +599,9 @@ Tcl_CallWhenDeleted(interp, proc, clientData) { Interp *iPtr = (Interp *) interp; static int assocDataCounter = 0; +#ifdef TCL_THREAD static Tcl_Mutex assocMutex; +#endif int new; char buffer[32 + TCL_INTEGER_SPACE]; AssocData *dPtr = (AssocData *) ckalloc(sizeof(AssocData)); diff --git a/generic/tclClock.c b/generic/tclClock.c index 93a4a7a..0faef9d 100644 --- a/generic/tclClock.c +++ b/generic/tclClock.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclClock.c,v 1.1.2.2 1998/09/24 23:58:41 stanton Exp $ + * RCS: @(#) $Id: tclClock.c,v 1.1.2.3 1998/11/11 04:54:07 stanton Exp $ */ #include "tcl.h" @@ -21,7 +21,10 @@ /* * The date parsing stuff uses lexx and has tons o statics. */ + +#ifdef TCL_THREAD static Tcl_Mutex clockMutex; +#endif /* * Function prototypes for local procedures in this file: diff --git a/generic/tclCmdAH.c b/generic/tclCmdAH.c index 91070ed..f77072e 100644 --- a/generic/tclCmdAH.c +++ b/generic/tclCmdAH.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclCmdAH.c,v 1.1.2.5 1998/11/10 02:40:58 stanton Exp $ + * RCS: @(#) $Id: tclCmdAH.c,v 1.1.2.6 1998/11/11 04:54:07 stanton Exp $ */ #include "tclInt.h" @@ -2211,7 +2211,7 @@ Tcl_FormatObjCmd(dummy, interp, objc, objv) size = Tcl_UtfAtIndex(ptrValue, stringLen) - ptrValue; if (size) { - memcpy(ptr, ptrValue, size); + memcpy(ptr, ptrValue, (size_t) size); ptr += size; } while (pad > 0) { diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c index 1a1cf2a..1671fef 100644 --- a/generic/tclCmdMZ.c +++ b/generic/tclCmdMZ.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclCmdMZ.c,v 1.1.2.5 1998/11/11 01:44:52 stanton Exp $ + * RCS: @(#) $Id: tclCmdMZ.c,v 1.1.2.6 1998/11/11 04:54:08 stanton Exp $ */ #include "tclInt.h" @@ -112,7 +112,7 @@ Tcl_RegexpObjCmd(dummy, interp, objc, objv) Tcl_Obj *CONST objv[]; /* Argument objects. */ { int i, result, indices, stringLength, wLen, match, about; - int hasxflags, cflags, eflags; + int cflags, eflags; Tcl_RegExp regExpr; char *string; Tcl_DString stringBuffer, valueBuffer; @@ -120,29 +120,18 @@ Tcl_RegexpObjCmd(dummy, interp, objc, objv) static char *options[] = { "-indices", "-nocase", "-about", "-expanded", "-line", "-linestop", "-lineanchor", -#ifdef REGEXP_TEST - "-xflags", -#endif "--", (char *) NULL }; enum options { REGEXP_INDICES, REGEXP_NOCASE, REGEXP_ABOUT, REGEXP_EXPANDED, REGEXP_MULTI, REGEXP_NOCROSS, REGEXP_NEWL, -#ifdef REGEXP_TEST - REGEXP_XFLAGS, -#endif REGEXP_LAST }; -#ifndef REGEXP_TEST -# define REGEXP_XFLAGS -1 /* impossible value */ -# define TclRegXflags(a,b,c,d) /* do nothing */ -#endif indices = 0; about = 0; cflags = REG_ADVANCED; eflags = 0; - hasxflags = 0; for (i = 1; i < objc; i++) { char *name; @@ -185,10 +174,6 @@ Tcl_RegexpObjCmd(dummy, interp, objc, objv) cflags |= REG_NLANCH; break; } - case REGEXP_XFLAGS: { - hasxflags = 1; - break; - } case REGEXP_LAST: { i++; goto endOfForLoop; @@ -197,7 +182,7 @@ Tcl_RegexpObjCmd(dummy, interp, objc, objv) } endOfForLoop: - if (objc - i < hasxflags + 2 - about) { + if (objc - i < 2 - about) { Tcl_WrongNumArgs(interp, 1, objv, "?switches? exp string ?matchVar? ?subMatchVar subMatchVar ...?"); return TCL_ERROR; @@ -205,13 +190,6 @@ Tcl_RegexpObjCmd(dummy, interp, objc, objv) objc -= i; objv += i; - if (hasxflags) { - string = Tcl_GetStringFromObj(objv[0], &stringLength); - TclRegXflags(string, stringLength, &cflags, &eflags); - objc--; - objv++; - } - regExpr = TclRegCompObj(interp, objv[0], cflags); if (regExpr == NULL) { return TCL_ERROR; diff --git a/generic/tclCompExpr.c b/generic/tclCompExpr.c index 0f494b9..d56cb5a 100644 --- a/generic/tclCompExpr.c +++ b/generic/tclCompExpr.c @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclCompExpr.c,v 1.1.2.3 1998/10/06 00:42:45 stanton Exp $ + * RCS: @(#) $Id: tclCompExpr.c,v 1.1.2.4 1998/11/11 04:54:09 stanton Exp $ */ #include "tclInt.h" @@ -108,7 +108,10 @@ typedef struct ExprInfo { */ static int opTableInitialized = 0; /* 0 means not yet initialized. */ + +#ifdef TCL_THREAD static Tcl_Mutex opMutex; +#endif typedef struct OperatorDesc { char *name; /* Name of the operator. */ diff --git a/generic/tclCompile.c b/generic/tclCompile.c index a35b310..9d229fb 100644 --- a/generic/tclCompile.c +++ b/generic/tclCompile.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclCompile.c,v 1.1.2.5 1998/11/11 00:15:55 stanton Exp $ + * RCS: @(#) $Id: tclCompile.c,v 1.1.2.6 1998/11/11 04:54:09 stanton Exp $ */ #include "tclInt.h" @@ -22,7 +22,10 @@ static Tcl_HashTable auxDataTypeTable; static int auxDataTypeTableInitialized; /* 0 means not yet initialized. */ + +#ifdef TCL_THREAD static Tcl_Mutex tableMutex; +#endif /* * Variable that controls whether compilation tracing is enabled and, if so, diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c index 06da42e..8e4f539 100644 --- a/generic/tclEncoding.c +++ b/generic/tclEncoding.c @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclEncoding.c,v 1.1.2.3 1998/10/21 20:40:05 stanton Exp $ + * RCS: @(#) $Id: tclEncoding.c,v 1.1.2.4 1998/11/11 04:54:12 stanton Exp $ */ #include "tclInt.h" @@ -141,7 +141,9 @@ typedef struct EscapeEncodingData { */ static Tcl_HashTable encodingTable; +#ifdef TCL_THREAD static Tcl_Mutex encodingMutex; +#endif /* * The following are used to hold the default and current system encodings. @@ -1177,8 +1179,8 @@ LoadTableEncoding(interp, name, type, chan) TableEncodingData *dataPtr; unsigned short *pageMemPtr; Tcl_EncodingType encType; - unsigned char *hex; - static unsigned char staticHex[] = { + char *hex; + static char staticHex[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 0, 0, 10, 11, 12, 13, 14, 15 }; @@ -1232,15 +1234,15 @@ LoadTableEncoding(interp, name, type, chan) Tcl_ReadChars(chan, objPtr, 3 + 16 * (16 * 4 + 1), 0); p = Tcl_GetString(objPtr); - hi = (hex[p[0]] << 4) + hex[p[1]]; + hi = (hex[(int)p[0]] << 4) + hex[(int)p[1]]; dataPtr->toUnicode[hi] = pageMemPtr; p += 2; for (lo = 0; lo < 256; lo++) { if ((lo & 0x0f) == 0) { p++; } - ch = (hex[p[0]] << 12) + (hex[p[1]] << 8) + (hex[p[2]] << 4) - + hex[p[3]]; + ch = (hex[(int)p[0]] << 12) + (hex[(int)p[1]] << 8) + + (hex[(int)p[2]] << 4) + hex[(int)p[3]]; if (ch != 0) { used[ch >> 8] = 1; } diff --git a/generic/tclEnv.c b/generic/tclEnv.c index 0e471f0..b73954d 100644 --- a/generic/tclEnv.c +++ b/generic/tclEnv.c @@ -12,13 +12,15 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclEnv.c,v 1.1.2.2 1998/09/24 23:58:47 stanton Exp $ + * RCS: @(#) $Id: tclEnv.c,v 1.1.2.3 1998/11/11 04:54:13 stanton Exp $ */ #include "tclInt.h" #include "tclPort.h" +#ifdef TCL_THREAD static Tcl_Mutex envMutex; /* To serialize access to environ */ +#endif static int cacheSize = 0; /* Number of env strings in environCache. */ static char **environCache = NULL; diff --git a/generic/tclEvent.c b/generic/tclEvent.c index 20935a9..6c170bd 100644 --- a/generic/tclEvent.c +++ b/generic/tclEvent.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclEvent.c,v 1.1.2.3 1998/10/06 00:36:19 stanton Exp $ + * RCS: @(#) $Id: tclEvent.c,v 1.1.2.4 1998/11/11 04:54:13 stanton Exp $ */ #include "tclInt.h" @@ -76,7 +76,9 @@ typedef struct ExitHandler { static ExitHandler *firstExitPtr = NULL; /* First in list of all exit handlers for * application. */ +#ifdef TCL_THREAD static Tcl_Mutex exitMutex; +#endif /* * This variable is set to 1 when Tcl_Finalize is called, and at the end of diff --git a/generic/tclExecute.c b/generic/tclExecute.c index d767522..32dcfa2 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclExecute.c,v 1.1.2.3 1998/10/06 00:36:30 stanton Exp $ + * RCS: @(#) $Id: tclExecute.c,v 1.1.2.4 1998/11/11 04:54:13 stanton Exp $ */ #include "tclInt.h" @@ -48,7 +48,9 @@ int errno; */ static int execInitialized = 0; +#ifdef TCL_THREAD static Tcl_Mutex execMutex; +#endif /* * Variable that controls whether execution tracing is enabled and, if so, diff --git a/generic/tclFileName.c b/generic/tclFileName.c index 55832ab..6366bdf 100644 --- a/generic/tclFileName.c +++ b/generic/tclFileName.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclFileName.c,v 1.1.2.4 1998/10/21 20:40:05 stanton Exp $ + * RCS: @(#) $Id: tclFileName.c,v 1.1.2.5 1998/11/11 04:54:15 stanton Exp $ */ #include "tclInt.h" @@ -46,7 +46,9 @@ static int initialized = 0; static Tcl_Obj *winRootPatternPtr = NULL; static Tcl_Obj *macRootPatternPtr = NULL; +#ifdef TCL_THREAD static Tcl_Mutex nameMutex; +#endif /* * The following variable is set in the TclPlatformInit call to one diff --git a/generic/tclIOUtil.c b/generic/tclIOUtil.c index 133f41b..0701cde 100644 --- a/generic/tclIOUtil.c +++ b/generic/tclIOUtil.c @@ -13,7 +13,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclIOUtil.c,v 1.1.2.4 1998/09/30 20:46:25 stanton Exp $ + * RCS: @(#) $Id: tclIOUtil.c,v 1.1.2.5 1998/11/11 04:54:15 stanton Exp $ */ #include "tclInt.h" @@ -75,8 +75,10 @@ static OpenFileChannelProc defaultOpenFileChannelProc = { static OpenFileChannelProc *openFileChannelProcList = &defaultOpenFileChannelProc; +#ifdef TCL_THREAD static Tcl_Mutex hookMutex; - + #endif + /* *--------------------------------------------------------------------------- * diff --git a/generic/tclInterp.c b/generic/tclInterp.c index 1a291b8..98cd807 100644 --- a/generic/tclInterp.c +++ b/generic/tclInterp.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclInterp.c,v 1.1.2.3 1998/10/06 00:37:17 stanton Exp $ + * RCS: @(#) $Id: tclInterp.c,v 1.1.2.4 1998/11/11 04:54:15 stanton Exp $ */ #include @@ -21,7 +21,9 @@ */ static int aliasCounter = 0; +#ifdef TCL_THREAD static Tcl_Mutex cntMutex; +#endif /* * struct Alias: diff --git a/generic/tclNamesp.c b/generic/tclNamesp.c index af1b8a9..2aee8a4 100644 --- a/generic/tclNamesp.c +++ b/generic/tclNamesp.c @@ -19,7 +19,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclNamesp.c,v 1.1.2.2 1998/09/24 23:58:57 stanton Exp $ + * RCS: @(#) $Id: tclNamesp.c,v 1.1.2.3 1998/11/11 04:54:16 stanton Exp $ */ #include "tclInt.h" @@ -46,7 +46,9 @@ */ static long numNsCreated = 0; +#ifdef TCL_THREAD static Tcl_Mutex nsMutex; +#endif /* * This structure contains a cached pointer to a namespace that is the diff --git a/generic/tclNotify.c b/generic/tclNotify.c index b58a347..a103f5d 100644 --- a/generic/tclNotify.c +++ b/generic/tclNotify.c @@ -13,7 +13,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclNotify.c,v 1.1.2.3 1998/11/11 04:08:22 stanton Exp $ + * RCS: @(#) $Id: tclNotify.c,v 1.1.2.4 1998/11/11 04:54:17 stanton Exp $ */ #include "tclInt.h" @@ -80,7 +80,9 @@ static Tcl_ThreadDataKey dataKey; */ static ThreadSpecificData *firstNotifierPtr; +#ifdef TCL_THREAD static Tcl_Mutex listLock; +#endif /* * Declarations for routines used only in this file. diff --git a/generic/tclObj.c b/generic/tclObj.c index e6a8bb2..834b681 100644 --- a/generic/tclObj.c +++ b/generic/tclObj.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclObj.c,v 1.1.2.3 1998/10/06 02:59:04 stanton Exp $ + * RCS: @(#) $Id: tclObj.c,v 1.1.2.4 1998/11/11 04:54:17 stanton Exp $ */ #include "tclInt.h" @@ -21,7 +21,9 @@ static Tcl_HashTable typeTable; static int typeTableInitialized = 0; /* 0 means not yet initialized. */ +#ifdef TCL_THREAD static Tcl_Mutex tableMutex; +#endif /* * Head of the list of free Tcl_Objs we maintain. @@ -34,7 +36,9 @@ Tcl_Obj *tclFreeObjList = NULL; * by the TclNewObj macro, however, so must be visible. */ +#ifdef TCL_THREAD Tcl_Mutex tclObjMutex; +#endif /* * Pointer to a heap-allocated string of length zero that the Tcl core uses diff --git a/generic/tclParse.c b/generic/tclParse.c index 8fd981a..f7eff3a 100644 --- a/generic/tclParse.c +++ b/generic/tclParse.c @@ -13,7 +13,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclParse.c,v 1.1.2.3 1998/09/30 20:46:26 stanton Exp $ + * RCS: @(#) $Id: tclParse.c,v 1.1.2.4 1998/11/11 04:54:18 stanton Exp $ */ #include "tclInt.h" @@ -55,7 +55,7 @@ #define TYPE_CLOSE_BRACK 0x20 #define TYPE_BRACE 0x40 -#define CHAR_TYPE(c) (typeTable+128)[c] +#define CHAR_TYPE(c) (typeTable+128)[(int)(c)] char typeTable[] = { /* diff --git a/generic/tclParseExpr.c b/generic/tclParseExpr.c index 1bd2a14..e177dae 100644 --- a/generic/tclParseExpr.c +++ b/generic/tclParseExpr.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclParseExpr.c,v 1.1.2.2 1998/10/03 01:56:41 stanton Exp $ + * RCS: @(#) $Id: tclParseExpr.c,v 1.1.2.3 1998/11/11 04:54:18 stanton Exp $ */ #include "tclInt.h" @@ -1714,9 +1714,9 @@ GetLexeme(infoPtr) default: offset = Tcl_UtfToUniChar(src, &ch); c = UCHAR(ch); - if (isalpha(c)) { /* INTL: ISO only. */ + if (isalpha(UCHAR(c))) { /* INTL: ISO only. */ infoPtr->lexeme = FUNC_NAME; - while (isalnum(c) || (c == '_')) { /* INTL: ISO only. */ + while (isalnum(UCHAR(c)) || (c == '_')) { /* INTL: ISO only. */ src += offset; offset = Tcl_UtfToUniChar(src, &ch); c = UCHAR(ch); diff --git a/generic/tclPipe.c b/generic/tclPipe.c index 2ad8a45..d8550df 100644 --- a/generic/tclPipe.c +++ b/generic/tclPipe.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclPipe.c,v 1.1.2.2 1998/09/24 23:59:00 stanton Exp $ + * RCS: @(#) $Id: tclPipe.c,v 1.1.2.3 1998/11/11 04:54:18 stanton Exp $ */ #include "tclInt.h" @@ -32,7 +32,9 @@ typedef struct Detached { } Detached; static Detached *detList = NULL; /* List of all detached proceses. */ +#ifdef TCL_THREAD static Tcl_Mutex pipeMutex; /* Guard access to detList. */ +#endif /* * Declarations for local procedures defined in this file: diff --git a/generic/tclPreserve.c b/generic/tclPreserve.c index b9ee5ee..26c9031 100644 --- a/generic/tclPreserve.c +++ b/generic/tclPreserve.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclPreserve.c,v 1.1.2.2 1998/09/24 23:59:02 stanton Exp $ + * RCS: @(#) $Id: tclPreserve.c,v 1.1.2.3 1998/11/11 04:54:19 stanton Exp $ */ #include "tclInt.h" @@ -40,7 +40,9 @@ static int spaceAvl = 0; /* Total number of structures available static int inUse = 0; /* Count of structures currently in use * in refArray. */ #define INITIAL_SIZE 2 +#ifdef TCL_THREAD static Tcl_Mutex preserveMutex; /* To protect the above statics */ +#endif /* * The following data structure is used to keep track of whether an diff --git a/generic/tclProc.c b/generic/tclProc.c index 3c1b5ea..93179c6 100644 --- a/generic/tclProc.c +++ b/generic/tclProc.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclProc.c,v 1.1.2.4 1998/10/06 02:59:05 stanton Exp $ + * RCS: @(#) $Id: tclProc.c,v 1.1.2.5 1998/11/11 04:54:19 stanton Exp $ */ #include "tclInt.h" @@ -189,7 +189,7 @@ TclCreateProc(interp, nsPtr, procName, argsPtr, bodyPtr, procPtrPtr) register Proc *procPtr; int i, length, result, numArgs; char *args, *bytes, *p; - register CompiledLocal *localPtr; + register CompiledLocal *localPtr = NULL; Tcl_Obj *defPtr; int precompiled = 0; diff --git a/generic/tclRegexp.c b/generic/tclRegexp.c index a4c9c37..a619d5b 100644 --- a/generic/tclRegexp.c +++ b/generic/tclRegexp.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclRegexp.c,v 1.1.2.4 1998/11/11 01:44:53 stanton Exp $ + * RCS: @(#) $Id: tclRegexp.c,v 1.1.2.5 1998/11/11 04:54:19 stanton Exp $ */ #include "tclInt.h" @@ -545,20 +545,20 @@ TclRegAbout(interp, re) int bit; char *text; } infonames[] = { - REG_UBACKREF, "REG_UBACKREF", - REG_ULOOKAHEAD, "REG_ULOOKAHEAD", - REG_UBOUNDS, "REG_UBOUNDS", - REG_UBRACES, "REG_UBRACES", - REG_UBSALNUM, "REG_UBSALNUM", - REG_UPBOTCH, "REG_UPBOTCH", - REG_UBBS, "REG_UBBS", - REG_UNONPOSIX, "REG_UNONPOSIX", - REG_UUNSPEC, "REG_UUNSPEC", - REG_UUNPORT, "REG_UUNPORT", - REG_ULOCALE, "REG_ULOCALE", - REG_UEMPTYMATCH, "REG_UEMPTYMATCH", - REG_UIMPOSSIBLE, "REG_UIMPOSSIBLE", - 0, "", + {REG_UBACKREF, "REG_UBACKREF"}, + {REG_ULOOKAHEAD, "REG_ULOOKAHEAD"}, + {REG_UBOUNDS, "REG_UBOUNDS"}, + {REG_UBRACES, "REG_UBRACES"}, + {REG_UBSALNUM, "REG_UBSALNUM"}, + {REG_UPBOTCH, "REG_UPBOTCH"}, + {REG_UBBS, "REG_UBBS"}, + {REG_UNONPOSIX, "REG_UNONPOSIX"}, + {REG_UUNSPEC, "REG_UUNSPEC"}, + {REG_UUNPORT, "REG_UUNPORT"}, + {REG_ULOCALE, "REG_ULOCALE"}, + {REG_UEMPTYMATCH, "REG_UEMPTYMATCH"}, + {REG_UIMPOSSIBLE, "REG_UIMPOSSIBLE"}, + {0, ""} }; struct infoname *inf; int n; diff --git a/generic/tclTest.c b/generic/tclTest.c index eee8c37..709883a 100644 --- a/generic/tclTest.c +++ b/generic/tclTest.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclTest.c,v 1.1.2.5 1998/11/11 04:08:22 stanton Exp $ + * RCS: @(#) $Id: tclTest.c,v 1.1.2.6 1998/11/11 04:54:19 stanton Exp $ */ #define TCL_TEST @@ -154,8 +154,6 @@ static int NoopObjCmd _ANSI_ARGS_((ClientData clientData, Tcl_Obj *CONST objv[])); static void PrintParse _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Parse *parsePtr)); -static int RegGetCompFlags _ANSI_ARGS_((char *s)); -static int RegGetExecFlags _ANSI_ARGS_((char *s)); static void SpecialFree _ANSI_ARGS_((char *blockPtr)); static int StaticInitProc _ANSI_ARGS_((Tcl_Interp *interp)); static int TestaccessprocCmd _ANSI_ARGS_((ClientData dummy, diff --git a/generic/tclThread.c b/generic/tclThread.c index a093824..14bb1ba 100644 --- a/generic/tclThread.c +++ b/generic/tclThread.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclThread.c,v 1.1.2.2 1998/10/03 01:56:42 stanton Exp $ + * RCS: @(#) $Id: tclThread.c,v 1.1.2.3 1998/11/11 04:54:20 stanton Exp $ */ #include "tclInt.h" @@ -127,8 +127,8 @@ Tcl_GetThreadData(keyPtr, size) } #else if (*keyPtr == NULL) { - result = (VOID *)ckalloc(size); - memset((char *)result, 0, size); + result = (VOID *)ckalloc((size_t)size); + memset((char *)result, 0, (size_t)size); *keyPtr = (Tcl_ThreadDataKey)result; TclRememberDataKey(keyPtr); } diff --git a/generic/tclUniData.c b/generic/tclUniData.c index 7c9a568..e97b6d4 100644 --- a/generic/tclUniData.c +++ b/generic/tclUniData.c @@ -8,7 +8,7 @@ * Copyright (c) 1998 by Scriptics Corporation. * All rights reserved. * - * RCS: @(#) $Id: tclUniData.c,v 1.1.2.1 1998/11/04 04:39:52 stanton Exp $ + * RCS: @(#) $Id: tclUniData.c,v 1.1.2.2 1998/11/11 04:54:21 stanton Exp $ */ /* @@ -617,5 +617,5 @@ enum { * Unicode character tables. */ -#define GetUniCharInfo(ch) (groups[groupMap[(pageMap[(((int)(ch)) & 0xffff) >> OFFSET_BITS] << OFFSET_BITS) | ((ch) & ((1 << OFFSET_BITS)-1))]]) +#define GetUniCharInfo(ch) (groups[(int)groupMap[(int)((pageMap[(((int)(ch)) & 0xffff) >> OFFSET_BITS] << OFFSET_BITS) | ((ch) & ((1 << OFFSET_BITS)-1)))]]) diff --git a/generic/tclUtil.c b/generic/tclUtil.c index 1c2338b..9fe3e3f 100644 --- a/generic/tclUtil.c +++ b/generic/tclUtil.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclUtil.c,v 1.1.2.2 1998/09/24 23:59:04 stanton Exp $ + * RCS: @(#) $Id: tclUtil.c,v 1.1.2.3 1998/11/11 04:54:21 stanton Exp $ */ #include "tclInt.h" @@ -59,7 +59,9 @@ static char precisionString[10] = "12"; static char precisionFormat[10] = "%.12g"; /* The format string actually used in calls * to sprintf. */ +#ifdef TCL_THREAD static Tcl_Mutex precisionMutex; +#endif /* @@ -1687,7 +1689,7 @@ Tcl_PrintDouble(interp, value, dst) for (p = dst; *p != 0; ) { p += Tcl_UtfToUniChar(p, &ch); c = UCHAR(ch); - if ((c == '.') || isalpha(c)) { /* INTL: ISO only. */ + if ((c == '.') || isalpha(UCHAR(c))) { /* INTL: ISO only. */ return; } } diff --git a/tests/expr.test b/tests/expr.test index 3c743ce..d20c78f 100644 --- a/tests/expr.test +++ b/tests/expr.test @@ -9,7 +9,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: expr.test,v 1.1.2.1 1998/09/24 23:59:24 stanton Exp $ +# RCS: @(#) $Id: expr.test,v 1.1.2.2 1998/11/11 04:54:21 stanton Exp $ if {[string compare test [info procs test]] == 1} then {source defs} @@ -88,7 +88,7 @@ test expr-1.5 {TclCompileExprCmd: quoted expression word} { test expr-1.6 {TclCompileExprCmd: quoted expression word} { catch {expr "0005"zxy} msg set msg -} {quoted string doesn't terminate properly} +} {extra characters after close-quote} test expr-1.7 {TclCompileExprCmd: expression word in braces} { expr {-0005} } -5 @@ -98,7 +98,7 @@ test expr-1.8 {TclCompileExprCmd: expression word in braces} { test expr-1.9 {TclCompileExprCmd: expression word in braces} { catch {expr {-0005}foo} msg set msg -} {argument word in braces doesn't terminate properly} +} {extra characters after close-brace} test expr-1.10 {TclCompileExprCmd: other expression word in braces} { expr 4*[llength "6 2"] } 8 @@ -479,7 +479,6 @@ test expr-14.16 {CompilePrimaryExpr: error compiling var reference primary} { catch {expr {$a(foo}} msg set errorInfo } {missing ) - (parsing index for array "a") while compiling "expr {$a(foo}"} test expr-14.17 {CompilePrimaryExpr: string primary that looks like var ref} { @@ -516,9 +515,7 @@ test expr-14.23 {CompilePrimaryExpr: error in subcommand primary} { test expr-14.24 {CompilePrimaryExpr: error in subcommand primary} { catch {expr {[set i}} msg set errorInfo -} {missing close-bracket or close-brace - while compiling -"set i" +} {missing close-bracket while compiling "expr {[set i}"} test expr-14.25 {CompilePrimaryExpr: math function primary} { @@ -531,7 +528,7 @@ test expr-14.27 {CompilePrimaryExpr: error in math function primary} { catch {expr sinh::(2.0)} msg set errorInfo } {syntax error in expression "sinh::(2.0)" - while executing + while compiling "expr sinh::(2.0)"} test expr-14.28 {CompilePrimaryExpr: subexpression primary} { expr 2+(3*4) @@ -548,7 +545,7 @@ test expr-14.30 {CompilePrimaryExpr: missing paren in subexpression primary} { catch {expr 2+(3*(4+5)} msg set errorInfo } {syntax error in expression "2+(3*(4+5)" - while executing + while compiling "expr 2+(3*(4+5)"} test expr-14.31 {CompilePrimaryExpr: just var ref in subexpression primary} { set i "5+10" @@ -558,44 +555,44 @@ test expr-14.32 {CompilePrimaryExpr: unexpected token} { catch {expr @} msg set errorInfo } {syntax error in expression "@" - while executing + while compiling "expr @"} test expr-15.1 {CompileMathFuncCall: missing parenthesis} { catch {expr sinh2.0)} msg set errorInfo } {syntax error in expression "sinh2.0)" - while executing + while compiling "expr sinh2.0)"} test expr-15.2 {CompileMathFuncCall: unknown math function} { catch {expr whazzathuh(1)} msg set errorInfo } {unknown math function "whazzathuh" - while executing + while compiling "expr whazzathuh(1)"} test expr-15.3 {CompileMathFuncCall: too many arguments} { catch {expr sin(1,2,3)} msg set errorInfo } {too many arguments for math function - while executing + while compiling "expr sin(1,2,3)"} test expr-15.4 {CompileMathFuncCall: ')' found before last required arg} { catch {expr sin()} msg set errorInfo -} {syntax error in expression "sin()" - while executing +} {too few arguments for math function + while compiling "expr sin()"} test expr-15.5 {CompileMathFuncCall: too few arguments} { catch {expr pow(1)} msg set errorInfo } {too few arguments for math function - while executing + while compiling "expr pow(1)"} test expr-15.6 {CompileMathFuncCall: missing ')'} { catch {expr sin(1} msg set errorInfo } {syntax error in expression "sin(1" - while executing + while compiling "expr sin(1"} if $gotT1 { test expr-15.7 {CompileMathFuncCall: call registered math function} { diff --git a/unix/tclUnixNotfy.c b/unix/tclUnixNotfy.c index f0d2250..1a09d29 100644 --- a/unix/tclUnixNotfy.c +++ b/unix/tclUnixNotfy.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclUnixNotfy.c,v 1.1.2.2 1998/09/24 23:59:45 stanton Exp $ + * RCS: @(#) $Id: tclUnixNotfy.c,v 1.1.2.3 1998/11/11 04:54:22 stanton Exp $ */ #include "tclInt.h" @@ -166,7 +166,9 @@ static Tcl_ThreadId notifierThread; * Static routines defined in this file. */ +#ifdef TCL_THREAD static void NotifierThreadProc _ANSI_ARGS_((ClientData clientData)); +#endif static int FileHandlerEventProc _ANSI_ARGS_((Tcl_Event *evPtr, int flags)); diff --git a/unix/tclUnixSock.c b/unix/tclUnixSock.c index fb904e4..96b2397 100644 --- a/unix/tclUnixSock.c +++ b/unix/tclUnixSock.c @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclUnixSock.c,v 1.1.2.2 1998/09/24 23:59:46 stanton Exp $ + * RCS: @(#) $Id: tclUnixSock.c,v 1.1.2.3 1998/11/11 04:54:22 stanton Exp $ */ #include "tcl.h" @@ -41,7 +41,9 @@ static char hostname[TCL_HOSTNAME_LEN + 1]; static int hostnameInited = 0; +#ifdef TCL_THREAD static Tcl_Mutex hostMutex; +#endif /* diff --git a/unix/tclUnixTime.c b/unix/tclUnixTime.c index fe68774..479143c 100644 --- a/unix/tclUnixTime.c +++ b/unix/tclUnixTime.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclUnixTime.c,v 1.1.2.2 1998/09/24 23:59:47 stanton Exp $ + * RCS: @(#) $Id: tclUnixTime.c,v 1.1.2.3 1998/11/11 04:54:22 stanton Exp $ */ #include "tclInt.h" @@ -165,7 +165,9 @@ TclpGetTimeZone (currentTime) #if defined(HAVE_TIMEZONE_VAR) && !defined (TCL_GOT_TIMEZONE) # define TCL_GOT_TIMEZONE static int setTZ = 0; +#ifdef TCL_THREAD static Tcl_Mutex tzMutex; +#endif int timeZone; Tcl_MutexLock(&tzMutex); -- cgit v0.12