diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2018-09-05 13:45:15 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2018-09-05 13:45:15 (GMT) |
commit | 1f6ac7f87e3a127645d7839916f0bc2a6143b9b9 (patch) | |
tree | ebd9cd2ef1306351bac09ce6e0c22872ad04d953 | |
parent | 2562ea174bddf62331bd7d71ebd4b49f53ad8345 (diff) | |
parent | 5c9968a001208bb4fc6d06ad040c28bd84b7831f (diff) | |
download | tcl-1f6ac7f87e3a127645d7839916f0bc2a6143b9b9.zip tcl-1f6ac7f87e3a127645d7839916f0bc2a6143b9b9.tar.gz tcl-1f6ac7f87e3a127645d7839916f0bc2a6143b9b9.tar.bz2 |
Merge 8.7.
Change some internal function signatures, accounting for the 64-bit era.
-rw-r--r-- | generic/tclBasic.c | 8 | ||||
-rw-r--r-- | generic/tclInt.decls | 8 | ||||
-rw-r--r-- | generic/tclIntDecls.h | 8 | ||||
-rw-r--r-- | generic/tclIntPlatDecls.h | 10 | ||||
-rw-r--r-- | generic/tclObj.c | 2 | ||||
-rw-r--r-- | generic/tclProcess.c | 6 | ||||
-rw-r--r-- | generic/tclStubInit.c | 6 | ||||
-rw-r--r-- | unix/tclUnixTime.c | 16 | ||||
-rw-r--r-- | win/tclWinNotify.c | 4 | ||||
-rw-r--r-- | win/tclWinPipe.c | 22 | ||||
-rw-r--r-- | win/tclWinTime.c | 6 |
11 files changed, 46 insertions, 50 deletions
diff --git a/generic/tclBasic.c b/generic/tclBasic.c index 222a80c..7d0267e 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -6973,13 +6973,11 @@ ExprWideFunc( Tcl_Obj *const *objv) /* Actual parameter vector. */ { Tcl_WideInt wResult; - Tcl_Obj *objPtr; if (ExprEntierFunc(NULL, interp, objc, objv) != TCL_OK) { return TCL_ERROR; } - objPtr = Tcl_GetObjResult(interp); - TclGetWideBitsFromObj(NULL, objPtr, &wResult); + TclGetWideBitsFromObj(NULL, Tcl_GetObjResult(interp), &wResult); Tcl_SetObjResult(interp, Tcl_NewWideIntObj(wResult)); return TCL_OK; } @@ -7082,7 +7080,7 @@ ExprRandFunc( * Make sure 1 <= randSeed <= (2^31) - 2. See below. */ - iPtr->randSeed &= (unsigned long) 0x7fffffff; + iPtr->randSeed &= 0x7fffffff; if ((iPtr->randSeed == 0) || (iPtr->randSeed == 0x7fffffff)) { iPtr->randSeed ^= 123459876; } @@ -7247,7 +7245,7 @@ ExprSrandFunc( */ iPtr->flags |= RAND_SEED_INITIALIZED; - iPtr->randSeed = (unsigned long) (w & 0x7fffffff); + iPtr->randSeed = (long) w & 0x7fffffff; if ((iPtr->randSeed == 0) || (iPtr->randSeed == 0x7fffffff)) { iPtr->randSeed ^= 123459876; } diff --git a/generic/tclInt.decls b/generic/tclInt.decls index 9865609..7dac603 100644 --- a/generic/tclInt.decls +++ b/generic/tclInt.decls @@ -309,10 +309,10 @@ declare 74 { void TclpFree(char *ptr) } declare 75 { - unsigned long TclpGetClicks(void) + Tcl_WideUInt TclpGetClicks(void) } declare 76 { - unsigned long TclpGetSeconds(void) + Tcl_WideUInt TclpGetSeconds(void) } # Removed in 9.0: @@ -1102,7 +1102,7 @@ declare 5 win { # const char *optval, int optlen) #} declare 8 win { - int TclpGetPid(Tcl_Pid pid) + size_t TclpGetPid(Tcl_Pid pid) } # Removed in 9.0: #declare 9 win { @@ -1160,7 +1160,7 @@ declare 19 win { TclFile TclpOpenFile(const char *fname, int mode) } declare 20 win { - void TclWinAddProcess(HANDLE hProcess, DWORD id) + void TclWinAddProcess(HANDLE hProcess, size_t id) } # Removed in 9.0: #declare 21 win { diff --git a/generic/tclIntDecls.h b/generic/tclIntDecls.h index eae2e9b..1d9d788 100644 --- a/generic/tclIntDecls.h +++ b/generic/tclIntDecls.h @@ -195,9 +195,9 @@ EXTERN char * TclpAlloc(unsigned int size); /* 74 */ EXTERN void TclpFree(char *ptr); /* 75 */ -EXTERN unsigned long TclpGetClicks(void); +EXTERN Tcl_WideUInt TclpGetClicks(void); /* 76 */ -EXTERN unsigned long TclpGetSeconds(void); +EXTERN Tcl_WideUInt TclpGetSeconds(void); /* Slot 77 is reserved */ /* Slot 78 is reserved */ /* Slot 79 is reserved */ @@ -659,8 +659,8 @@ typedef struct TclIntStubs { void (*reserved72)(void); void (*reserved73)(void); void (*tclpFree) (char *ptr); /* 74 */ - unsigned long (*tclpGetClicks) (void); /* 75 */ - unsigned long (*tclpGetSeconds) (void); /* 76 */ + Tcl_WideUInt (*tclpGetClicks) (void); /* 75 */ + Tcl_WideUInt (*tclpGetSeconds) (void); /* 76 */ void (*reserved77)(void); void (*reserved78)(void); void (*reserved79)(void); diff --git a/generic/tclIntPlatDecls.h b/generic/tclIntPlatDecls.h index 5ec0544..37a9176 100644 --- a/generic/tclIntPlatDecls.h +++ b/generic/tclIntPlatDecls.h @@ -108,7 +108,7 @@ EXTERN int TclUnixWaitForFile(int fd, int mask, int timeout); /* Slot 6 is reserved */ /* Slot 7 is reserved */ /* 8 */ -EXTERN int TclpGetPid(Tcl_Pid pid); +EXTERN size_t TclpGetPid(Tcl_Pid pid); /* Slot 9 is reserved */ /* Slot 10 is reserved */ /* 11 */ @@ -138,7 +138,7 @@ EXTERN TclFile TclpMakeFile(Tcl_Channel channel, int direction); /* 19 */ EXTERN TclFile TclpOpenFile(const char *fname, int mode); /* 20 */ -EXTERN void TclWinAddProcess(HANDLE hProcess, DWORD id); +EXTERN void TclWinAddProcess(HANDLE hProcess, size_t id); /* Slot 21 is reserved */ /* 22 */ EXTERN TclFile TclpCreateTempFile(const char *contents); @@ -274,7 +274,7 @@ typedef struct TclIntPlatStubs { int (*tclUnixWaitForFile) (int fd, int mask, int timeout); /* 5 */ void (*reserved6)(void); void (*reserved7)(void); - int (*tclpGetPid) (Tcl_Pid pid); /* 8 */ + size_t (*tclpGetPid) (Tcl_Pid pid); /* 8 */ void (*reserved9)(void); void (*reserved10)(void); void (*tclGetAndDetachPids) (Tcl_Interp *interp, Tcl_Channel chan); /* 11 */ @@ -286,7 +286,7 @@ typedef struct TclIntPlatStubs { int (*tclUnixCopyFile) (const char *src, const char *dst, const Tcl_StatBuf *statBufPtr, int dontCopyAtts); /* 17 */ TclFile (*tclpMakeFile) (Tcl_Channel channel, int direction); /* 18 */ TclFile (*tclpOpenFile) (const char *fname, int mode); /* 19 */ - void (*tclWinAddProcess) (HANDLE hProcess, DWORD id); /* 20 */ + void (*tclWinAddProcess) (HANDLE hProcess, size_t id); /* 20 */ void (*reserved21)(void); TclFile (*tclpCreateTempFile) (const char *contents); /* 22 */ void (*reserved23)(void); @@ -503,7 +503,7 @@ extern const TclIntPlatStubs *tclIntPlatStubsPtr; #if !defined(_WIN32) # undef TclpGetPid -# define TclpGetPid(pid) ((unsigned long) (pid)) +# define TclpGetPid(pid) ((size_t) (pid)) #endif #endif /* _TCLINTPLATDECLS */ diff --git a/generic/tclObj.c b/generic/tclObj.c index 0216682..7b61346 100644 --- a/generic/tclObj.c +++ b/generic/tclObj.c @@ -2674,7 +2674,7 @@ Tcl_GetWideIntFromObj( * Attempt to return a wide integer from the Tcl object "objPtr". If the * object is not already a int, double or bignum, an attempt will be made * to convert it to one of these. Out-of-range values don't result in an - * error, but only the least significant 64 bits will be returned. + * error, but only the least significant 64 bits will be returned. * * Results: * The return value is a standard Tcl object result. If an error occurs diff --git a/generic/tclProcess.c b/generic/tclProcess.c index a781386..73d2268 100644 --- a/generic/tclProcess.c +++ b/generic/tclProcess.c @@ -47,7 +47,7 @@ static void InitProcessInfo(ProcessInfo *info, Tcl_Pid pid, int resolvedPid); static void FreeProcessInfo(ProcessInfo *info); static int RefreshProcessInfo(ProcessInfo *info, int options); -static TclProcessWaitStatus WaitProcessStatus(Tcl_Pid pid, int resolvedPid, +static TclProcessWaitStatus WaitProcessStatus(Tcl_Pid pid, size_t resolvedPid, int options, int *codePtr, Tcl_Obj **msgPtr, Tcl_Obj **errorObjPtr); static Tcl_Obj * BuildProcessStatusObj(ProcessInfo *info); @@ -193,7 +193,7 @@ RefreshProcessInfo( TclProcessWaitStatus WaitProcessStatus( Tcl_Pid pid, /* Process id. */ - int resolvedPid, /* Resolved process id. */ + size_t resolvedPid, /* Resolved process id. */ int options, /* Options passed to Tcl_WaitPid. */ int *codePtr, /* If non-NULL, will receive either: * - 0 for normal exit. @@ -799,7 +799,7 @@ void TclProcessCreated( Tcl_Pid pid) /* Process id. */ { - int resolvedPid; + size_t resolvedPid; Tcl_HashEntry *entry, *entry2; int isNew; ProcessInfo *info; diff --git a/generic/tclStubInit.c b/generic/tclStubInit.c index d56f272..767ebc0 100644 --- a/generic/tclStubInit.c +++ b/generic/tclStubInit.c @@ -58,7 +58,7 @@ doNothing(void) { /* dummy implementation, no need to do anything */ } -# define TclWinAddProcess (void (*) (void *, unsigned int)) doNothing +# define TclWinAddProcess (void (*) (void *, size_t)) doNothing # define TclWinFlushDirtyChannels doNothing static int TclpIsAtty(int fd) @@ -88,10 +88,10 @@ TclWinNoBackslash(char *path) return path; } -int +size_t TclpGetPid(Tcl_Pid pid) { - return (int) (size_t) pid; + return (size_t) pid; } char * diff --git a/unix/tclUnixTime.c b/unix/tclUnixTime.c index 2d6560b..9ae5016 100644 --- a/unix/tclUnixTime.c +++ b/unix/tclUnixTime.c @@ -52,7 +52,7 @@ ClientData tclTimeClientData = NULL; *---------------------------------------------------------------------- */ -unsigned long +Tcl_WideUInt TclpGetSeconds(void) { return time(NULL); @@ -77,30 +77,30 @@ TclpGetSeconds(void) *---------------------------------------------------------------------- */ -unsigned long +Tcl_WideUInt TclpGetClicks(void) { - unsigned long now; + Tcl_WideUInt now; #ifdef NO_GETTOD if (tclGetTimeProcPtr != NativeGetTime) { Tcl_Time time; tclGetTimeProcPtr(&time, tclTimeClientData); - now = time.sec*1000000 + time.usec; + now = (Tcl_WideUInt)time.sec*1000000 + time.usec; } else { /* * A semi-NativeGetTime, specialized to clicks. */ struct tms dummy; - now = (unsigned long) times(&dummy); + now = (Tcl_WideUInt) times(&dummy); } #else Tcl_Time time; tclGetTimeProcPtr(&time, tclTimeClientData); - now = time.sec*1000000 + time.usec; + now = (Tcl_WideUInt)time.sec*1000000 + time.usec; #endif return now; @@ -113,9 +113,9 @@ TclpGetClicks(void) * TclpGetWideClicks -- * * This procedure returns a WideInt value that represents the highest - * resolution clock available on the system. There are no garantees on + * resolution clock available on the system. There are no guarantees on * what the resolution will be. In Tcl we will call this value a "click". - * The start time is also system dependant. + * The start time is also system dependent. * * Results: * Number of WideInt clicks from some start time. diff --git a/win/tclWinNotify.c b/win/tclWinNotify.c index 28c8445..b34fc4f 100644 --- a/win/tclWinNotify.c +++ b/win/tclWinNotify.c @@ -36,7 +36,6 @@ typedef struct { int pending; /* Alert message pending, this field is locked * by the notifierMutex. */ HWND hwnd; /* Messaging window. */ - int timeout; /* Current timeout value. */ int timerActive; /* 1 if interval timer is running. */ } ThreadSpecificData; @@ -309,11 +308,10 @@ Tcl_SetTimer( timeout = 1; } } - tsdPtr->timeout = timeout; if (timeout != 0) { tsdPtr->timerActive = 1; SetTimer(tsdPtr->hwnd, INTERVAL_TIMER, - (unsigned long) tsdPtr->timeout, NULL); + timeout, NULL); } else { tsdPtr->timerActive = 0; KillTimer(tsdPtr->hwnd, INTERVAL_TIMER); diff --git a/win/tclWinPipe.c b/win/tclWinPipe.c index cf0b80f..84c8724 100644 --- a/win/tclWinPipe.c +++ b/win/tclWinPipe.c @@ -61,7 +61,7 @@ typedef struct { typedef struct ProcInfo { HANDLE hProcess; - DWORD dwProcessId; + size_t dwProcessId; struct ProcInfo *nextPtr; } ProcInfo; @@ -859,7 +859,7 @@ TclpCloseFile( *-------------------------------------------------------------------------- */ -int +size_t TclpGetPid( Tcl_Pid pid) /* The HANDLE of the child process. */ { @@ -869,13 +869,13 @@ TclpGetPid( Tcl_MutexLock(&pipeMutex); for (infoPtr = procList; infoPtr != NULL; infoPtr = infoPtr->nextPtr) { - if (infoPtr->dwProcessId == (DWORD) pid) { + if (infoPtr->dwProcessId == (size_t) pid) { Tcl_MutexUnlock(&pipeMutex); return infoPtr->dwProcessId; } } Tcl_MutexUnlock(&pipeMutex); - return (unsigned long) -1; + return (size_t)-1; } /* @@ -1163,7 +1163,7 @@ TclpCreateProcess( WaitForInputIdle(procInfo.hProcess, 5000); CloseHandle(procInfo.hThread); - *pidPtr = (Tcl_Pid) procInfo.dwProcessId; + *pidPtr = (Tcl_Pid) (size_t) procInfo.dwProcessId; if (*pidPtr != 0) { TclWinAddProcess(procInfo.hProcess, procInfo.dwProcessId); } @@ -1478,10 +1478,10 @@ QuoteCmdLinePart( QuoteCmdLineBackslash(dsPtr, start, *bspos, NULL); start = *bspos; } - /* - * escape all special chars enclosed in quotes like `"..."`, note that here we + /* + * escape all special chars enclosed in quotes like `"..."`, note that here we * don't must escape `\` (with `\`), because it's outside of the main quotes, - * so `\` remains `\`, but important - not at end of part, because results as + * so `\` remains `\`, but important - not at end of part, because results as * before the quote, so `%\%\` should be escaped as `"%\%"\\`). */ TclDStringAppendLiteral(dsPtr, "\""); /* opening escape quote-char */ @@ -1636,7 +1636,7 @@ BuildCommandLine( special++; } /* rest of argument (and escape backslashes before closing main quote) */ - QuoteCmdLineBackslash(&ds, start, special, + QuoteCmdLineBackslash(&ds, start, special, (quote & CL_QUOTE) ? bspos : NULL); } if (quote & CL_QUOTE) { @@ -2476,7 +2476,7 @@ Tcl_WaitPid( prevPtrPtr = &procList; for (infoPtr = procList; infoPtr != NULL; prevPtrPtr = &infoPtr->nextPtr, infoPtr = infoPtr->nextPtr) { - if (infoPtr->dwProcessId == (DWORD) pid) { + if (infoPtr->dwProcessId == (size_t) pid) { *prevPtrPtr = infoPtr->nextPtr; break; } @@ -2620,7 +2620,7 @@ Tcl_WaitPid( void TclWinAddProcess( void *hProcess, /* Handle to process */ - unsigned long id) /* Global process identifier */ + size_t id) /* Global process identifier */ { ProcInfo *procPtr = ckalloc(sizeof(ProcInfo)); diff --git a/win/tclWinTime.c b/win/tclWinTime.c index 598dade..a6557d9 100644 --- a/win/tclWinTime.c +++ b/win/tclWinTime.c @@ -127,7 +127,7 @@ ClientData tclTimeClientData = NULL; *---------------------------------------------------------------------- */ -unsigned long +Tcl_WideUInt TclpGetSeconds(void) { Tcl_Time t; @@ -155,7 +155,7 @@ TclpGetSeconds(void) *---------------------------------------------------------------------- */ -unsigned long +Tcl_WideUInt TclpGetClicks(void) { /* @@ -168,7 +168,7 @@ TclpGetClicks(void) tclGetTimeProcPtr(&now, tclTimeClientData); /* Tcl_GetTime inlined */ - retval = (now.sec * 1000000) + now.usec; + retval = ((Tcl_WideUInt) now.sec * 1000000) + now.usec; return retval; } |