src: Fix pointer casts to int on LP64 platforms.
authorSteve Byan <stevebyan@me.com>
Tue, 2 Mar 2010 02:02:40 +0000 (21:02 -0500)
committerAndreas Schneider <asn@cryptomilk.org>
Tue, 31 May 2011 18:48:15 +0000 (20:48 +0200)
This fixes cmockery defect 23.

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
src/cmockery.c

index 9ea07cb..8d6ef0f 100755 (executable)
@@ -1394,7 +1394,7 @@ void _test_free(void* const ptr, const char* file, const int line) {
     unsigned int i;
     char *block = (char*)ptr;
     MallocBlockInfo *block_info;
-    _assert_true((int)ptr, "ptr", file, line);
+    _assert_true(cast_to_largest_integral_type(ptr), "ptr", file, line);
     block_info = (MallocBlockInfo*)(block - (MALLOC_GUARD_SIZE +
                                                sizeof(*block_info)));
     // Check the guard blocks.