diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-03-29 13:40:05 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-03-29 13:40:05 (GMT) |
commit | ad983c6d746da6b31a177f9137e0f0fd1b4b46f9 (patch) | |
tree | 98fe02e4ba63f0ec93bb7f8911091cfbbe23d5d8 | |
parent | e62fbde58cf1c61130e3675d2f262b2939e6599a (diff) | |
download | tcl-ad983c6d746da6b31a177f9137e0f0fd1b4b46f9.zip tcl-ad983c6d746da6b31a177f9137e0f0fd1b4b46f9.tar.gz tcl-ad983c6d746da6b31a177f9137e0f0fd1b4b46f9.tar.bz2 |
Don't bother UINT2PTR, since INT2PTR is just as good.
-rw-r--r-- | generic/tclHash.c | 2 | ||||
-rw-r--r-- | generic/tclInt.h | 13 | ||||
-rw-r--r-- | win/tclWinThrd.c | 2 |
3 files changed, 10 insertions, 7 deletions
diff --git a/generic/tclHash.c b/generic/tclHash.c index fa30cee..7538821 100644 --- a/generic/tclHash.c +++ b/generic/tclHash.c @@ -354,7 +354,7 @@ CreateHashEntry( } hPtr->tablePtr = tablePtr; - hPtr->hash = UINT2PTR(hash); + hPtr->hash = INT2PTR(hash); hPtr->nextPtr = tablePtr->buckets[index]; tablePtr->buckets[index] = hPtr; tablePtr->numEntries++; diff --git a/generic/tclInt.h b/generic/tclInt.h index 3f2d1ad..af839fc 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -128,21 +128,24 @@ typedef int ptrdiff_t; * to/from pointer from/to integer of different size". */ -#if !defined(INT2PTR) && !defined(PTR2INT) +#if !defined(INT2PTR) # if defined(HAVE_INTPTR_T) || defined(intptr_t) # define INT2PTR(p) ((void *)(intptr_t)(p)) -# define PTR2INT(p) ((intptr_t)(p)) # else # define INT2PTR(p) ((void *)(p)) +# endif +#endif +#if !defined(PTR2INT) +# if defined(HAVE_INTPTR_T) || defined(intptr_t) +# define PTR2INT(p) ((intptr_t)(p)) +# else # define PTR2INT(p) ((long)(p)) # endif #endif -#if !defined(UINT2PTR) && !defined(PTR2UINT) +#if !defined(PTR2UINT) # if defined(HAVE_UINTPTR_T) || defined(uintptr_t) -# define UINT2PTR(p) ((void *)(uintptr_t)(p)) # define PTR2UINT(p) ((uintptr_t)(p)) # else -# define UINT2PTR(p) ((void *)(p)) # define PTR2UINT(p) ((unsigned long)(p)) # endif #endif diff --git a/win/tclWinThrd.c b/win/tclWinThrd.c index 86db837..b69fbfc 100644 --- a/win/tclWinThrd.c +++ b/win/tclWinThrd.c @@ -326,7 +326,7 @@ TclpThreadExit( Tcl_ThreadId Tcl_GetCurrentThread(void) { - return (Tcl_ThreadId)(size_t)GetCurrentThreadId(); + return (Tcl_ThreadId)INT2PTR(GetCurrentThreadId()); } /* |