mirror of
https://github.com/mirror/wget.git
synced 2025-02-05 09:10:12 +08:00
[svn] Use uintptr_t instead of unsigned long for integer representation of pointers.
This commit is contained in:
parent
94a7163d4e
commit
3e145c6018
@ -1,3 +1,7 @@
|
||||
2005-11-19 Hrvoje Niksic <hniksic@xemacs.org>
|
||||
|
||||
* configure.in: Check for uintptr_t.
|
||||
|
||||
2005-11-02 Mauro Tortonesi <mauro@ferrara.linux.it>
|
||||
|
||||
* Makefile.in: Improved support for unit testing.
|
||||
|
@ -182,13 +182,14 @@ AC_CHECK_SIZEOF(short)
|
||||
AC_CHECK_SIZEOF(int)
|
||||
AC_CHECK_SIZEOF(long)
|
||||
AC_CHECK_SIZEOF(long long)
|
||||
AC_CHECK_SIZEOF(void *)
|
||||
|
||||
dnl
|
||||
dnl Checks for non-universal or system-specific types.
|
||||
dnl
|
||||
AC_TYPE_SIZE_T
|
||||
AC_TYPE_PID_T
|
||||
AC_CHECK_TYPES(uint32_t)
|
||||
AC_CHECK_TYPES([uint32_t, uintptr_t])
|
||||
AC_CHECK_TYPES(sig_atomic_t, [], [], [
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
|
@ -1,3 +1,8 @@
|
||||
2005-11-19 Hrvoje Niksic <hniksic@xemacs.org>
|
||||
|
||||
* hash.c (INVALID_PTR): Use uintptr_t instead of unsigned long.
|
||||
(hash_pointer): Don't assume a pointer fits in `unsigned long'.
|
||||
|
||||
2005-11-02 Mauro Tortonesi <mauro@ferrara.linux.it>
|
||||
|
||||
* Makefile.in: Removed support for unit testing (now it is in
|
||||
|
@ -170,7 +170,7 @@ struct hash_table {
|
||||
-1. This is acceptable because it still allows the use of
|
||||
nonnegative integer keys. */
|
||||
|
||||
#define INVALID_PTR ((void *) ~0UL)
|
||||
#define INVALID_PTR ((void *) ~(uintptr_t) 0)
|
||||
#ifndef UCHAR_MAX
|
||||
# define UCHAR_MAX 0xff
|
||||
#endif
|
||||
@ -709,7 +709,7 @@ make_nocase_string_hash_table (int items)
|
||||
unsigned long
|
||||
hash_pointer (const void *ptr)
|
||||
{
|
||||
unsigned long key = (unsigned long) ptr;
|
||||
uintptr_t key = (uintptr_t) ptr;
|
||||
key += (key << 12);
|
||||
key ^= (key >> 22);
|
||||
key += (key << 4);
|
||||
@ -718,7 +718,7 @@ hash_pointer (const void *ptr)
|
||||
key ^= (key >> 2);
|
||||
key += (key << 7);
|
||||
key ^= (key >> 12);
|
||||
#if SIZEOF_LONG > 4
|
||||
#if SIZEOF_VOID_P > 4
|
||||
key += (key << 44);
|
||||
key ^= (key >> 54);
|
||||
key += (key << 36);
|
||||
@ -728,7 +728,7 @@ hash_pointer (const void *ptr)
|
||||
key += (key << 39);
|
||||
key ^= (key >> 44);
|
||||
#endif
|
||||
return key;
|
||||
return (unsigned long) key;
|
||||
}
|
||||
|
||||
static int
|
||||
|
@ -207,4 +207,9 @@ typedef unsigned short uint32_t;
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* If uintptr_t isn't defined, simply typedef it to unsigned long. */
|
||||
#ifndef HAVE_UINTPTR_T
|
||||
typedef unsigned long uintptr_t;
|
||||
#endif
|
||||
|
||||
#endif /* SYSDEP_H */
|
||||
|
Loading…
Reference in New Issue
Block a user