diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2012-01-24 13:21:56 +0100 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2012-01-25 23:47:25 +0100 |
commit | 55b0a0b1dd267ef48971e4bb84768244ff58b340 (patch) | |
tree | a72babd2982aafcfccca90e5684589bac2de5c77 | |
parent | c5230ae4c155d0e6e9e043a57d77b05e44497b84 (diff) | |
download | gnulib-55b0a0b1dd267ef48971e4bb84768244ff58b340.tar.gz |
malloca: Avoid warnings on x86_64 mingw64.
* lib/malloca.c: Include <stdint.h>.
(mmalloca, freea): Use uintptr_t to convert pointers to integers.
* modules/malloca (Depends-on): Add stdint.
* modules/relocatable-prog-wrapper (Depends-on): Likewise.
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | lib/malloca.c | 6 | ||||
-rw-r--r-- | modules/malloca | 1 | ||||
-rw-r--r-- | modules/relocatable-prog-wrapper | 1 |
4 files changed, 15 insertions, 2 deletions
@@ -1,3 +1,12 @@ +2012-01-24 Marc-André Lureau <marcandre.lureau@redhat.com> (tiny change) + Bruno Haible <bruno@clisp.org> + + malloca: Avoid warnings on x86_64 mingw64. + * lib/malloca.c: Include <stdint.h>. + (mmalloca, freea): Use uintptr_t to convert pointers to integers. + * modules/malloca (Depends-on): Add stdint. + * modules/relocatable-prog-wrapper (Depends-on): Likewise. + 2012-01-25 Paul Eggert <eggert@cs.ucla.edu> obstack: remove __STDC__ conditionals diff --git a/lib/malloca.c b/lib/malloca.c index c81ffbc882..4557a903df 100644 --- a/lib/malloca.c +++ b/lib/malloca.c @@ -22,6 +22,8 @@ /* Specification. */ #include "malloca.h" +#include <stdint.h> + #include "verify.h" /* The speed critical point in this file is freea() applied to an alloca() @@ -85,7 +87,7 @@ mmalloca (size_t n) ((int *) p)[-1] = MAGIC_NUMBER; /* Enter p into the hash table. */ - slot = (unsigned long) p % HASH_TABLE_SIZE; + slot = (uintptr_t) p % HASH_TABLE_SIZE; ((struct header *) (p - HEADER_SIZE))->next = mmalloca_results[slot]; mmalloca_results[slot] = p; @@ -118,7 +120,7 @@ freea (void *p) { /* Looks like a mmalloca() result. To see whether it really is one, perform a lookup in the hash table. */ - size_t slot = (unsigned long) p % HASH_TABLE_SIZE; + size_t slot = (uintptr_t) p % HASH_TABLE_SIZE; void **chain = &mmalloca_results[slot]; for (; *chain != NULL;) { diff --git a/modules/malloca b/modules/malloca index 57cbe32784..bb9e9b46c8 100644 --- a/modules/malloca +++ b/modules/malloca @@ -11,6 +11,7 @@ m4/longlong.m4 Depends-on: alloca-opt +stdint verify configure.ac: diff --git a/modules/relocatable-prog-wrapper b/modules/relocatable-prog-wrapper index 8ff11d4d02..e5dccd5343 100644 --- a/modules/relocatable-prog-wrapper +++ b/modules/relocatable-prog-wrapper @@ -39,6 +39,7 @@ errno pathmax ssize_t stdbool +stdint stdlib unistd environ |