diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2002-07-19 12:31:09 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2002-07-19 12:31:09 (GMT) |
commit | d49b43a9ceee81dcee52620d4d2469df9624a457 (patch) | |
tree | 4bf2d4935b5e97743834dba726fe88543f867664 /unix | |
parent | 336c85fe81ce3721d86da085058d09a6322e2a30 (diff) | |
download | tcl-d49b43a9ceee81dcee52620d4d2469df9624a457.zip tcl-d49b43a9ceee81dcee52620d4d2469df9624a457.tar.gz tcl-d49b43a9ceee81dcee52620d4d2469df9624a457.tar.bz2 |
Global symbols are now all either prefixed with 'tcl' (or 'Tcl' or ...) or have file-scope.
Diffstat (limited to 'unix')
-rw-r--r-- | unix/tclUnixFile.c | 6 | ||||
-rw-r--r-- | unix/tclUnixTime.c | 38 |
2 files changed, 19 insertions, 25 deletions
diff --git a/unix/tclUnixFile.c b/unix/tclUnixFile.c index 955f12e..4c4dfa0 100644 --- a/unix/tclUnixFile.c +++ b/unix/tclUnixFile.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: tclUnixFile.c,v 1.25 2002/06/28 09:56:54 dkf Exp $ + * RCS: @(#) $Id: tclUnixFile.c,v 1.26 2002/07/19 12:31:10 dkf Exp $ */ #include "tclInt.h" @@ -729,8 +729,6 @@ TclpObjLink(pathPtr, toPtr, linkAction) Tcl_Obj *toPtr; int linkAction; { - extern Tcl_Filesystem nativeFilesystem; - if (toPtr != NULL) { CONST char *src = Tcl_FSGetNativePath(pathPtr); CONST char *target = Tcl_FSGetNativePath(toPtr); @@ -784,7 +782,7 @@ TclpObjLink(pathPtr, toPtr, linkAction) strncpy(native, link, (unsigned)length); native[length] = '\0'; - linkPtr = Tcl_FSNewNativePath(&nativeFilesystem, native); + linkPtr = Tcl_FSNewNativePath(&tclNativeFilesystem, native); if (linkPtr != NULL) { Tcl_IncrRefCount(linkPtr); } diff --git a/unix/tclUnixTime.c b/unix/tclUnixTime.c index 85ba721..fc72f35 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.14 2002/06/26 13:42:23 rmax Exp $ + * RCS: @(#) $Id: tclUnixTime.c,v 1.15 2002/07/19 12:31:10 dkf Exp $ */ #include "tclInt.h" @@ -24,7 +24,7 @@ * The 'tmKey' variable is the key to this buffer. */ -Tcl_ThreadDataKey tmKey; +static Tcl_ThreadDataKey tmKey; /* * If we fall back on the thread-unsafe versions of gmtime and localtime, @@ -32,7 +32,7 @@ Tcl_ThreadDataKey tmKey; */ #if !defined(HAVE_GMTIME_R) || !defined(HAVE_LOCALTIME_R) -TCL_DECLARE_MUTEX( tmMutex ) +TCL_DECLARE_MUTEX(tmMutex) #endif /* @@ -355,25 +355,24 @@ TclpStrftime(s, maxsize, format, t, useGMT) */ static struct tm * -ThreadSafeGMTime( timePtr ) +ThreadSafeGMTime(timePtr) CONST time_t *timePtr; /* Pointer to the number of seconds * since the local system's epoch */ { - /* * Get a thread-local buffer to hold the returned time. */ - struct tm * tmPtr = (struct tm*) Tcl_GetThreadData( &tmKey, - sizeof( struct tm ) ); + struct tm *tmPtr = (struct tm *) + Tcl_GetThreadData(&tmKey, sizeof(struct tm)); #ifdef HAVE_GMTIME_R - gmtime_r( timePtr, tmPtr ); + gmtime_r(timePtr, tmPtr); #else - Tcl_MutexLock( & tmMutex ); - memcpy( (VOID *) tmPtr, (VOID *) gmtime( timePtr ), sizeof ( struct tm ) ); - Tcl_MutexUnlock( &tmMutex ); + Tcl_MutexLock(&tmMutex); + memcpy((VOID *) tmPtr, (VOID *) gmtime(timePtr), sizeof(struct tm)); + Tcl_MutexUnlock(&tmMutex); #endif return tmPtr; } @@ -396,27 +395,24 @@ ThreadSafeGMTime( timePtr ) */ static struct tm * -ThreadSafeLocalTime( timePtr ) +ThreadSafeLocalTime(timePtr) CONST time_t *timePtr; /* Pointer to the number of seconds * since the local system's epoch */ { - /* * Get a thread-local buffer to hold the returned time. */ - struct tm * tmPtr = (struct tm*) Tcl_GetThreadData( &tmKey, - sizeof( struct tm ) ); + struct tm *tmPtr = (struct tm *) + Tcl_GetThreadData(&tmKey, sizeof(struct tm)); #ifdef HAVE_LOCALTIME_R - localtime_r( timePtr, tmPtr ); + localtime_r(timePtr, tmPtr); #else - Tcl_MutexLock( & tmMutex ); - memcpy( (VOID *) (tmPtr), - (VOID *) ( localtime( timePtr ) ), - sizeof (struct tm) ); - Tcl_MutexUnlock( &tmMutex ); + Tcl_MutexLock(&tmMutex); + memcpy((VOID *) tmPtr, (VOID *) localtime(timePtr), sizeof(struct tm)); + Tcl_MutexUnlock(&tmMutex); #endif return tmPtr; } |