[PATCH 5/8] Cast pointers to integers using uintptr_t instead of long

Jussi Kivilinna jussi.kivilinna at iki.fi
Fri May 1 19:39:54 CEST 2015


---
 cipher/cipher.c |    4 ++--
 cipher/md.c     |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/cipher/cipher.c b/cipher/cipher.c
index d1550c0..7a29824 100644
--- a/cipher/cipher.c
+++ b/cipher/cipher.c
@@ -481,11 +481,11 @@ _gcry_cipher_open_internal (gcry_cipher_hd_t *handle,
           size_t off = 0;
 
 #ifdef NEED_16BYTE_ALIGNED_CONTEXT
-          if ( ((unsigned long)h & 0x0f) )
+          if ( ((uintptr_t)h & 0x0f) )
             {
               /* The malloced block is not aligned on a 16 byte
                  boundary.  Correct for this.  */
-              off = 16 - ((unsigned long)h & 0x0f);
+              off = 16 - ((uintptr_t)h & 0x0f);
               h = (void*)((char*)h + off);
             }
 #endif /*NEED_16BYTE_ALIGNED_CONTEXT*/
diff --git a/cipher/md.c b/cipher/md.c
index 9fef555..3ab46ef 100644
--- a/cipher/md.c
+++ b/cipher/md.c
@@ -1148,7 +1148,7 @@ md_stop_debug( gcry_md_hd_t md )
 
 #ifdef HAVE_U64_TYPEDEF
   {  /* a kludge to pull in the __muldi3 for Solaris */
-    volatile u32 a = (u32)(ulong)md;
+    volatile u32 a = (u32)(uintptr_t)md;
     volatile u64 b = 42;
     volatile u64 c;
     c = a * b;




More information about the Gcrypt-devel mailing list