diff options
Diffstat (limited to 'lib/malloca.c')
-rw-r--r-- | lib/malloca.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/malloca.c b/lib/malloca.c index eca55980e..2d4c47972 100644 --- a/lib/malloca.c +++ b/lib/malloca.c @@ -13,8 +13,7 @@ GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program; if not, see <http://www.gnu.org/licenses/>. */ #define _GL_USE_STDLIB_ALLOC 1 #include <config.h> @@ -22,6 +21,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 +86,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 +119,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;) { |