From d867a716b729636b4438738709a496159a39706b Mon Sep 17 00:00:00 2001 From: Quentin Smith Date: Fri, 23 Mar 2012 02:13:55 -0400 Subject: [PATCH] Use uintptr_t instead of size_t, since size_t is not guaranteed to be pointer-sized. --- src/crypto/crypto.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/crypto/crypto.cc b/src/crypto/crypto.cc index c748859..3de9d0c 100644 --- a/src/crypto/crypto.cc +++ b/src/crypto/crypto.cc @@ -59,13 +59,13 @@ static void * aligned_alloc( int len ) if( ! (ptr = malloc(len)) ) { throw std::bad_alloc(); } - if( (size_t)ptr & 0xF ) { + if( (uintptr_t)ptr & 0xF ) { // The pointer wasn't 16-byte aligned, so try again with valloc free(ptr); if( ! (ptr = valloc(len)) ) { throw std::bad_alloc(); } - if( (size_t)ptr & 0xF ) { + if( (uintptr_t)ptr & 0xF ) { free(ptr); throw std::bad_alloc(); }