summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2022-03-29 13:40:05 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2022-03-29 13:40:05 (GMT)
commitad983c6d746da6b31a177f9137e0f0fd1b4b46f9 (patch)
tree98fe02e4ba63f0ec93bb7f8911091cfbbe23d5d8 /generic
parente62fbde58cf1c61130e3675d2f262b2939e6599a (diff)
downloadtcl-ad983c6d746da6b31a177f9137e0f0fd1b4b46f9.zip
tcl-ad983c6d746da6b31a177f9137e0f0fd1b4b46f9.tar.gz
tcl-ad983c6d746da6b31a177f9137e0f0fd1b4b46f9.tar.bz2
Don't bother UINT2PTR, since INT2PTR is just as good.
Diffstat (limited to 'generic')
-rw-r--r--generic/tclHash.c2
-rw-r--r--generic/tclInt.h13
2 files changed, 9 insertions, 6 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