From e5de9528c47b0d8428ea81f5fbb9da883158b435 Mon Sep 17 00:00:00 2001 From: dkf Date: Thu, 3 Feb 2005 13:31:10 +0000 Subject: Whitespace fixes and add notes to #else/#endif so it is clearer what's happening --- generic/tclThread.c | 51 ++++++++++++++++++++++++++------------------------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/generic/tclThread.c b/generic/tclThread.c index ab079c1..6fc558c 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.9 2005/01/21 17:42:27 andreas_kupries Exp $ + * RCS: @(#) $Id: tclThread.c,v 1.10 2005/02/03 13:31:10 dkf Exp $ */ #include "tclInt.h" @@ -93,7 +93,7 @@ Tcl_GetThreadData(keyPtr, size) TclThreadStorageDataKeyInit(keyPtr); #else TclpThreadDataKeyInit(keyPtr); -#endif +#endif /* USE_THREAD_STORAGE */ } /* @@ -103,18 +103,18 @@ Tcl_GetThreadData(keyPtr, size) result = TclThreadStorageDataKeyGet(keyPtr); #else result = TclpThreadDataKeyGet(keyPtr); -#endif +#endif /* USE_THREAD_STORAGE */ if (result == NULL) { result = (VOID *)ckalloc((size_t)size); memset(result, 0, (size_t)size); #ifdef USE_THREAD_STORAGE - TclThreadStorageDataKeySet(keyPtr, result); + TclThreadStorageDataKeySet(keyPtr, result); #else TclpThreadDataKeySet(keyPtr, result); -#endif +#endif /* USE_THREAD_STORAGE */ } -#else +#else /* TCL_THREADS */ if (*keyPtr == NULL) { result = (VOID *)ckalloc((size_t)size); memset((char *)result, 0, (size_t)size); @@ -122,7 +122,7 @@ Tcl_GetThreadData(keyPtr, size) TclRememberDataKey(keyPtr); } result = *(VOID **)keyPtr; -#endif +#endif /* TCL_THREADS */ return result; } @@ -153,8 +153,8 @@ TclThreadDataKeyGet(keyPtr) return (VOID *)TclThreadStorageDataKeyGet(keyPtr); #else return (VOID *)TclpThreadDataKeyGet(keyPtr); -#endif -#else +#endif /* USE_THREAD_STORAGE */ +#else /* TCL_THREADS */ char *result = *(char **)keyPtr; return (VOID *)result; #endif /* TCL_THREADS */ @@ -189,19 +189,17 @@ TclThreadDataKeySet(keyPtr, data) TclThreadStorageDataKeyInit(keyPtr); #else TclpThreadDataKeyInit(keyPtr); -#endif +#endif /* USE_THREAD_STORAGE */ } #ifdef USE_THREAD_STORAGE TclThreadStorageDataKeySet(keyPtr, data); #else TclpThreadDataKeySet(keyPtr, data); -#endif -#else +#endif /* USE_THREAD_STORAGE */ +#else /* TCL_THREADS */ *keyPtr = (Tcl_ThreadDataKey)data; #endif /* TCL_THREADS */ } - - /* *---------------------------------------------------------------------- @@ -434,16 +432,16 @@ TclFinalizeThreadData() keyPtr = (Tcl_ThreadDataKey *) keyRecord.list[i]; #ifdef TCL_THREADS #ifdef USE_THREAD_STORAGE - TclFinalizeThreadStorageData(keyPtr); + TclFinalizeThreadStorageData(keyPtr); #else TclpFinalizeThreadData(keyPtr); -#endif -#else +#endif /* USE_THREAD_STORAGE */ +#else /* TCL_THREADS */ if (*keyPtr != NULL) { ckfree((char *)*keyPtr); *keyPtr = NULL; } -#endif +#endif /* TCL_THREADS */ } TclpMasterUnlock(); } @@ -478,10 +476,10 @@ TclFinalizeSynchronization() for (i=0 ; i