From 539d5f44840714a8f558d4c2999b8b60271661e0 Mon Sep 17 00:00:00 2001 From: dkf Date: Fri, 10 May 2024 15:40:16 +0000 Subject: More whitespace cleanup --- generic/tcl.h | 182 +++++++++++++++++++++++--------------------- generic/tclBasic.c | 6 +- generic/tclBinary.c | 1 - generic/tclCkalloc.c | 39 +++++----- generic/tclClock.c | 5 -- generic/tclCmdAH.c | 15 ++-- generic/tclCmdIL.c | 1 - generic/tclCompCmds.c | 4 - generic/tclCompCmdsSZ.c | 1 - generic/tclCompExpr.c | 2 +- generic/tclDisassemble.c | 19 +++-- generic/tclEncoding.c | 24 +++--- generic/tclEnv.c | 9 +-- generic/tclEvent.c | 2 - generic/tclExecute.c | 2 - generic/tclHash.c | 4 +- generic/tclIO.c | 27 +++---- generic/tclIO.h | 4 +- generic/tclIOCmd.c | 1 - generic/tclIORChan.c | 57 +++++++------- generic/tclIORTrans.c | 28 ++++--- generic/tclIOSock.c | 8 +- generic/tclIOUtil.c | 63 +++++++-------- generic/tclInt.h | 1 - generic/tclInterp.c | 5 +- generic/tclListObj.c | 5 +- generic/tclLoad.c | 31 +++----- generic/tclNamesp.c | 5 +- generic/tclOOCall.c | 1 - generic/tclObj.c | 2 - generic/tclPanic.c | 1 - generic/tclParse.c | 2 +- generic/tclPathObj.c | 2 - generic/tclProc.c | 61 ++++++++------- generic/tclProcess.c | 4 +- generic/tclRegexp.c | 25 +++--- generic/tclStrToD.c | 3 - generic/tclStringObj.c | 2 - generic/tclStringRep.h | 1 - generic/tclStubLibTbl.c | 10 +-- generic/tclThread.c | 1 - generic/tclTomMathStubLib.c | 1 - generic/tclTrace.c | 1 - generic/tclUtf.c | 2 - generic/tclUtil.c | 8 +- generic/tclZipfs.c | 27 ++++--- macosx/tclMacOSXNotify.c | 1 - unix/tclKqueueNotfy.c | 3 +- unix/tclLoadNext.c | 1 - unix/tclLoadOSF.c | 1 - unix/tclUnixInit.c | 1 - win/tclWinChan.c | 5 +- win/tclWinConsole.c | 5 +- win/tclWinFCmd.c | 1 - win/tclWinInt.h | 4 +- win/tclWinPipe.c | 1 - win/tclWinPort.h | 3 - win/tclWinSerial.c | 2 - win/tclWinThrd.c | 24 +++--- win/tclWinTime.c | 1 - 60 files changed, 328 insertions(+), 430 deletions(-) diff --git a/generic/tcl.h b/generic/tcl.h index e40e8a9..947e4a7 100644 --- a/generic/tcl.h +++ b/generic/tcl.h @@ -48,15 +48,15 @@ extern "C" { */ #if !defined(TCL_MAJOR_VERSION) -# define TCL_MAJOR_VERSION 9 +# define TCL_MAJOR_VERSION 9 #endif #if TCL_MAJOR_VERSION == 9 -# define TCL_MINOR_VERSION 0 -# define TCL_RELEASE_LEVEL TCL_BETA_RELEASE -# define TCL_RELEASE_SERIAL 2 +# define TCL_MINOR_VERSION 0 +# define TCL_RELEASE_LEVEL TCL_BETA_RELEASE +# define TCL_RELEASE_SERIAL 2 -# define TCL_VERSION "9.0" -# define TCL_PATCH_LEVEL "9.0b2" +# define TCL_VERSION "9.0" +# define TCL_PATCH_LEVEL "9.0b2" #endif /* TCL_MAJOR_VERSION */ #if defined(RC_INVOKED) @@ -90,7 +90,8 @@ extern "C" { * Special macro to define mutexes. */ -#define TCL_DECLARE_MUTEX(name) static Tcl_Mutex name; +#define TCL_DECLARE_MUTEX(name) \ + static Tcl_Mutex name; /* * Tcl's public routine Tcl_FSSeek() uses the values SEEK_SET, SEEK_CUR, and @@ -464,9 +465,9 @@ typedef void (Tcl_ThreadCreateProc) (void *clientData); typedef struct Tcl_RegExpIndices { #if TCL_MAJOR_VERSION > 8 - Tcl_Size start; /* Character offset of first character in + Tcl_Size start; /* Character offset of first character in * match. */ - Tcl_Size end; /* Character offset of first character after + Tcl_Size end; /* Character offset of first character after * the match. */ #else long start; @@ -475,11 +476,11 @@ typedef struct Tcl_RegExpIndices { } Tcl_RegExpIndices; typedef struct Tcl_RegExpInfo { - Tcl_Size nsubs; /* Number of subexpressions in the compiled + Tcl_Size nsubs; /* Number of subexpressions in the compiled * expression. */ Tcl_RegExpIndices *matches; /* Array of nsubs match offset pairs. */ #if TCL_MAJOR_VERSION > 8 - Tcl_Size extendStart; /* The offset at which a subsequent match + Tcl_Size extendStart; /* The offset at which a subsequent match * might begin. */ #else long extendStart; @@ -615,28 +616,25 @@ typedef void (Tcl_ServiceModeHookProc) (int mode); typedef void *(Tcl_InitNotifierProc) (void); typedef void (Tcl_FinalizeNotifierProc) (void *clientData); typedef void (Tcl_MainLoopProc) (void); - + /* Abstract List functions */ -typedef Tcl_Size (Tcl_ObjTypeLengthProc) (struct Tcl_Obj *listPtr); -typedef int (Tcl_ObjTypeIndexProc) (Tcl_Interp *interp, struct Tcl_Obj *listPtr, - Tcl_Size index, struct Tcl_Obj** elemObj); -typedef int (Tcl_ObjTypeSliceProc) (Tcl_Interp *interp, struct Tcl_Obj *listPtr, - Tcl_Size fromIdx, Tcl_Size toIdx, - struct Tcl_Obj **newObjPtr); -typedef int (Tcl_ObjTypeReverseProc) (Tcl_Interp *interp, struct Tcl_Obj *listPtr, - struct Tcl_Obj **newObjPtr); -typedef int (Tcl_ObjTypeGetElements) (Tcl_Interp *interp, struct Tcl_Obj *listPtr, - Tcl_Size *objcptr, struct Tcl_Obj ***objvptr); -typedef struct Tcl_Obj* (Tcl_ObjTypeSetElement) (Tcl_Interp *interp, struct Tcl_Obj *listPtr, - Tcl_Size indexCount, - struct Tcl_Obj *const indexArray[], - struct Tcl_Obj *valueObj); -typedef int (Tcl_ObjTypeReplaceProc) (Tcl_Interp *interp, struct Tcl_Obj *listObj, - Tcl_Size first, Tcl_Size numToDelete, - Tcl_Size numToInsert, - struct Tcl_Obj *const insertObjs[]); -typedef int (Tcl_ObjTypeInOperatorProc) (Tcl_Interp *interp, struct Tcl_Obj *valueObj, - struct Tcl_Obj *listObj, int *boolResult); +typedef Tcl_Size (Tcl_ObjTypeLengthProc) (struct Tcl_Obj *listPtr); +typedef int (Tcl_ObjTypeIndexProc) (Tcl_Interp *interp, struct Tcl_Obj *listPtr, + Tcl_Size index, struct Tcl_Obj** elemObj); +typedef int (Tcl_ObjTypeSliceProc) (Tcl_Interp *interp, struct Tcl_Obj *listPtr, + Tcl_Size fromIdx, Tcl_Size toIdx, struct Tcl_Obj **newObjPtr); +typedef int (Tcl_ObjTypeReverseProc) (Tcl_Interp *interp, + struct Tcl_Obj *listPtr, struct Tcl_Obj **newObjPtr); +typedef int (Tcl_ObjTypeGetElements) (Tcl_Interp *interp, + struct Tcl_Obj *listPtr, Tcl_Size *objcptr, struct Tcl_Obj ***objvptr); +typedef struct Tcl_Obj *(Tcl_ObjTypeSetElement) (Tcl_Interp *interp, + struct Tcl_Obj *listPtr, Tcl_Size indexCount, + struct Tcl_Obj *const indexArray[], struct Tcl_Obj *valueObj); +typedef int (Tcl_ObjTypeReplaceProc) (Tcl_Interp *interp, + struct Tcl_Obj *listObj, Tcl_Size first, Tcl_Size numToDelete, + Tcl_Size numToInsert, struct Tcl_Obj *const insertObjs[]); +typedef int (Tcl_ObjTypeInOperatorProc) (Tcl_Interp *interp, + struct Tcl_Obj *valueObj, struct Tcl_Obj *listObj, int *boolResult); #ifndef TCL_NO_DEPRECATED # define Tcl_PackageInitProc Tcl_LibraryInitProc @@ -670,33 +668,36 @@ typedef struct Tcl_ObjType { size_t version; /* List emulation functions - ObjType Version 1 */ - Tcl_ObjTypeLengthProc *lengthProc; /* Return the [llength] of the - ** AbstractList */ - Tcl_ObjTypeIndexProc *indexProc; /* Return a value (Tcl_Obj) for - ** [lindex $al $index] */ - Tcl_ObjTypeSliceProc *sliceProc; /* Return an AbstractList for - ** [lrange $al $start $end] */ - Tcl_ObjTypeReverseProc *reverseProc; /* Return an AbstractList for - ** [lreverse $al] */ - Tcl_ObjTypeGetElements *getElementsProc; /* Return an objv[] of all elements in - ** the list */ - Tcl_ObjTypeSetElement *setElementProc; /* Replace the element at the indicie - ** with the given valueObj. */ - Tcl_ObjTypeReplaceProc *replaceProc; /* Replace subset with subset */ - Tcl_ObjTypeInOperatorProc *inOperProc; /* "in" and "ni" expr list - ** operation Determine if the given - ** string value matches an element in - ** the list */ + Tcl_ObjTypeLengthProc *lengthProc; + /* Return the [llength] of the AbstractList */ + Tcl_ObjTypeIndexProc *indexProc; + /* Return a value (Tcl_Obj) at a given index */ + Tcl_ObjTypeSliceProc *sliceProc; + /* Return an AbstractList for + * [lrange $al $start $end] */ + Tcl_ObjTypeReverseProc *reverseProc; + /* Return an AbstractList for [lreverse $al] */ + Tcl_ObjTypeGetElements *getElementsProc; + /* Return an objv[] of all elements in the list */ + Tcl_ObjTypeSetElement *setElementProc; + /* Replace the element at the indicies with the + * given valueObj. */ + Tcl_ObjTypeReplaceProc *replaceProc; + /* Replace sublist with another sublist */ + Tcl_ObjTypeInOperatorProc *inOperProc; + /* "in" and "ni" expr list operation. + * Determine if the given string value matches + * an element in the list. */ #endif } Tcl_ObjType; #if TCL_MAJOR_VERSION > 8 # define TCL_OBJTYPE_V0 0, \ - 0,0,0,0,0,0,0,0 /* Pre-Tcl 9 */ + 0,0,0,0,0,0,0,0 /* Pre-Tcl 9 */ # define TCL_OBJTYPE_V1(a) offsetof(Tcl_ObjType, indexProc), \ - a,0,0,0,0,0,0,0 /* Tcl 9 Version 1 */ + a,0,0,0,0,0,0,0 /* Tcl 9 Version 1 */ # define TCL_OBJTYPE_V2(a,b,c,d,e,f,g,h) sizeof(Tcl_ObjType), \ - a,b,c,d,e,f,g,h /* Tcl 9 - AbstractLists */ + a,b,c,d,e,f,g,h /* Tcl 9 - AbstractLists */ #else # define TCL_OBJTYPE_V0 /* just empty */ #endif @@ -749,9 +750,9 @@ typedef struct Tcl_Obj { * corresponds to the type of the object's * internal rep. NULL indicates the object has * no internal rep (has no type). */ - Tcl_ObjInternalRep internalRep; /* The internal representation: */ + Tcl_ObjInternalRep internalRep; + /* The internal representation: */ } Tcl_Obj; - /* *---------------------------------------------------------------------------- @@ -767,7 +768,7 @@ typedef struct Tcl_Namespace { * is an synonym. */ char *fullName; /* The namespace's fully qualified name. This * starts with ::. */ - void *clientData; /* Arbitrary value associated with this + void *clientData; /* Arbitrary value associated with this * namespace. */ Tcl_NamespaceDeleteProc *deleteProc; /* Function invoked when deleting the @@ -841,11 +842,11 @@ typedef struct { Tcl_ObjCmdProc *objProc; /* Command's object-based function. */ void *objClientData; /* ClientData for object proc. */ Tcl_CmdProc *proc; /* Command's string-based function. */ - void *clientData; /* ClientData for string proc. */ + void *clientData; /* ClientData for string proc. */ Tcl_CmdDeleteProc *deleteProc; /* Function to call when command is * deleted. */ - void *deleteData; /* Value to pass to deleteProc (usually the + void *deleteData; /* Value to pass to deleteProc (usually the * same as clientData). */ Tcl_Namespace *namespacePtr;/* Points to the namespace that contains this * command. Note that Tcl_SetCmdInfo will not @@ -964,7 +965,7 @@ typedef struct Tcl_DString { * TCL_CANCEL_UNWIND: Magical Tcl_CancelEval mode that causes the * stack for the script in progress to be * completely unwound. - * TCL_EVAL_NOERR: Do no exception reporting at all, just return + * TCL_EVAL_NOERR: Do no exception reporting at all, just return * as the caller will report. */ @@ -1077,7 +1078,7 @@ struct Tcl_HashEntry { * or NULL for end of chain. */ Tcl_HashTable *tablePtr; /* Pointer to table containing entry. */ size_t hash; /* Hash value. */ - void *clientData; /* Application stores something here with + void *clientData; /* Application stores something here with * Tcl_SetHashValue. */ union { /* Key has one of these forms: */ char *oneWordValue; /* One-word value for key. */ @@ -1173,11 +1174,11 @@ struct Tcl_HashTable { Tcl_HashEntry *staticBuckets[TCL_SMALL_HASH_TABLE]; /* Bucket array used for small tables (to * avoid mallocs and frees). */ - Tcl_Size numBuckets; /* Total number of buckets allocated at + Tcl_Size numBuckets; /* Total number of buckets allocated at * **bucketPtr. */ - Tcl_Size numEntries; /* Total number of entries present in + Tcl_Size numEntries; /* Total number of entries present in * table. */ - Tcl_Size rebuildSize; /* Enlarge table when numEntries gets to be + Tcl_Size rebuildSize; /* Enlarge table when numEntries gets to be * this large. */ #if TCL_MAJOR_VERSION > 8 size_t mask; /* Mask value used in hashing function. */ @@ -1186,7 +1187,7 @@ struct Tcl_HashTable { * Designed to use high-order bits of * randomized keys. */ #if TCL_MAJOR_VERSION < 9 - int mask; /* Mask value used in hashing function. */ + int mask; /* Mask value used in hashing function. */ #endif int keyType; /* Type of keys used in this table. It's * either TCL_CUSTOM_KEYS, TCL_STRING_KEYS, @@ -1776,8 +1777,8 @@ typedef struct Tcl_Token { int type; /* Type of token, such as TCL_TOKEN_WORD; see * below for valid types. */ const char *start; /* First character in token. */ - Tcl_Size size; /* Number of bytes in token. */ - Tcl_Size numComponents; /* If this token is composed of other tokens, + Tcl_Size size; /* Number of bytes in token. */ + Tcl_Size numComponents; /* If this token is composed of other tokens, * this field tells how many of them there are * (including components of components, etc.). * The component tokens immediately follow @@ -1891,13 +1892,13 @@ typedef struct Tcl_Token { typedef struct Tcl_Parse { const char *commentStart; /* Pointer to # that begins the first of one * or more comments preceding the command. */ - Tcl_Size commentSize; /* Number of bytes in comments (up through + Tcl_Size commentSize; /* Number of bytes in comments (up through * newline character that terminates the last * comment). If there were no comments, this * field is 0. */ const char *commandStart; /* First character in first word of * command. */ - Tcl_Size commandSize; /* Number of bytes in command, including first + Tcl_Size commandSize; /* Number of bytes in command, including first * character of first word, up through the * terminating newline, close bracket, or * semicolon. */ @@ -1967,7 +1968,7 @@ typedef struct Tcl_EncodingType { Tcl_FreeProc *freeProc; /* If non-NULL, function to call when this * encoding is deleted. */ - void *clientData; /* Arbitrary value associated with encoding + void *clientData; /* Arbitrary value associated with encoding * type. Passed to conversion functions. */ Tcl_Size nullSize; /* Number of zero bytes that signify * end-of-string in this encoding. This number @@ -2173,7 +2174,7 @@ typedef struct { * depends on type.*/ const char *helpStr; /* Documentation message describing this * option. */ - void *clientData; /* Word to pass to function callbacks. */ + void *clientData; /* Word to pass to function callbacks. */ } Tcl_ArgvInfo; /* @@ -2293,9 +2294,9 @@ typedef int (Tcl_NRPostProc) (void *data[], Tcl_Interp *interp, */ #if TCL_MAJOR_VERSION > 8 -# define TCL_STUB_MAGIC ((int) 0xFCA3BACB + (int) sizeof(void *)) +# define TCL_STUB_MAGIC ((int) 0xFCA3BACB + (int) sizeof(void *)) #else -# define TCL_STUB_MAGIC ((int) 0xFCA3BACF) +# define TCL_STUB_MAGIC ((int) 0xFCA3BACF) #endif /* @@ -2312,7 +2313,7 @@ const char * TclTomMathInitializeStubs(Tcl_Interp *interp, const char * TclInitStubTable(const char *version); void * TclStubCall(void *arg); #if defined(_WIN32) - TCL_NORETURN void Tcl_ConsolePanic(const char *format, ...); + TCL_NORETURN void Tcl_ConsolePanic(const char *format, ...); #else # define Tcl_ConsolePanic ((Tcl_PanicProc *)NULL) #endif @@ -2360,7 +2361,8 @@ void * TclStubCall(void *arg); * Tcl_GetMemoryInfo is needed for AOLserver. [Bug 1868171] */ -#define Tcl_Main(argc, argv, proc) Tcl_MainEx(argc, argv, proc, \ +#define Tcl_Main(argc, argv, proc) \ + Tcl_MainEx(argc, argv, proc, \ ((Tcl_SetPanicProc(Tcl_ConsolePanic), Tcl_CreateInterp()))) EXTERN TCL_NORETURN void Tcl_MainEx(Tcl_Size argc, char **argv, Tcl_AppInitProc *appInitProc, Tcl_Interp *interp); @@ -2379,9 +2381,9 @@ EXTERN void Tcl_StaticLibrary(Tcl_Interp *interp, #ifndef TCL_NO_DEPRECATED # define Tcl_StaticPackage Tcl_StaticLibrary #endif -EXTERN Tcl_ExitProc *Tcl_SetExitProc(Tcl_ExitProc *proc); +EXTERN Tcl_ExitProc * Tcl_SetExitProc(Tcl_ExitProc *proc); #ifdef _WIN32 -EXTERN const char *TclZipfs_AppHook(int *argc, wchar_t ***argv); +EXTERN const char * TclZipfs_AppHook(int *argc, wchar_t ***argv); #else EXTERN const char *TclZipfs_AppHook(int *argc, char ***argv); #endif @@ -2501,7 +2503,11 @@ EXTERN const char *TclZipfs_AppHook(int *argc, char ***argv); # define Tcl_BounceRefCount(objPtr) \ TclBounceRefCount(objPtr, __FILE__, __LINE__) -static inline void TclBounceRefCount(Tcl_Obj* objPtr, const char* fn, int line) +static inline void +TclBounceRefCount( + Tcl_Obj* objPtr, + const char* fn, + int line) { if (objPtr) { if ((objPtr)->refCount == 0) { @@ -2519,11 +2525,11 @@ static inline void TclBounceRefCount(Tcl_Obj* objPtr, const char* fn, int line) */ # undef Tcl_DecrRefCount # define Tcl_DecrRefCount(objPtr) \ - do { \ - Tcl_Obj *_objPtr = (objPtr); \ - if (_objPtr->refCount-- <= 1) { \ - TclFreeObj(_objPtr); \ - } \ + do { \ + Tcl_Obj *_objPtr = (objPtr); \ + if (_objPtr->refCount-- <= 1) { \ + TclFreeObj(_objPtr); \ + } \ } while(0) # undef Tcl_IsShared # define Tcl_IsShared(objPtr) \ @@ -2534,10 +2540,12 @@ static inline void TclBounceRefCount(Tcl_Obj* objPtr, const char* fn, int line) * This will release the obj if there is no referece count, * otherwise let it be. */ -# define Tcl_BounceRefCount(objPtr) \ +# define Tcl_BounceRefCount(objPtr) \ TclBounceRefCount(objPtr); -static inline void TclBounceRefCount(Tcl_Obj* objPtr) +static inline void +TclBounceRefCount( + Tcl_Obj* objPtr) { if (objPtr) { if ((objPtr)->refCount == 0) { @@ -2589,10 +2597,10 @@ static inline void TclBounceRefCount(Tcl_Obj* objPtr) #define Tcl_GetHashValue(h) ((h)->clientData) #define Tcl_SetHashValue(h, value) ((h)->clientData = (void *)(value)) #define Tcl_GetHashKey(tablePtr, h) \ - ((void *) (((tablePtr)->keyType == TCL_ONE_WORD_KEYS || \ - (tablePtr)->keyType == TCL_CUSTOM_PTR_KEYS) \ - ? (h)->key.oneWordValue \ - : (h)->key.string)) + ((void *) (((tablePtr)->keyType == TCL_ONE_WORD_KEYS || \ + (tablePtr)->keyType == TCL_CUSTOM_PTR_KEYS) \ + ? (h)->key.oneWordValue \ + : (h)->key.string)) /* * Macros to use for clients to use to invoke find and create functions for diff --git a/generic/tclBasic.c b/generic/tclBasic.c index ed1ad58..3940d4b 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -2740,10 +2740,9 @@ Tcl_CreateObjCommand2( * name. */ void *clientData, /* Arbitrary value to pass to object * function. */ - Tcl_CmdDeleteProc *deleteProc + Tcl_CmdDeleteProc *deleteProc) /* If not NULL, gives a function to call when * this command is deleted. */ -) { CmdWrapperInfo *info = (CmdWrapperInfo *) Tcl_Alloc(sizeof(CmdWrapperInfo)); info->proc = proc; @@ -2768,10 +2767,9 @@ Tcl_CreateObjCommand( * name. */ void *clientData, /* Arbitrary value to pass to object * function. */ - Tcl_CmdDeleteProc *deleteProc + Tcl_CmdDeleteProc *deleteProc) /* If not NULL, gives a function to call when * this command is deleted. */ -) { Interp *iPtr = (Interp *) interp; Namespace *nsPtr; diff --git a/generic/tclBinary.c b/generic/tclBinary.c index 329cfe2..d95452b 100644 --- a/generic/tclBinary.c +++ b/generic/tclBinary.c @@ -557,7 +557,6 @@ TclNarrowToBytes( Tcl_IncrRefCount(objPtr); return objPtr; } - /* *---------------------------------------------------------------------- diff --git a/generic/tclCkalloc.c b/generic/tclCkalloc.c index 1c12106..a95fc83 100644 --- a/generic/tclCkalloc.c +++ b/generic/tclCkalloc.c @@ -719,7 +719,6 @@ Tcl_AttemptDbCkrealloc( Tcl_DbCkfree(ptr, file, line); return newPtr; } - /* *---------------------------------------------------------------------- @@ -1010,7 +1009,6 @@ Tcl_InitMemory( Tcl_CreateObjCommand(interp, "checkmem", CheckmemCmd, NULL, NULL); } - #else /* TCL_MEM_DEBUG */ /* This is the !TCL_MEM_DEBUG case */ @@ -1018,7 +1016,6 @@ Tcl_InitMemory( #undef Tcl_InitMemory #undef Tcl_DumpActiveMemory #undef Tcl_ValidateAllMemory - /* *---------------------------------------------------------------------- @@ -1253,11 +1250,11 @@ TclDumpMemoryInfo( */ void * TclAllocElemsEx( - Tcl_Size elemCount, /* Allocation will store at least these many... */ - Tcl_Size elemSize, /* ...elements of this size */ - Tcl_Size leadSize, /* Additional leading space in bytes */ - Tcl_Size *capacityPtr) /* OUTPUT: Actual capacity is stored - here if non-NULL. Only modified on success */ + Tcl_Size elemCount, /* Allocation will store at least these many... */ + Tcl_Size elemSize, /* ...elements of this size */ + Tcl_Size leadSize, /* Additional leading space in bytes */ + Tcl_Size *capacityPtr) /* OUTPUT: Actual capacity is stored here if + * non-NULL. Only modified on success */ { void *ptr = TclAttemptReallocElemsEx( NULL, elemCount, elemSize, leadSize, capacityPtr); @@ -1288,13 +1285,13 @@ TclAllocElemsEx( */ void * TclAttemptReallocElemsEx( - void *oldPtr, /* Pointer to memory block to reallocate or - * NULL to indicate this is a new allocation */ - Tcl_Size elemCount, /* Allocation will store at least these many... */ - Tcl_Size elemSize, /* ...elements of this size */ - Tcl_Size leadSize, /* Additional leading space in bytes */ - Tcl_Size *capacityPtr) /* OUTPUT: Actual capacity is stored - here if non-NULL. Only modified on success */ + void *oldPtr, /* Pointer to memory block to reallocate or + * NULL to indicate this is a new allocation */ + Tcl_Size elemCount, /* Allocation will store at least these many... */ + Tcl_Size elemSize, /* ...elements of this size */ + Tcl_Size leadSize, /* Additional leading space in bytes */ + Tcl_Size *capacityPtr) /* OUTPUT: Actual capacity is stored here if + * non-NULL. Only modified on success */ { void *ptr; Tcl_Size limit; @@ -1358,12 +1355,12 @@ TclAttemptReallocElemsEx( */ void * TclReallocElemsEx( - void *oldPtr, /* Pointer to memory block to reallocate */ - Tcl_Size elemCount, /* Allocation will store at least these many... */ - Tcl_Size elemSize, /* ...elements of this size */ - Tcl_Size leadSize, /* Additional leading space in bytes */ - Tcl_Size *capacityPtr) /* OUTPUT: Actual capacity is stored - here if non-NULL. Only modified on success */ + void *oldPtr, /* Pointer to memory block to reallocate */ + Tcl_Size elemCount, /* Allocation will store at least these many... */ + Tcl_Size elemSize, /* ...elements of this size */ + Tcl_Size leadSize, /* Additional leading space in bytes */ + Tcl_Size *capacityPtr) /* OUTPUT: Actual capacity is stored here if + * non-NULL. Only modified on success */ { void *ptr = TclAttemptReallocElemsEx( oldPtr, elemCount, elemSize, leadSize, capacityPtr); diff --git a/generic/tclClock.c b/generic/tclClock.c index 2cfa4a5..412f616 100644 --- a/generic/tclClock.c +++ b/generic/tclClock.c @@ -1964,7 +1964,6 @@ ConvertLocalToUTC( ltzoc->tzOffset = fields->tzOffset; } - /* check DST-hole: if retrieved seconds is out of range */ if (ltzoc->rangesVal[0] > seconds || seconds >= ltzoc->rangesVal[1]) { dstHole: @@ -2900,7 +2899,6 @@ GetJulianDayFromEraYearMonthDay( *---------------------------------------------------------------------- */ - void GetJulianDayFromEraYearDay( TclDateFields *fields, /* Date to convert */ @@ -4250,7 +4248,6 @@ ClockCalcRelTime( return TCL_OK; } - /*---------------------------------------------------------------------- * @@ -4309,8 +4306,6 @@ ClockWeekdaysOffs( return offs; } - - /*---------------------------------------------------------------------- * diff --git a/generic/tclCmdAH.c b/generic/tclCmdAH.c index 288271b..ab5fbb0 100644 --- a/generic/tclCmdAH.c +++ b/generic/tclCmdAH.c @@ -425,14 +425,13 @@ TclInitEncodingCmd( */ static int EncodingConvertParseOptions( - Tcl_Interp *interp, /* For error messages. May be NULL */ - int objc, /* Number of arguments */ - Tcl_Obj *const objv[], /* Argument objects as passed to command. */ - Tcl_Encoding *encPtr, /* Where to store the encoding */ - Tcl_Obj **dataObjPtr, /* Where to store ptr to Tcl_Obj containing data */ - int *profilePtr, /* Bit mask of encoding option profile */ - Tcl_Obj **failVarPtr /* Where to store -failindex option value */ -) + Tcl_Interp *interp, /* For error messages. May be NULL */ + int objc, /* Number of arguments */ + Tcl_Obj *const objv[], /* Argument objects as passed to command. */ + Tcl_Encoding *encPtr, /* Where to store the encoding */ + Tcl_Obj **dataObjPtr, /* Where to store ptr to Tcl_Obj containing data */ + int *profilePtr, /* Bit mask of encoding option profile */ + Tcl_Obj **failVarPtr) /* Where to store -failindex option value */ { static const char *const options[] = {"-profile", "-failindex", NULL}; enum convertfromOptions { PROFILE, FAILINDEX } optIndex; diff --git a/generic/tclCmdIL.c b/generic/tclCmdIL.c index c46ab60..37c9822 100644 --- a/generic/tclCmdIL.c +++ b/generic/tclCmdIL.c @@ -5290,7 +5290,6 @@ SortCompare( return 0; } - objPtr1 = elemPtr1->collationKey.objValuePtr; objPtr2 = elemPtr2->collationKey.objValuePtr; diff --git a/generic/tclCompCmds.c b/generic/tclCompCmds.c index 99a97ad..bad58f6 100644 --- a/generic/tclCompCmds.c +++ b/generic/tclCompCmds.c @@ -657,7 +657,6 @@ TclCompileCatchCmd( } ExceptionRangeEnds(envPtr, range); - /* * Emit the "no errors" epilogue: push "0" (TCL_OK) as the catch result, * and jump around the "error case" code. @@ -679,7 +678,6 @@ TclCompileCatchCmd( TclEmitOpcode( INST_POP, envPtr); } - /* Stack at this point is empty */ TclEmitOpcode( INST_PUSH_RESULT, envPtr); TclEmitOpcode( INST_PUSH_RETURN_CODE, envPtr); @@ -791,7 +789,6 @@ TclCompileClockClicksCmd( } return TCL_OK; } - /*---------------------------------------------------------------------- * @@ -2851,7 +2848,6 @@ CompileEachloopCmd( int varIndex; Tcl_Size length; - Tcl_ListObjIndex(NULL, varListObj, j, &varNameObj); bytes = TclGetStringFromObj(varNameObj, &length); varIndex = LocalScalar(bytes, length, envPtr); diff --git a/generic/tclCompCmdsSZ.c b/generic/tclCompCmdsSZ.c index 98a39f9..bc37155 100644 --- a/generic/tclCompCmdsSZ.c +++ b/generic/tclCompCmdsSZ.c @@ -101,7 +101,6 @@ const AuxDataType tclJumptableInfoType = { if ((idx)<256) {OP1(STORE_SCALAR1,(idx));} else {OP4(STORE_SCALAR4,(idx));} #define INVOKE(name) \ TclEmitInvoke(envPtr,INST_##name) - /* *---------------------------------------------------------------------- diff --git a/generic/tclCompExpr.c b/generic/tclCompExpr.c index c9f9ec5..5c46afd 100644 --- a/generic/tclCompExpr.c +++ b/generic/tclCompExpr.c @@ -1924,7 +1924,7 @@ ParseLexeme( unsigned char *lexemePtr, /* Write code of parsed lexeme to this * storage. */ Tcl_Obj **literalPtr) /* Write corresponding literal value to this - storage, if non-NULL. */ + * storage, if non-NULL. */ { const char *end; int ch; diff --git a/generic/tclDisassemble.c b/generic/tclDisassemble.c index 7a8783c..5a64ff8 100644 --- a/generic/tclDisassemble.c +++ b/generic/tclDisassemble.c @@ -45,21 +45,20 @@ static const Tcl_ObjType instNameType = { TCL_OBJTYPE_V0 }; -#define InstNameSetInternalRep(objPtr, inst) \ - do { \ - Tcl_ObjInternalRep ir; \ - ir.wideValue = (inst); \ +#define InstNameSetInternalRep(objPtr, inst) \ + do { \ + Tcl_ObjInternalRep ir; \ + ir.wideValue = (inst); \ Tcl_StoreInternalRep((objPtr), &instNameType, &ir); \ } while (0) -#define InstNameGetInternalRep(objPtr, inst) \ - do { \ +#define InstNameGetInternalRep(objPtr, inst) \ + do { \ const Tcl_ObjInternalRep *irPtr; \ - irPtr = TclFetchInternalRep((objPtr), &instNameType); \ - assert(irPtr != NULL); \ - (inst) = irPtr->wideValue; \ + irPtr = TclFetchInternalRep((objPtr), &instNameType); \ + assert(irPtr != NULL); \ + (inst) = irPtr->wideValue; \ } while (0) - /* *---------------------------------------------------------------------- diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c index 4b1ef16..0844303 100644 --- a/generic/tclEncoding.c +++ b/generic/tclEncoding.c @@ -258,7 +258,6 @@ static Tcl_EncodingConvertProc UtfToUtfProc; static Tcl_EncodingConvertProc Iso88591FromUtfProc; static Tcl_EncodingConvertProc Iso88591ToUtfProc; - /* * A Tcl_ObjType for holding a cached Tcl_Encoding in the twoPtrValue.ptr1 field * of the internalrep. This should help the lifetime of encodings be more useful. @@ -274,21 +273,20 @@ static const Tcl_ObjType encodingType = { TCL_OBJTYPE_V0 }; -#define EncodingSetInternalRep(objPtr, encoding) \ +#define EncodingSetInternalRep(objPtr, encoding) \ do { \ Tcl_ObjInternalRep ir; \ ir.twoPtrValue.ptr1 = (encoding); \ ir.twoPtrValue.ptr2 = NULL; \ - Tcl_StoreInternalRep((objPtr), &encodingType, &ir); \ + Tcl_StoreInternalRep((objPtr), &encodingType, &ir); \ } while (0) -#define EncodingGetInternalRep(objPtr, encoding) \ +#define EncodingGetInternalRep(objPtr, encoding) \ do { \ - const Tcl_ObjInternalRep *irPtr; \ + const Tcl_ObjInternalRep *irPtr; \ irPtr = TclFetchInternalRep ((objPtr), &encodingType); \ - (encoding) = irPtr ? (Tcl_Encoding)irPtr->twoPtrValue.ptr1 : NULL; \ + (encoding) = irPtr ? (Tcl_Encoding)irPtr->twoPtrValue.ptr1 : NULL; \ } while (0) - /* *---------------------------------------------------------------------- @@ -1112,7 +1110,6 @@ Tcl_ExternalToUtfDString( NULL, encoding, src, srcLen, TCL_ENCODING_PROFILE_TCL8, dstPtr, NULL); return Tcl_DStringValue(dstPtr); } - /* *------------------------------------------------------------------------- @@ -1158,14 +1155,14 @@ Tcl_ExternalToUtfDStringEx( Tcl_Encoding encoding, /* The encoding for the source string, or NULL * for the default system encoding. */ const char *src, /* Source string in specified encoding. */ - Tcl_Size srcLen, /* Source string length in bytes, or < 0 for + Tcl_Size srcLen, /* Source string length in bytes, or < 0 for * encoding-specific string length. */ int flags, /* Conversion control flags. */ Tcl_DString *dstPtr, /* Uninitialized or free DString in which the * converted string is stored. */ Tcl_Size *errorLocPtr) /* Where to store the error location - (or TCL_INDEX_NONE if no error). May - be NULL. */ + * (or TCL_INDEX_NONE if no error). May + * be NULL. */ { char *dst; Tcl_EncodingState state; @@ -1430,7 +1427,6 @@ Tcl_UtfToExternalDString( NULL, encoding, src, srcLen, TCL_ENCODING_PROFILE_TCL8, dstPtr, NULL); return Tcl_DStringValue(dstPtr); } - /* *------------------------------------------------------------------------- @@ -1481,8 +1477,8 @@ Tcl_UtfToExternalDStringEx( Tcl_DString *dstPtr, /* Uninitialized or free DString in which the * converted string is stored. */ Tcl_Size *errorLocPtr) /* Where to store the error location - (or TCL_INDEX_NONE if no error). May - be NULL. */ + * (or TCL_INDEX_NONE if no error). May + * be NULL. */ { char *dst; Tcl_EncodingState state; diff --git a/generic/tclEnv.c b/generic/tclEnv.c index ef4e946..0128672 100644 --- a/generic/tclEnv.c +++ b/generic/tclEnv.c @@ -20,9 +20,9 @@ TCL_DECLARE_MUTEX(envMutex) /* To serialize access to environ. */ #if defined(_WIN32) # define tenviron _wenviron # define tenviron2utfdstr(str, dsPtr) (Tcl_DStringInit(dsPtr), \ - (char *)Tcl_Char16ToUtfDString((const unsigned short *)(str), -1, (dsPtr))) + (char *)Tcl_Char16ToUtfDString((const unsigned short *)(str), -1, (dsPtr))) # define utf2tenvirondstr(str, dsPtr) (Tcl_DStringInit(dsPtr), \ - (const WCHAR *)Tcl_UtfToChar16DString((str), -1, (dsPtr))) + (const WCHAR *)Tcl_UtfToChar16DString((str), -1, (dsPtr))) # define techar WCHAR # ifdef USE_PUTENV # define putenv(env) _wputenv((const wchar_t *)env) @@ -30,13 +30,12 @@ TCL_DECLARE_MUTEX(envMutex) /* To serialize access to environ. */ #else # define tenviron environ # define tenviron2utfdstr(str, dsPtr) \ - Tcl_ExternalToUtfDString(NULL, str, -1, dsPtr) + Tcl_ExternalToUtfDString(NULL, str, -1, dsPtr) # define utf2tenvirondstr(str, dsPtr) \ - Tcl_UtfToExternalDString(NULL, str, -1, dsPtr) + Tcl_UtfToExternalDString(NULL, str, -1, dsPtr) # define techar char #endif - /* MODULE_SCOPE */ size_t TclEnvEpoch = 0; /* Epoch of the tcl environment * (if changed with tcl-env). */ diff --git a/generic/tclEvent.c b/generic/tclEvent.c index 334cfae..29d8a0c 100644 --- a/generic/tclEvent.c +++ b/generic/tclEvent.c @@ -893,7 +893,6 @@ Tcl_SetExitProc( return prevExitProc; } - /* *---------------------------------------------------------------------- @@ -935,7 +934,6 @@ InvokeExitHandlers(void) firstExitPtr = NULL; Tcl_MutexUnlock(&exitMutex); } - /* *---------------------------------------------------------------------- diff --git a/generic/tclExecute.c b/generic/tclExecute.c index da08f3a..c94e570 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -1024,7 +1024,6 @@ GrowEvaluationStack( } needed = growth + moveWords + WALLOCALIGN; - /* * Check if there is enough room in the next stack (if there is one, it * should be both empty and the last one!) @@ -6604,7 +6603,6 @@ TEBCresume( } CACHE_STACK_INFO(); - valIndex = (iterNum * numVars); for (j = 0; j < numVars; j++) { if (valIndex >= listLen) { diff --git a/generic/tclHash.c b/generic/tclHash.c index 5be07cb..89807e2 100644 --- a/generic/tclHash.c +++ b/generic/tclHash.c @@ -214,7 +214,6 @@ FindHashEntry( { return CreateHashEntry(tablePtr, key, NULL); } - /* *---------------------------------------------------------------------- @@ -301,8 +300,7 @@ CreateHashEntry( } /* if needle pointer equals content pointer or values equal */ if ((key == hPtr->key.string) - || compareKeysProc((void *) key, hPtr) - ) { + || compareKeysProc((void *) key, hPtr)) { if (newPtr) { *newPtr = 0; } diff --git a/generic/tclIO.c b/generic/tclIO.c index 78cda5c..eec6062 100644 --- a/generic/tclIO.c +++ b/generic/tclIO.c @@ -8711,9 +8711,8 @@ UpdateInterest( && (mask & TCL_WRITABLE) && GotFlag(statePtr, CHANNEL_NONBLOCKING) && bufPtr - && !IsBufferEmpty(bufPtr) - && !IsBufferFull(bufPtr) - ) { + && !IsBufferEmpty(bufPtr) + && !IsBufferFull(bufPtr)) { TclChannelPreserve((Tcl_Channel)chanPtr); statePtr->timerChanPtr = chanPtr; statePtr->timer = Tcl_CreateTimerHandler(SYNTHETIC_EVENT_TIME, @@ -8798,8 +8797,7 @@ ChannelTimerProc( static void DeleteTimerHandler( - ChannelState *statePtr -) + ChannelState *statePtr) { if (statePtr->timer != NULL) { Tcl_DeleteTimerHandler(statePtr->timer); @@ -8808,8 +8806,8 @@ DeleteTimerHandler( } static void CleanupTimerHandler( - ChannelState *statePtr -){ + ChannelState *statePtr) +{ TclChannelRelease((Tcl_Channel)statePtr->timerChanPtr); statePtr->timer = NULL; statePtr->timerChanPtr = NULL; @@ -10297,20 +10295,13 @@ Lossless( return inStatePtr->inEofChar == '\0' /* No eofChar to stop input */ && inStatePtr->inputTranslation == TCL_TRANSLATE_LF && outStatePtr->outputTranslation == TCL_TRANSLATE_LF - && ( - ( - inStatePtr->encoding == GetBinaryEncoding() - && - outStatePtr->encoding == GetBinaryEncoding() - ) - || - ( - toRead == -1 + && ((inStatePtr->encoding == GetBinaryEncoding() + && outStatePtr->encoding == GetBinaryEncoding()) + || (toRead == -1 && inStatePtr->encoding == outStatePtr->encoding && ENCODING_PROFILE_GET(inStatePtr->inputEncodingFlags) == TCL_ENCODING_PROFILE_TCL8 && ENCODING_PROFILE_GET(outStatePtr->inputEncodingFlags) == TCL_ENCODING_PROFILE_TCL8 - ) - ); + )); } /* diff --git a/generic/tclIO.h b/generic/tclIO.h index 08fff44..8823e06 100644 --- a/generic/tclIO.h +++ b/generic/tclIO.h @@ -191,8 +191,8 @@ typedef struct ChannelState { Tcl_Size bufSize; /* What size buffers to allocate? */ Tcl_TimerToken timer; /* Handle to wakeup timer for this channel. */ Channel *timerChanPtr; /* Needed in order to decrement the refCount of - the right channel when the timer is - deleted. */ + * the right channel when the timer is + * deleted. */ struct CopyState *csPtrR; /* State of background copy for which channel * is input, or NULL. */ struct CopyState *csPtrW; /* State of background copy for which channel diff --git a/generic/tclIOCmd.c b/generic/tclIOCmd.c index cb90059..fc4ddb6 100644 --- a/generic/tclIOCmd.c +++ b/generic/tclIOCmd.c @@ -606,7 +606,6 @@ Tcl_TellObjCmd( * them into the regular interpreter result. */ - code = TclChanCaughtErrorBypass(interp, chan); TclChannelRelease(chan); if (code) { diff --git a/generic/tclIORChan.c b/generic/tclIORChan.c index fe54f65..0118ce0 100644 --- a/generic/tclIORChan.c +++ b/generic/tclIORChan.c @@ -62,27 +62,27 @@ static void TimerRunWrite(void *clientData); */ static const Tcl_ChannelType tclRChannelType = { - "tclrchannel", /* Type name. */ + "tclrchannel", /* Type name. */ TCL_CHANNEL_VERSION_5, /* v5 channel */ - NULL, /* Close channel, clean instance data */ - ReflectInput, /* Handle read request */ - ReflectOutput, /* Handle write request */ + NULL, /* Old close API */ + ReflectInput, /* Handle read request */ + ReflectOutput, /* Handle write request */ NULL, - ReflectSetOption, /* Set options. NULL'able */ - ReflectGetOption, /* Get options. NULL'able */ - ReflectWatch, /* Initialize notifier */ - NULL, /* Get OS handle from the channel. NULL'able */ - ReflectClose, /* No close2 support. NULL'able */ - ReflectBlock, /* Set blocking/nonblocking. NULL'able */ - NULL, /* Flush channel. Not used by core. NULL'able */ - NULL, /* Handle events. NULL'able */ - ReflectSeekWide, /* Move access point (64 bit). NULL'able */ + ReflectSetOption, /* Set options. */ + ReflectGetOption, /* Get options. */ + ReflectWatch, /* Initialize notifier */ + NULL, /* Get OS handle from the channel. */ + ReflectClose, /* Close channel. Clean instance data */ + ReflectBlock, /* Set blocking/nonblocking. */ + NULL, /* Flush channel. */ + NULL, /* Handle events. */ + ReflectSeekWide, /* Move access point (64 bit). */ #if TCL_THREADS - ReflectThread, /* thread action, tracking owner */ + ReflectThread, /* thread action, tracking owner */ #else - NULL, /* thread action */ + NULL, /* thread action */ #endif - ReflectTruncate /* Truncate. NULL'able */ + ReflectTruncate /* Truncate. */ }; /* @@ -96,11 +96,10 @@ typedef struct { * Tcl level part of the channel. NULL here * signals the channel is dead because the * interpreter/thread containing its Tcl - * command is gone. - */ + * command is gone. */ #if TCL_THREADS Tcl_ThreadId thread; /* Thread the 'interp' belongs to. == Handler thread */ - Tcl_ThreadId owner; /* Thread owning the structure. == Channel thread */ + Tcl_ThreadId owner; /* Thread owning the structure. == Channel thread */ #endif Tcl_Obj *cmd; /* Callback command prefix */ Tcl_Obj *methods; /* Methods to append to command prefix */ @@ -113,16 +112,12 @@ typedef struct { int dead; /* Boolean signal that some operations * should no longer be attempted. */ - Tcl_TimerToken readTimer; /* - A token for the timer that is scheduled in - order to call Tcl_NotifyChannel when the - channel is readable - */ - Tcl_TimerToken writeTimer; /* - A token for the timer that is scheduled in - order to call Tcl_NotifyChannel when the - channel is writable - */ + Tcl_TimerToken readTimer; /* A token for the timer that is scheduled in + * order to call Tcl_NotifyChannel when the + * channel is readable */ + Tcl_TimerToken writeTimer; /* A token for the timer that is scheduled in + * order to call Tcl_NotifyChannel when the + * channel is writable */ /* * Note regarding the usage of timers. @@ -266,7 +261,7 @@ typedef struct { struct ForwardParamInput { ForwardParamBase base; /* "Supertype". MUST COME FIRST. */ char *buf; /* O: Where to store the read bytes */ - Tcl_Size toRead; /* I: #bytes to read, + Tcl_Size toRead; /* I: #bytes to read, * O: #bytes actually read */ }; struct ForwardParamOutput { @@ -513,7 +508,7 @@ TclChanCreateObjCmd( Tcl_Obj *cmdNameObj; /* Command name */ Tcl_Channel chan; /* Token for the new channel */ Tcl_Obj *modeObj; /* mode in obj form for method call */ - Tcl_Size listc; /* Result of 'initialize', and of */ + Tcl_Size listc; /* Result of 'initialize', and of */ Tcl_Obj **listv; /* its sublist in the 2nd element */ int methIndex; /* Encoded method name */ int result; /* Result code for 'initialize' */ diff --git a/generic/tclIORTrans.c b/generic/tclIORTrans.c index c1e5c31..2ad6ecf0 100644 --- a/generic/tclIORTrans.c +++ b/generic/tclIORTrans.c @@ -58,18 +58,17 @@ static int ReflectNotify(void *clientData, int mask); static const Tcl_ChannelType tclRTransformType = { "tclrtransform", /* Type name. */ TCL_CHANNEL_VERSION_5, /* v5 channel. */ - NULL, /* Close channel, clean instance data. */ + NULL, ReflectInput, /* Handle read request. */ ReflectOutput, /* Handle write request. */ - NULL, /* Move location of access point. */ + NULL, /* Move location of access point. */ ReflectSetOption, /* Set options. */ ReflectGetOption, /* Get options. */ ReflectWatch, /* Initialize notifier. */ ReflectHandle, /* Get OS handle from the channel. */ - ReflectClose, /* No close2 support. NULL'able. */ + ReflectClose, /* Close channel, clean instance data. */ ReflectBlock, /* Set blocking/nonblocking. */ - NULL, /* Flush channel. Not used by core. - * NULL'able. */ + NULL, /* Flush channel. Not used by core. */ ReflectNotify, /* Handle events. */ ReflectSeekWide, /* Move access point (64 bit). */ NULL, /* thread action */ @@ -511,7 +510,7 @@ TclChanPushObjCmd( Tcl_Obj *cmdNameObj; /* Command name */ Tcl_Obj *rtId; /* Handle of the new transform (channel) */ Tcl_Obj *modeObj; /* mode in obj form for method call */ - Tcl_Size listc; /* Result of 'initialize', and of */ + Tcl_Size listc; /* Result of 'initialize', and of */ Tcl_Obj **listv; /* its sublist in the 2nd element */ int methIndex; /* Encoded method name */ int result; /* Result code for 'initialize' */ @@ -1105,7 +1104,6 @@ ReflectInput( goto stop; } - /* * The buffer is exhausted, but the caller wants even more. We now * have to go to the underlying channel, get more bytes and then @@ -1141,7 +1139,6 @@ ReflectInput( goto stop; } - readBytes = Tcl_ReadRaw(rtPtr->parent, (char *) Tcl_SetByteArrayLength(bufObj, toRead), toRead); if (readBytes < 0) { @@ -1492,7 +1489,7 @@ ReflectBlock( static int ReflectSetOption( - void *clientData, /* Channel to query */ + void *clientData, /* Channel to query */ Tcl_Interp *interp, /* Interpreter to leave error messages in */ const char *optionName, /* Name of requested option */ const char *newValue) /* The new value */ @@ -1534,7 +1531,7 @@ ReflectSetOption( static int ReflectGetOption( - void *clientData, /* Channel to query */ + void *clientData, /* Channel to query */ Tcl_Interp *interp, /* Interpreter to leave error messages in */ const char *optionName, /* Name of requested option */ Tcl_DString *dsPtr) /* String to place the result into */ @@ -1645,7 +1642,6 @@ ReflectNotify( /* * Helpers. ========================================================= */ - /* *---------------------------------------------------------------------- @@ -2075,7 +2071,8 @@ static ReflectedTransformMap * GetReflectedTransformMap( Tcl_Interp *interp) { - ReflectedTransformMap *rtmPtr = (ReflectedTransformMap *)Tcl_GetAssocData(interp, RTMKEY, NULL); + ReflectedTransformMap *rtmPtr = (ReflectedTransformMap *) + Tcl_GetAssocData(interp, RTMKEY, NULL); if (rtmPtr == NULL) { rtmPtr = (ReflectedTransformMap *)Tcl_Alloc(sizeof(ReflectedTransformMap)); @@ -2108,7 +2105,7 @@ GetReflectedTransformMap( static void DeleteReflectedTransformMap( - void *clientData, /* The per-interpreter data structure. */ + void *clientData, /* The per-interpreter data structure. */ Tcl_Interp *interp) /* The interpreter being deleted. */ { ReflectedTransformMap *rtmPtr; /* The map */ @@ -2243,7 +2240,8 @@ GetThreadReflectedTransformMap(void) ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); if (!tsdPtr->rtmPtr) { - tsdPtr->rtmPtr = (ReflectedTransformMap *)Tcl_Alloc(sizeof(ReflectedTransformMap)); + tsdPtr->rtmPtr = (ReflectedTransformMap *) + Tcl_Alloc(sizeof(ReflectedTransformMap)); Tcl_InitHashTable(&tsdPtr->rtmPtr->map, TCL_STRING_KEYS); Tcl_CreateThreadExitHandler(DeleteThreadReflectedTransformMap, NULL); } @@ -2993,7 +2991,7 @@ static inline size_t ResultCopy( ResultBuffer *rPtr, /* The buffer to read from */ unsigned char *buf, /* The buffer to copy into */ - size_t toRead) /* Number of requested bytes */ + size_t toRead) /* Number of requested bytes */ { int copied; diff --git a/generic/tclIOSock.c b/generic/tclIOSock.c index 47fde36..81526fa 100644 --- a/generic/tclIOSock.c +++ b/generic/tclIOSock.c @@ -18,7 +18,7 @@ typedef struct { int initialized; - Tcl_DString errorMsg; /* UTF-8 encoded error-message */ + Tcl_DString errorMsg; /* UTF-8 encoded error-message */ } ThreadSpecificData; static Tcl_ThreadDataKey dataKey; @@ -75,7 +75,8 @@ TclSockGetPort( * Don't bother translating 'proto' to native. */ - if (Tcl_UtfToExternalDStringEx(interp, NULL, string, -1, 0, &ds, NULL) != TCL_OK) { + if (Tcl_UtfToExternalDStringEx(interp, NULL, string, -1, 0, &ds, + NULL) != TCL_OK) { Tcl_DStringFree(&ds); return TCL_ERROR; } @@ -188,7 +189,8 @@ TclCreateSocketAddress( int result; if (host != NULL) { - if (Tcl_UtfToExternalDStringEx(interp, NULL, host, -1, 0, &ds, NULL) != TCL_OK) { + if (Tcl_UtfToExternalDStringEx(interp, NULL, host, -1, 0, &ds, + NULL) != TCL_OK) { Tcl_DStringFree(&ds); return 0; } diff --git a/generic/tclIOUtil.c b/generic/tclIOUtil.c index 6067282..c3131cd 100644 --- a/generic/tclIOUtil.c +++ b/generic/tclIOUtil.c @@ -35,7 +35,7 @@ */ typedef struct FilesystemRecord { - void *clientData; /* Client-specific data for the filesystem + void *clientData; /* Client-specific data for the filesystem * (can be NULL) */ const Tcl_Filesystem *fsPtr;/* Pointer to filesystem dispatch table. */ struct FilesystemRecord *nextPtr; @@ -52,13 +52,11 @@ typedef struct FilesystemRecord { typedef struct { int initialized; size_t cwdPathEpoch; /* Compared with the global cwdPathEpoch to - * determine whether cwdPathPtr is stale. - */ + * determine whether cwdPathPtr is stale. */ size_t filesystemEpoch; Tcl_Obj *cwdPathPtr; /* A private copy of cwdPathPtr. Updated when * the value is accessed and cwdPathEpoch has - * changed. - */ + * changed. */ void *cwdClientData; FilesystemRecord *filesystemList; size_t claims; @@ -106,7 +104,6 @@ static Tcl_FSFileAttrsSetProc NativeFileAttrsSet; MODULE_SCOPE const char *const tclpFileAttrStrings[]; MODULE_SCOPE const TclFileAttrProcs tclpFileAttrProcs[]; - /* * These these functions are not static either because routines in the native * (win/unix) directories call them or they are actually implemented in those @@ -242,7 +239,8 @@ typedef struct { /* Obsolete */ int Tcl_Stat( - const char *path, /* Pathname of file to stat (in current CP). */ + const char *path, /* Pathname of file to stat (in current system + * encoding). */ struct stat *oldStyleBuf) /* Filled with results of stat call. */ { int ret; @@ -329,8 +327,8 @@ Tcl_Stat( /* Obsolete */ int Tcl_Access( - const char *path, /* Pathname of file to access (in current CP). - */ + const char *path, /* Pathname of file to access (in current + * system encoding). */ int mode) /* Permission setting. */ { int ret; @@ -845,7 +843,7 @@ TclResetFilesystem(void) int Tcl_FSRegister( - void *clientData, /* Client-specific data for this filesystem. */ + void *clientData, /* Client-specific data for this filesystem. */ const Tcl_Filesystem *fsPtr)/* The filesystem record for the new fs. */ { FilesystemRecord *newFilesystemPtr; @@ -1105,8 +1103,7 @@ FsAddMountsToGlobResult( Tcl_Obj *pathPtr, /* The directory that was searched. */ const char *pattern, /* Pattern to match mounts against. */ Tcl_GlobTypeData *types) /* Acceptable types. May be NULL. The - * directory flag is particularly significant. - */ + * directory flag is particularly significant. */ { Tcl_Size mLength, gLength, i; int dir = (types == NULL || (types->type & TCL_GLOB_TYPE_DIR)); @@ -1171,7 +1168,6 @@ FsAddMountsToGlobResult( } len++; /* account for '/' in the mElt [Bug 1602539] */ - mElt = TclNewFSPathObj(pathPtr, mount + len, mlen - len); Tcl_ListObjAppendElement(NULL, resultPtr, mElt); } @@ -1365,7 +1361,6 @@ TclFSNormalizeToUniquePath( Claim(); if (!isVfsPath) { - /* * Find and call the native filesystem handler first if there is one * because the root of Tcl's filesystem is always a native filesystem @@ -1693,7 +1688,7 @@ Tcl_FSEvalFileEx( * Tilde-substitution is performed on this * pathname. */ const char *encodingName) /* Either the name of an encoding or NULL to - use the utf-8 encoding. */ + * use the utf-8 encoding. */ { Tcl_Size length; int result = TCL_ERROR; @@ -2086,7 +2081,7 @@ Tcl_PosixError( int Tcl_FSStat( Tcl_Obj *pathPtr, /* Pathname of the file to call stat on (in - * current CP). */ + * current system encoding). */ Tcl_StatBuf *buf) /* A buffer to hold the results of the call to * stat. */ { @@ -2121,7 +2116,7 @@ Tcl_FSStat( int Tcl_FSLstat( Tcl_Obj *pathPtr, /* Pathname of the file to call stat on (in - current CP). */ + * current system encoding). */ Tcl_StatBuf *buf) /* Filled with results of that call to stat. */ { const Tcl_Filesystem *fsPtr = Tcl_FSGetFileSystemForPath(pathPtr); @@ -2158,7 +2153,8 @@ Tcl_FSLstat( int Tcl_FSAccess( - Tcl_Obj *pathPtr, /* Pathname of file to access (in current CP). */ + Tcl_Obj *pathPtr, /* Pathname of file to access (in current + * system encoding). */ int mode) /* Permission setting. */ { const Tcl_Filesystem *fsPtr = Tcl_FSGetFileSystemForPath(pathPtr); @@ -2195,12 +2191,11 @@ Tcl_FSOpenFileChannel( const char *modeString, /* A list of POSIX open modes or a string such * as "rw". */ int permissions) /* What modes to use if opening the file - involves creating it. */ + * involves creating it. */ { const Tcl_Filesystem *fsPtr; Tcl_Channel retVal = NULL; - if (Tcl_FSGetNormalizedPath(interp, pathPtr) == NULL) { /* * Return the correct error message. @@ -3020,8 +3015,8 @@ Tcl_FSChdir( int Tcl_FSLoadFile( Tcl_Interp *interp, /* Used for error reporting. */ - Tcl_Obj *pathPtr, /* Pathname of the file containing the dynamic shared object. - */ + Tcl_Obj *pathPtr, /* Pathname of the file containing the dynamic + * shared object. */ const char *sym1, const char *sym2, /* Names of two functions to find in the * dynamic shared object. */ @@ -3109,14 +3104,13 @@ skipUnlink( * * 1. The operating system is HPUX. * - * 2. If the environment variable TCL_TEMPLOAD_NO_UNLINK is present and - * set to true (an integer > 0) - * - * 3. TCL_TEMPLOAD_NO_UNLINK is not true (an integer > 0) and AUFS filesystem can be detected (using statfs, if available). + * 2. If the environment variable TCL_TEMPLOAD_NO_UNLINK is present and + * set to true (an integer > 0) * + * 3. TCL_TEMPLOAD_NO_UNLINK is not true (an integer > 0) and AUFS + * filesystem can be detected (using statfs, if available). */ - #ifdef hpux (void)shlibFile; return 1; @@ -3655,9 +3649,7 @@ Tcl_FSUnloadFile( Tcl_Obj * Tcl_FSLink( Tcl_Obj *pathPtr, /* Pathaname of file. */ - Tcl_Obj *toPtr, /* - * NULL or the pathname of a file to link to. - */ + Tcl_Obj *toPtr, /* NULL or the pathname of a file to link to. */ int linkAction) /* Action to perform. */ { const Tcl_Filesystem *fsPtr = Tcl_FSGetFileSystemForPath(pathPtr); @@ -3906,7 +3898,8 @@ TclGetPathType( /* If not NULL, a place in which to store a * pointer to the filesystem for this pathname * if it is absolute. */ - Tcl_Size *driveNameLengthPtr, /* If not NULL, a place in which to store the + Tcl_Size *driveNameLengthPtr, + /* If not NULL, a place in which to store the * length of the volume name. */ Tcl_Obj **driveNameRef) /* If not NULL, for an absolute pathname, a * place to store a pointer to an object with a @@ -3960,9 +3953,9 @@ TclFSNonnativePathType( /* If not NULL, a place to store a pointer to * the filesystem for this pathname when it is * an absolute pathname. */ - Tcl_Size *driveNameLengthPtr,/* If not NULL, a place to store the length of - * the volume name if the pathname is absolute. - */ + Tcl_Size *driveNameLengthPtr, + /* If not NULL, a place to store the length of + * the volume name if the pathname is absolute. */ Tcl_Obj **driveNameRef) /* If not NULL, a place to store a pointer to * an object having its its refCount already * incremented, and contining the name of the @@ -4078,7 +4071,7 @@ TclFSNonnativePathType( int Tcl_FSRenameFile( Tcl_Obj *srcPathPtr, /* The pathname of a file or directory to be - renamed. */ + * renamed. */ Tcl_Obj *destPathPtr) /* The new pathname for the file. */ { int retVal = -1; diff --git a/generic/tclInt.h b/generic/tclInt.h index d6fdb88..768143c 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -1108,7 +1108,6 @@ typedef struct ActiveInterpTrace { ((objPtr)->typePtr)->proc : NULL) MODULE_SCOPE Tcl_Size TclLengthOne(Tcl_Obj *); - /* * Abstract List diff --git a/generic/tclInterp.c b/generic/tclInterp.c index b2d883b..5fbefbf 100644 --- a/generic/tclInterp.c +++ b/generic/tclInterp.c @@ -186,7 +186,7 @@ struct LimitHandler { int flags; /* The state of this particular handler. */ Tcl_LimitHandlerProc *handlerProc; /* The handler callback. */ - void *clientData; /* Opaque argument to the handler callback. */ + void *clientData; /* Opaque argument to the handler callback. */ Tcl_LimitHandlerDeleteProc *deleteProc; /* How to delete the clientData. */ LimitHandler *prevPtr; /* Previous item in linked list of @@ -207,8 +207,6 @@ struct LimitHandler { #define LIMIT_HANDLER_ACTIVE 0x01 #define LIMIT_HANDLER_DELETED 0x02 - - /* * Prototypes for local static functions: */ @@ -277,7 +275,6 @@ static void TimeLimitCallback(void *clientData); static Tcl_NRPostProc NRPostInvokeHidden; static Tcl_ObjCmdProc NRInterpCmd; static Tcl_ObjCmdProc NRChildCmd; - /* *---------------------------------------------------------------------- diff --git a/generic/tclListObj.c b/generic/tclListObj.c index 2d925e7..1bb3587 100644 --- a/generic/tclListObj.c +++ b/generic/tclListObj.c @@ -1616,8 +1616,7 @@ Tcl_Obj * TclListObjGetElement( Tcl_Obj *objPtr, /* List object for which an element array is * to be returned. */ - Tcl_Size index -) + Tcl_Size index) { return ListObjStorePtr(objPtr)->slots[ListObjStart(objPtr) + index]; } @@ -2018,7 +2017,6 @@ Tcl_ListObjLength( return TCL_OK; } - if (TclListObjGetRep(interp, listObj, &listRep) != TCL_OK) { return TCL_ERROR; } @@ -3552,7 +3550,6 @@ UpdateStringOfList( Tcl_Free(flagPtr); } } - /* *------------------------------------------------------------------------ diff --git a/generic/tclLoad.c b/generic/tclLoad.c index d7c13d1..c5a181d 100644 --- a/generic/tclLoad.c +++ b/generic/tclLoad.c @@ -12,7 +12,6 @@ #include "tclInt.h" - /* * The following structure describes a library that has been loaded either * dynamically (with the "load" command) or statically (as indicated by a call @@ -96,7 +95,6 @@ static int IsStatic(LoadedLibrary *libraryPtr); static int UnloadLibrary(Tcl_Interp *interp, Tcl_Interp *target, LoadedLibrary *library, int keepLibrary, const char *fullFileName, int interpExiting); - static int IsStatic( @@ -144,7 +142,7 @@ Tcl_LoadObjCmd( int flags = 0; Tcl_Obj *const *savedobjv = objv; static const char *const options[] = { - "-global", "-lazy", "--", NULL + "-global", "-lazy", "--", NULL }; enum loadOptionsEnum { LOAD_GLOBAL, LOAD_LAZY, LOAD_LAST @@ -168,7 +166,8 @@ Tcl_LoadObjCmd( } } if ((objc < 2) || (objc > 4)) { - Tcl_WrongNumArgs(interp, 1, savedobjv, "?-global? ?-lazy? ?--? fileName ?prefix? ?interp?"); + Tcl_WrongNumArgs(interp, 1, savedobjv, + "?-global? ?-lazy? ?--? fileName ?prefix? ?interp?"); return TCL_ERROR; } if (Tcl_FSConvertToPathType(interp, objv[1]) != TCL_OK) { @@ -753,7 +752,6 @@ Tcl_UnloadObjCmd( } return code; } - /* *---------------------------------------------------------------------- @@ -773,13 +771,12 @@ Tcl_UnloadObjCmd( */ static int UnloadLibrary( - Tcl_Interp *interp, - Tcl_Interp *target, - LoadedLibrary *libraryPtr, - int keepLibrary, - const char *fullFileName, - int interpExiting -) + Tcl_Interp *interp, + Tcl_Interp *target, + LoadedLibrary *libraryPtr, + int keepLibrary, + const char *fullFileName, + int interpExiting) { int code; InterpLibrary *ipFirstPtr, *ipPtr; @@ -821,8 +818,6 @@ UnloadLibrary( unloadProc = libraryPtr->unloadProc; } - - /* * We are ready to unload the library. First, evaluate the unload * function. If this fails, we cannot proceed with unload. Also, we must @@ -856,13 +851,11 @@ UnloadLibrary( code = unloadProc(target, code); } - if (code != TCL_OK) { Tcl_TransferResult(target, code, interp); goto done; } - /* * Remove this library from the interpreter's library cache. */ @@ -885,7 +878,6 @@ UnloadLibrary( Tcl_Free(ipPtr); Tcl_SetAssocData(target, "tclLoad", LoadCleanupProc, ipFirstPtr); - if (IsStatic(libraryPtr)) { goto done; } @@ -1107,9 +1099,8 @@ TclGetLoadedLibraries( * NULL, return info about all interps; * otherwise, just return info about this * interpreter. */ - const char *prefix) /* Prefix or NULL. If NULL, return info - * for all prefixes. - */ + const char *prefix) /* Prefix or NULL. If NULL, return info + * for all prefixes. */ { Tcl_Interp *target; LoadedLibrary *libraryPtr; diff --git a/generic/tclNamesp.c b/generic/tclNamesp.c index 2a30742..eebf6aa 100644 --- a/generic/tclNamesp.c +++ b/generic/tclNamesp.c @@ -1079,8 +1079,7 @@ TclNamespaceDeleted( void TclDeleteNamespaceChildren( - Namespace *nsPtr /* Namespace whose children to delete */ -) + Namespace *nsPtr) /* Namespace whose children to delete */ { Interp *iPtr = (Interp *) nsPtr->interp; Tcl_HashEntry *entryPtr; @@ -3962,7 +3961,6 @@ NamespaceOriginCmd( Tcl_SetObjResult(interp, resultPtr); return TCL_OK; } - /* *---------------------------------------------------------------------- @@ -5156,7 +5154,6 @@ Tcl_LogCommandInfo( { TclLogCommandInfo(interp, script, command, length, NULL, NULL); } - /* * Local Variables: diff --git a/generic/tclOOCall.c b/generic/tclOOCall.c index 7695483..46ee8be 100644 --- a/generic/tclOOCall.c +++ b/generic/tclOOCall.c @@ -155,7 +155,6 @@ static const Tcl_ObjType methodNameType = { NULL, TCL_OBJTYPE_V0 }; - /* * ---------------------------------------------------------------------- diff --git a/generic/tclObj.c b/generic/tclObj.c index 30634a0..36856d4 100644 --- a/generic/tclObj.c +++ b/generic/tclObj.c @@ -349,7 +349,6 @@ typedef struct ResolvedCmdName { #define FREEDREFCOUNTFILLER \ (Tcl_Size)(sizeof(objPtr->refCount) == 4 ? 0xe8e8e8e8 : 0xe8e8e8e8e8e8e8e8) #endif - /* *------------------------------------------------------------------------- @@ -2568,7 +2567,6 @@ Tcl_GetIntFromObj( return TCL_OK; #endif } - /* *---------------------------------------------------------------------- diff --git a/generic/tclPanic.c b/generic/tclPanic.c index dcceb25..ed12640 100644 --- a/generic/tclPanic.c +++ b/generic/tclPanic.c @@ -81,7 +81,6 @@ Tcl_Panic( * to pass to fprintf. */ char *arg4, *arg5, *arg6, *arg7, *arg8; - va_start(argList, format); arg1 = va_arg(argList, char *); arg2 = va_arg(argList, char *); diff --git a/generic/tclParse.c b/generic/tclParse.c index 13e5c1e..e88de0b 100644 --- a/generic/tclParse.c +++ b/generic/tclParse.c @@ -1396,7 +1396,7 @@ Tcl_ParseVarName( case '}': braceCount--; break; case '\\': /* if 2 or more left, consume 2, else consume - just the \ and let it run into the end */ + * just the \ and let it run into the end */ if (numBytes > 1) { src++; numBytes--; } diff --git a/generic/tclPathObj.c b/generic/tclPathObj.c index 80954bc..9a44863 100644 --- a/generic/tclPathObj.c +++ b/generic/tclPathObj.c @@ -1519,7 +1519,6 @@ Tcl_FSNewNativePath( Tcl_Obj *pathPtr = NULL; FsPath *fsPathPtr; - if (fromFilesystem->internalToNormalizedProc != NULL) { pathPtr = (*fromFilesystem->internalToNormalizedProc)(clientData); } @@ -2689,7 +2688,6 @@ TclResolveTildePathList( return resolvedPaths; } - /* * Local Variables: diff --git a/generic/tclProc.c b/generic/tclProc.c index 40c6f32..2f87048 100644 --- a/generic/tclProc.c +++ b/generic/tclProc.c @@ -69,7 +69,7 @@ const Tcl_ObjType tclProcBodyType = { TCL_OBJTYPE_V0 }; -#define ProcSetInternalRep(objPtr, procPtr) \ +#define ProcSetInternalRep(objPtr, procPtr) \ do { \ Tcl_ObjInternalRep ir; \ (procPtr)->refCount++; \ @@ -78,11 +78,11 @@ const Tcl_ObjType tclProcBodyType = { Tcl_StoreInternalRep((objPtr), &tclProcBodyType, &ir); \ } while (0) -#define ProcGetInternalRep(objPtr, procPtr) \ +#define ProcGetInternalRep(objPtr, procPtr) \ do { \ - const Tcl_ObjInternalRep *irPtr; \ - irPtr = TclFetchInternalRep((objPtr), &tclProcBodyType); \ - (procPtr) = irPtr ? (Proc *)irPtr->twoPtrValue.ptr1 : NULL; \ + const Tcl_ObjInternalRep *irPtr; \ + irPtr = TclFetchInternalRep((objPtr), &tclProcBodyType); \ + (procPtr) = irPtr ? (Proc *)irPtr->twoPtrValue.ptr1 : NULL; \ } while (0) /* @@ -116,23 +116,22 @@ static const Tcl_ObjType lambdaType = { TCL_OBJTYPE_V0 }; -#define LambdaSetInternalRep(objPtr, procPtr, nsObjPtr) \ +#define LambdaSetInternalRep(objPtr, procPtr, nsObjPtr) \ do { \ Tcl_ObjInternalRep ir; \ ir.twoPtrValue.ptr1 = (procPtr); \ ir.twoPtrValue.ptr2 = (nsObjPtr); \ Tcl_IncrRefCount((nsObjPtr)); \ - Tcl_StoreInternalRep((objPtr), &lambdaType, &ir); \ + Tcl_StoreInternalRep((objPtr), &lambdaType, &ir); \ } while (0) -#define LambdaGetInternalRep(objPtr, procPtr, nsObjPtr) \ +#define LambdaGetInternalRep(objPtr, procPtr, nsObjPtr) \ do { \ - const Tcl_ObjInternalRep *irPtr; \ - irPtr = TclFetchInternalRep((objPtr), &lambdaType); \ - (procPtr) = irPtr ? (Proc *)irPtr->twoPtrValue.ptr1 : NULL; \ - (nsObjPtr) = irPtr ? (Tcl_Obj *)irPtr->twoPtrValue.ptr2 : NULL; \ + const Tcl_ObjInternalRep *irPtr; \ + irPtr = TclFetchInternalRep((objPtr), &lambdaType); \ + (procPtr) = irPtr ? (Proc *)irPtr->twoPtrValue.ptr1 : NULL; \ + (nsObjPtr) = irPtr ? (Tcl_Obj *)irPtr->twoPtrValue.ptr2 : NULL; \ } while (0) - /* *---------------------------------------------------------------------- @@ -156,7 +155,7 @@ int Tcl_ProcObjCmd( TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ - Tcl_Size objc, /* Number of arguments. */ + Tcl_Size objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Interp *iPtr = (Interp *) interp; @@ -1095,7 +1094,8 @@ ProcWrongNumArgs( if (defPtr->value.objPtr != NULL) { TclNewObj(argObj); - Tcl_AppendStringsToObj(argObj, "?", TclGetString(namePtr), "?", (void *)NULL); + Tcl_AppendStringsToObj(argObj, "?", TclGetString(namePtr), "?", + (void *)NULL); } else if (defPtr->flags & VAR_IS_ARGS) { numArgs--; final = "?arg ...?"; @@ -1339,7 +1339,7 @@ InitLocalCache( static int InitArgsAndLocals( - Tcl_Interp *interp,/* Interpreter in which procedure was + Tcl_Interp *interp, /* Interpreter in which procedure was * invoked. */ int skip) /* Number of initial arguments to be skipped, * i.e., words in the "command name". */ @@ -1503,9 +1503,9 @@ InitArgsAndLocals( int TclPushProcCallFrame( - void *clientData, /* Record describing procedure to be + void *clientData, /* Record describing procedure to be * interpreted. */ - Tcl_Interp *interp,/* Interpreter in which procedure was + Tcl_Interp *interp, /* Interpreter in which procedure was * invoked. */ Tcl_Size objc, /* Count of number of arguments to this * procedure. */ @@ -1597,9 +1597,9 @@ TclPushProcCallFrame( int TclObjInterpProc( - void *clientData, /* Record describing procedure to be + void *clientData, /* Record describing procedure to be * interpreted. */ - Tcl_Interp *interp,/* Interpreter in which procedure was + Tcl_Interp *interp, /* Interpreter in which procedure was * invoked. */ int objc, /* Count of number of arguments to this * procedure. */ @@ -1614,11 +1614,11 @@ TclObjInterpProc( int TclNRInterpProc( - void *clientData, /* Record describing procedure to be + void *clientData, /* Record describing procedure to be * interpreted. */ - Tcl_Interp *interp,/* Interpreter in which procedure was + Tcl_Interp *interp, /* Interpreter in which procedure was * invoked. */ - Tcl_Size objc, /* Count of number of arguments to this + Tcl_Size objc, /* Count of number of arguments to this * procedure. */ Tcl_Obj *const objv[]) /* Argument value objects. */ { @@ -1637,7 +1637,7 @@ NRInterpProc( * interpreted. */ Tcl_Interp *interp, /* Interpreter in which procedure was * invoked. */ - int objc, /* Count of number of arguments to this + int objc, /* Count of number of arguments to this * procedure. */ Tcl_Obj *const objv[]) /* Argument value objects. */ { @@ -1666,7 +1666,6 @@ ObjInterpProc2( return Tcl_NRCallObjProc2(interp, TclNRInterpProc, clientData, objc, objv); } - /* *---------------------------------------------------------------------- @@ -1688,10 +1687,10 @@ ObjInterpProc2( int TclNRInterpProcCore( - Tcl_Interp *interp,/* Interpreter in which procedure was + Tcl_Interp *interp, /* Interpreter in which procedure was * invoked. */ Tcl_Obj *procNameObj, /* Procedure name for error reporting. */ - Tcl_Size skip, /* Number of initial arguments to be skipped, + Tcl_Size skip, /* Number of initial arguments to be skipped, * i.e., words in the "command name". */ ProcErrorProc *errorProc) /* How to convert results from the script into * results of the overall procedure. */ @@ -2137,7 +2136,7 @@ TclProcDeleteProc( void TclProcCleanupProc( - Proc *procPtr) /* Procedure to be deleted. */ + Proc *procPtr) /* Procedure to be deleted. */ { CompiledLocal *localPtr; Tcl_Obj *bodyPtr = procPtr->bodyPtr; @@ -2402,7 +2401,7 @@ ProcBodyFree( static void DupLambdaInternalRep( Tcl_Obj *srcPtr, /* Object with internal rep to copy. */ - Tcl_Obj *copyPtr) /* Object with internal rep to set. */ + Tcl_Obj *copyPtr) /* Object with internal rep to set. */ { Proc *procPtr; Tcl_Obj *nsObjPtr; @@ -2417,7 +2416,7 @@ DupLambdaInternalRep( static void FreeLambdaInternalRep( - Tcl_Obj *objPtr) /* CmdName object with internal representation + Tcl_Obj *objPtr) /* CmdName object with internal representation * to free. */ { Proc *procPtr; @@ -2435,7 +2434,7 @@ FreeLambdaInternalRep( static int SetLambdaFromAny( Tcl_Interp *interp, /* Used for error reporting if not NULL. */ - Tcl_Obj *objPtr) /* The object to convert. */ + Tcl_Obj *objPtr) /* The object to convert. */ { Interp *iPtr = (Interp *) interp; const char *name; diff --git a/generic/tclProcess.c b/generic/tclProcess.c index 968e191..a5607d9 100644 --- a/generic/tclProcess.c +++ b/generic/tclProcess.c @@ -350,7 +350,6 @@ WaitProcessStatus( } } - /* *---------------------------------------------------------------------- * @@ -891,8 +890,7 @@ TclProcessWait( * - errno in case of error. * - non-zero exit code for abormal exit. * - signal number if killed or suspended. - * - Tcl_WaitPid status in all other cases. - */ + * - Tcl_WaitPid status in all other cases. */ Tcl_Obj **msgObjPtr, /* If non-NULL, will receive error message. */ Tcl_Obj **errorObjPtr) /* If non-NULL, will receive error code. */ { diff --git a/generic/tclRegexp.c b/generic/tclRegexp.c index bc6468d..04f060b 100644 --- a/generic/tclRegexp.c +++ b/generic/tclRegexp.c @@ -111,22 +111,21 @@ const Tcl_ObjType tclRegexpType = { TCL_OBJTYPE_V0 }; -#define RegexpSetInternalRep(objPtr, rePtr) \ +#define RegexpSetInternalRep(objPtr, rePtr) \ do { \ Tcl_ObjInternalRep ir; \ (rePtr)->refCount++; \ ir.twoPtrValue.ptr1 = (rePtr); \ ir.twoPtrValue.ptr2 = NULL; \ - Tcl_StoreInternalRep((objPtr), &tclRegexpType, &ir); \ + Tcl_StoreInternalRep((objPtr), &tclRegexpType, &ir); \ } while (0) -#define RegexpGetInternalRep(objPtr, rePtr) \ +#define RegexpGetInternalRep(objPtr, rePtr) \ do { \ - const Tcl_ObjInternalRep *irPtr; \ + const Tcl_ObjInternalRep *irPtr; \ irPtr = TclFetchInternalRep((objPtr), &tclRegexpType); \ - (rePtr) = irPtr ? (TclRegexp *)irPtr->twoPtrValue.ptr1 : NULL; \ + (rePtr) = irPtr ? (TclRegexp *)irPtr->twoPtrValue.ptr1 : NULL; \ } while (0) - /* *---------------------------------------------------------------------- @@ -223,8 +222,8 @@ Tcl_RegExpExec( Tcl_DStringInit(&ds); ustr = Tcl_UtfToUniCharDString(text, TCL_INDEX_NONE, &ds); numChars = Tcl_DStringLength(&ds) / sizeof(Tcl_UniChar); - result = RegExpExecUniChar(interp, re, ustr, numChars, TCL_INDEX_NONE /* nmatches */, - flags); + result = RegExpExecUniChar(interp, re, ustr, numChars, + TCL_INDEX_NONE /* nmatches */, flags); Tcl_DStringFree(&ds); return result; @@ -306,7 +305,7 @@ RegExpExecUniChar( * previous call to Tcl_GetRegExpFromObj */ const Tcl_UniChar *wString, /* String against which to match re. */ size_t numChars, /* Length of Tcl_UniChar string. */ - size_t nm, /* How many subexpression matches (counting + size_t nm, /* How many subexpression matches (counting * the whole match as subexpression 0) are of * interest. -1 means "don't know". */ int flags) /* Regular expression flags. */ @@ -367,9 +366,9 @@ TclRegExpRangeUniChar( * > 0 means give the range of a matching * subrange, -1 means the range of the * rm_extend field. */ - Tcl_Size *startPtr, /* Store address of first character in + Tcl_Size *startPtr, /* Store address of first character in * (sub-)range here. */ - Tcl_Size *endPtr) /* Store address of character just after last + Tcl_Size *endPtr) /* Store address of character just after last * in (sub-)range here. */ { TclRegexp *regexpPtr = (TclRegexp *) re; @@ -445,7 +444,7 @@ Tcl_RegExpExecObj( Tcl_Obj *textObj, /* Text against which to match re. */ Tcl_Size offset, /* Character index that marks where matching * should begin. */ - Tcl_Size nmatches, /* How many subexpression matches (counting + Tcl_Size nmatches, /* How many subexpression matches (counting * the whole match as subexpression 0) are of * interest. -1 means all of them. */ int flags) /* Regular expression execution flags. */ @@ -859,7 +858,7 @@ static TclRegexp * CompileRegexp( Tcl_Interp *interp, /* Used for error reporting if not NULL. */ const char *string, /* The regexp to compile (UTF-8). */ - size_t length, /* The length of the string in bytes. */ + size_t length, /* The length of the string in bytes. */ int flags) /* Compilation flags. */ { TclRegexp *regexpPtr; diff --git a/generic/tclStrToD.c b/generic/tclStrToD.c index 87aab60..1b78184 100644 --- a/generic/tclStrToD.c +++ b/generic/tclStrToD.c @@ -26,7 +26,6 @@ # define PRIx64 TCL_LL_MODIFIER "x" #endif - /* * This code supports (at least hypothetically), IBM, Cray, VAX and IEEE-754 * floating point; of these, only IEEE-754 can represent NaN. IEEE-754 can be @@ -4230,7 +4229,6 @@ StrictBignumConversion( * Extract the next group of digits. */ - if ((err != MP_OKAY) || (mp_div(&b, &S, &dig, &b) != MP_OKAY) || (dig.used > 1)) { Tcl_Panic("wrong digit!"); } @@ -4848,7 +4846,6 @@ TclBignumToDouble( mp_err err; const mp_int *a = (const mp_int *)big; - /* * We need a 'mantBits'-bit significand. Determine what shift will * give us that. diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c index 73391fe..05c578e 100644 --- a/generic/tclStringObj.c +++ b/generic/tclStringObj.c @@ -459,7 +459,6 @@ TclGetCharLength( return numChars; } - /* *---------------------------------------------------------------------- * @@ -3520,7 +3519,6 @@ TclStringCat( *--------------------------------------------------------------------------- */ - static int UniCharNcasememcmp( const void *ucsPtr, /* Unicode string to compare to uct. */ diff --git a/generic/tclStringRep.h b/generic/tclStringRep.h index 4e38a64..a7bca14 100644 --- a/generic/tclStringRep.h +++ b/generic/tclStringRep.h @@ -18,7 +18,6 @@ #ifndef _TCLSTRINGREP #define _TCLSTRINGREP - /* * The following structure is the internal rep for a String object. It keeps * track of how much memory has been used and how much has been allocated for diff --git a/generic/tclStubLibTbl.c b/generic/tclStubLibTbl.c index ad34494..6ac879c 100644 --- a/generic/tclStubLibTbl.c +++ b/generic/tclStubLibTbl.c @@ -33,14 +33,14 @@ MODULE_SCOPE void *tclStubsHandle; */ MODULE_SCOPE const char * TclInitStubTable( - const char *version) /* points to the version field of a - structure variable. */ + const char *version) /* points to the version field of a + * structure variable. */ { if (version) { if (tclStubsHandle == NULL) { - /* This can only happen with -DBUILD_STATIC, so simulate - * that the loading of Tcl succeeded, although we didn't - * actually load it dynamically */ + /* This can only happen with -DBUILD_STATIC, so simulate + * that the loading of Tcl succeeded, although we didn't + * actually load it dynamically */ tclStubsHandle = (void *)1; } tclStubsPtr = ((const TclStubs **) version)[-1]; diff --git a/generic/tclThread.c b/generic/tclThread.c index 698c642..c107780 100644 --- a/generic/tclThread.c +++ b/generic/tclThread.c @@ -145,7 +145,6 @@ RememberSyncObject( void **newList; int i, j; - /* * Reuse any free slot in the list. */ diff --git a/generic/tclTomMathStubLib.c b/generic/tclTomMathStubLib.c index c0786c9..492c95f 100644 --- a/generic/tclTomMathStubLib.c +++ b/generic/tclTomMathStubLib.c @@ -18,7 +18,6 @@ MODULE_SCOPE const TclTomMathStubs *tclTomMathStubsPtr; const TclTomMathStubs *tclTomMathStubsPtr = NULL; - /* *---------------------------------------------------------------------- * diff --git a/generic/tclTrace.c b/generic/tclTrace.c index 33085f3..f4e9fe5 100644 --- a/generic/tclTrace.c +++ b/generic/tclTrace.c @@ -1016,7 +1016,6 @@ Tcl_TraceCommand( cmdPtr->flags |= CMD_HAS_EXEC_TRACES; } - return TCL_OK; } diff --git a/generic/tclUtf.c b/generic/tclUtf.c index e107081..03ea8b6 100644 --- a/generic/tclUtf.c +++ b/generic/tclUtf.c @@ -1717,7 +1717,6 @@ TclUtfCmp( } return UCHAR(*cs) - UCHAR(*ct); } - /* *---------------------------------------------------------------------- @@ -1757,7 +1756,6 @@ TclUtfCasecmp( } return UCHAR(*cs) - UCHAR(*ct); } - /* *---------------------------------------------------------------------- diff --git a/generic/tclUtil.c b/generic/tclUtil.c index 0c9a3b2..3043fed 100644 --- a/generic/tclUtil.c +++ b/generic/tclUtil.c @@ -2598,10 +2598,11 @@ char * Tcl_DStringAppend( Tcl_DString *dsPtr, /* Structure describing dynamic string. */ const char *bytes, /* String to append. If length is - * TCL_INDEX_NONE then this must be null-terminated. */ + * TCL_INDEX_NONE then this must be + * null-terminated. */ Tcl_Size length) /* Number of bytes from "bytes" to append. If - * TCL_INDEX_NONE, then append all of bytes, up to null - * at end. */ + * TCL_INDEX_NONE, then append all of bytes, up + * to null at end. */ { Tcl_Size newSize; @@ -2617,7 +2618,6 @@ Tcl_DStringAppend( } newSize = length + dsPtr->length + 1; - if (newSize > dsPtr->spaceAvl) { if (dsPtr->string == dsPtr->staticSpace) { char *newString; diff --git a/generic/tclZipfs.c b/generic/tclZipfs.c index 12f0ea0..b0bb383 100644 --- a/generic/tclZipfs.c +++ b/generic/tclZipfs.c @@ -217,9 +217,9 @@ typedef struct ZipEntry { ZipFile *zipFilePtr; /* The ZIP file holding this virtual file */ size_t offset; /* Data offset into memory mapped ZIP file */ int numBytes; /* Uncompressed size of the virtual file. - -1 for zip64 */ + * -1 for zip64 */ int numCompressedBytes; /* Compressed size of the virtual file. - -1 for zip64 */ + * -1 for zip64 */ int compressMethod; /* Compress method */ int isDirectory; /* 0 if file, 1 if directory, -1 if root */ int depth; /* Number of slashes in path. */ @@ -810,11 +810,13 @@ IsCryptHeaderValid( *------------------------------------------------------------------------ */ static int -DecodeCryptHeader(Tcl_Interp *interp, - ZipEntry *z, - unsigned long keys[3],/* Updated on success. Must have been - initialized by caller. */ - unsigned char cryptHeader[ZIP_CRYPT_HDR_LEN]) /* From zip file content */ +DecodeCryptHeader( + Tcl_Interp *interp, + ZipEntry *z, + unsigned long keys[3], /* Updated on success. Must have been + * initialized by caller. */ + unsigned char cryptHeader[ZIP_CRYPT_HDR_LEN]) + /* From zip file content */ { int i; int ch; @@ -1065,11 +1067,12 @@ errorReturn: *------------------------------------------------------------------------ */ static char * -MapPathToZipfs(Tcl_Interp *interp, - const char *mountPath, /* Must be fully normalized */ - const char *path, /* Archive content path to map */ - Tcl_DString *dsPtr) /* Must be initialized and cleared - by caller */ +MapPathToZipfs( + Tcl_Interp *interp, + const char *mountPath, /* Must be fully normalized */ + const char *path, /* Archive content path to map */ + Tcl_DString *dsPtr) /* Must be initialized and cleared + * by caller */ { const char *joiner[2]; char *joinedPath; diff --git a/macosx/tclMacOSXNotify.c b/macosx/tclMacOSXNotify.c index 9123656..d8af241 100644 --- a/macosx/tclMacOSXNotify.c +++ b/macosx/tclMacOSXNotify.c @@ -846,7 +846,6 @@ StartNotifierThread(void) } UNLOCK_NOTIFIER_INIT; } - /* *---------------------------------------------------------------------- diff --git a/unix/tclKqueueNotfy.c b/unix/tclKqueueNotfy.c index 062139a..ba49842 100644 --- a/unix/tclKqueueNotfy.c +++ b/unix/tclKqueueNotfy.c @@ -185,8 +185,7 @@ PlatformEventsControl( Tcl_Panic("fstat: %s", strerror(errno)); } else if ((fdStat.st_mode & S_IFMT) == S_IFREG || (fdStat.st_mode & S_IFMT) == S_IFDIR - || (fdStat.st_mode & S_IFMT) == S_IFLNK - ) { + || (fdStat.st_mode & S_IFMT) == S_IFLNK) { switch (op) { case EV_ADD: if (isNew) { diff --git a/unix/tclLoadNext.c b/unix/tclLoadNext.c index 12df7e4..de185fb 100644 --- a/unix/tclLoadNext.c +++ b/unix/tclLoadNext.c @@ -14,7 +14,6 @@ #include #include - /* * Static procedures defined within this file. */ diff --git a/unix/tclLoadOSF.c b/unix/tclLoadOSF.c index 1c8b53a..81f314f 100644 --- a/unix/tclLoadOSF.c +++ b/unix/tclLoadOSF.c @@ -36,7 +36,6 @@ #include #include - /* * Static procedures defined within this file. */ diff --git a/unix/tclUnixInit.c b/unix/tclUnixInit.c index 67bff10..81e3af5 100644 --- a/unix/tclUnixInit.c +++ b/unix/tclUnixInit.c @@ -335,7 +335,6 @@ static int MacOSXGetLibraryPath(Tcl_Interp *interp, MODULE_SCOPE long tclMacOSXDarwinRelease; long tclMacOSXDarwinRelease = 0; #endif - /* *--------------------------------------------------------------------------- diff --git a/win/tclWinChan.c b/win/tclWinChan.c index 8715b4d..4c08464 100644 --- a/win/tclWinChan.c +++ b/win/tclWinChan.c @@ -108,10 +108,10 @@ static Tcl_Channel OpenFileChannel(HANDLE handle, char *channelName, static const Tcl_ChannelType fileChannelType = { "file", /* Type name. */ TCL_CHANNEL_VERSION_5, /* v5 channel */ - NULL, /* Close proc. */ + NULL, /* Close proc. */ FileInputProc, /* Input proc. */ FileOutputProc, /* Output proc. */ - NULL, + NULL, NULL, /* Set option proc. */ FileGetOptionProc, /* Get option proc. */ FileWatchProc, /* Set up the notifier to watch the channel. */ @@ -140,7 +140,6 @@ static const Tcl_ChannelType fileChannelType = { #define POSIX_EPOCH_AS_FILETIME \ ((long long) 116444736 * (long long) 1000000000) - /* *---------------------------------------------------------------------- diff --git a/win/tclWinConsole.c b/win/tclWinConsole.c index b7288b7..8b289b1 100644 --- a/win/tclWinConsole.c +++ b/win/tclWinConsole.c @@ -280,7 +280,6 @@ static Tcl_ThreadDataKey dataKey; */ SRWLOCK gConsoleLock; - /* Process-wide list of console handles. Access control through gConsoleLock */ static ConsoleHandleInfo *gConsoleHandleInfoList; @@ -905,7 +904,7 @@ ConsoleCheckProc( /* See note above loop why this can be accessed without locks */ chanInfoPtr->flags |= CONSOLE_EVENT_QUEUED; chanInfoPtr->numRefs += 1; /* So it does not go away while event - is in queue */ + * is in queue */ evPtr->header.proc = ConsoleEventProc; evPtr->chanInfoPtr = chanInfoPtr; Tcl_QueueEvent((Tcl_Event *) evPtr, TCL_QUEUE_TAIL); @@ -973,7 +972,7 @@ ConsoleBlockModeProc( static int ConsoleCloseProc( - void *instanceData, /* Pointer to ConsoleChannelInfo structure. */ + void *instanceData, /* Pointer to ConsoleChannelInfo structure. */ TCL_UNUSED(Tcl_Interp *), int flags) { diff --git a/win/tclWinFCmd.c b/win/tclWinFCmd.c index e7164df..0af484d 100644 --- a/win/tclWinFCmd.c +++ b/win/tclWinFCmd.c @@ -53,7 +53,6 @@ enum { static const int attributeArray[] = {FILE_ATTRIBUTE_ARCHIVE, FILE_ATTRIBUTE_HIDDEN, 0, FILE_ATTRIBUTE_READONLY, 0, FILE_ATTRIBUTE_SYSTEM}; - const char *const tclpFileAttrStrings[] = { "-archive", "-hidden", "-longname", "-readonly", "-shortname", "-system", NULL diff --git a/win/tclWinInt.h b/win/tclWinInt.h index 6de1432..9995602 100644 --- a/win/tclWinInt.h +++ b/win/tclWinInt.h @@ -75,11 +75,10 @@ typedef struct TclPipeThreadInfo { * to do read/write operation. Additionally * used as signal to stop (state set to -1) */ volatile LONG state; /* Indicates current state of the thread */ - void *clientData; /* Referenced data of the main thread */ + void *clientData; /* Referenced data of the main thread */ HANDLE evWakeUp; /* Optional wake-up event worker set by shutdown */ } TclPipeThreadInfo; - /* If pipe-workers will use some tcl subsystem, we can use Tcl_Alloc without * more overhead for finalize thread (should be executed anyway) * @@ -99,7 +98,6 @@ typedef struct TclPipeThreadInfo { #define PTI_STATE_END 4 /* thread should stop work (worker is busy) */ #define PTI_STATE_DOWN 8 /* worker is down */ - MODULE_SCOPE TclPipeThreadInfo * TclPipeThreadCreateTI(TclPipeThreadInfo **pipeTIPtr, void *clientData, HANDLE wakeEvent); diff --git a/win/tclWinPipe.c b/win/tclWinPipe.c index 3f0269c..dbf3324 100644 --- a/win/tclWinPipe.c +++ b/win/tclWinPipe.c @@ -1187,7 +1187,6 @@ TclpCreateProcess( } return result; } - /* *---------------------------------------------------------------------- diff --git a/win/tclWinPort.h b/win/tclWinPort.h index efd9ff2..8ab4548 100644 --- a/win/tclWinPort.h +++ b/win/tclWinPort.h @@ -246,7 +246,6 @@ typedef DWORD_PTR * PDWORD_PTR; # define EWOULDBLOCK 140 /* Operation would block */ #endif - /* Visual Studio doesn't have these, so just choose some high numbers */ #ifndef ESOCKTNOSUPPORT # define ESOCKTNOSUPPORT 240 /* Socket type not supported */ @@ -415,7 +414,6 @@ typedef DWORD_PTR * PDWORD_PTR; # endif #endif /* !S_ISLNK */ - /* * Define MAXPATHLEN in terms of MAXPATH if available */ @@ -524,7 +522,6 @@ typedef DWORD_PTR * PDWORD_PTR; /* This type is not defined in the Windows headers */ #define socklen_t int - /* * The following macros have trivial definitions, allowing generic code to * address platform-specific issues. diff --git a/win/tclWinSerial.c b/win/tclWinSerial.c index d8193b4..e27937e 100644 --- a/win/tclWinSerial.c +++ b/win/tclWinSerial.c @@ -613,7 +613,6 @@ SerialCloseProc( return EINVAL; } - if (serialPtr->validMask & TCL_READABLE) { PurgeComm(serialPtr->handle, PURGE_RXABORT | PURGE_RXCLEAR); CloseHandle(serialPtr->osRead.hEvent); @@ -1480,7 +1479,6 @@ TclWinOpenSerialChannel( infoPtr->channel = Tcl_CreateChannel(&serialChannelType, channelName, infoPtr, permissions); - SetupComm(handle, infoPtr->sysBufRead, infoPtr->sysBufWrite); PurgeComm(handle, PURGE_TXABORT | PURGE_RXABORT | PURGE_TXCLEAR | PURGE_RXCLEAR); diff --git a/win/tclWinThrd.c b/win/tclWinThrd.c index d99de8c..d5c582b 100644 --- a/win/tclWinThrd.c +++ b/win/tclWinThrd.c @@ -79,10 +79,10 @@ static CRITICAL_SECTION joinLock; #if TCL_THREADS typedef struct ThreadSpecificData { - HANDLE condEvent; /* Per-thread condition event */ + HANDLE condEvent; /* Per-thread condition event */ struct ThreadSpecificData *nextPtr; /* Queue pointers */ struct ThreadSpecificData *prevPtr; - int flags; /* See flags below */ + int flags; /* See flags below */ } ThreadSpecificData; static Tcl_ThreadDataKey dataKey; @@ -120,7 +120,7 @@ typedef struct { static DWORD tlsKey; typedef struct { - Tcl_Mutex tlock; + Tcl_Mutex tlock; CRITICAL_SECTION wlock; } allocMutex; #endif /* USE_THREAD_ALLOC */ @@ -131,12 +131,12 @@ typedef struct { */ typedef struct { - LPTHREAD_START_ROUTINE lpStartAddress; /* Original startup routine */ - LPVOID lpParameter; /* Original startup data */ - unsigned int fpControl; /* Floating point control word from the + LPTHREAD_START_ROUTINE lpStartAddress; + /* Original startup routine */ + LPVOID lpParameter; /* Original startup data */ + unsigned int fpControl; /* Floating point control word from the * main thread */ } WinThread; - /* *---------------------------------------------------------------------- @@ -567,9 +567,9 @@ Tcl_MutexLock( */ if (*mutexPtr == NULL) { - csPtr = (CRITICAL_SECTION *)Tcl_Alloc(sizeof(CRITICAL_SECTION)); + csPtr = (CRITICAL_SECTION *) Tcl_Alloc(sizeof(CRITICAL_SECTION)); InitializeCriticalSection(csPtr); - *mutexPtr = (Tcl_Mutex)csPtr; + *mutexPtr = (Tcl_Mutex) csPtr; TclRememberMutex(mutexPtr); } TclpGlobalUnlock(); @@ -659,7 +659,7 @@ void Tcl_ConditionWait( Tcl_Condition *condPtr, /* Really (WinCondition **) */ Tcl_Mutex *mutexPtr, /* Really (CRITICAL_SECTION **) */ - const Tcl_Time *timePtr) /* Timeout on waiting period */ + const Tcl_Time *timePtr) /* Timeout on waiting period */ { WinCondition *winCondPtr; /* Per-condition queue head */ CRITICAL_SECTION *csPtr; /* Caller's Mutex, after casting */ @@ -926,9 +926,6 @@ TclpFinalizeCondition( } } - - - /* * Additions by AOL for specialized thread memory allocator. */ @@ -1030,7 +1027,6 @@ TclpFreeAllocCache( } #endif /* USE_THREAD_ALLOC */ - void * TclpThreadCreateKey(void) { diff --git a/win/tclWinTime.c b/win/tclWinTime.c index 77f7547..5636dc0 100644 --- a/win/tclWinTime.c +++ b/win/tclWinTime.c @@ -103,7 +103,6 @@ static struct { double microsecsScale; /* Denominator scale between clock / microsecs */ } wideClick = {0, 0, 0.0}; - /* * Declarations for functions defined later in this file. */ -- cgit v0.12