tests: Fix compilation of the ABI test on 64 bit architectures
authorSebastian Dröge <sebastian.droege@collabora.co.uk>
Tue, 15 Jun 2010 09:40:38 +0000 (11:40 +0200)
committerDavid Schleef <ds@schleef.org>
Tue, 15 Jun 2010 18:36:14 +0000 (11:36 -0700)
Casting a pointer to a plain int will cause a compiler error, use long instead.

testsuite/abi.c

index f03a7b3..553c8fa 100644 (file)
 
 int main (int argc, char *argv[])
 {
-  int offset;
+  long offset;
   int expected_offset;
   int error = 0;
 
-  offset = ((int) ((unsigned char *) &((OrcProgram*) 0)->code_exec));
+  offset = ((long) ((unsigned char *) &((OrcProgram*) 0)->code_exec));
 
   if (sizeof(void *) == 4) {
     expected_offset = 8360;
@@ -23,7 +23,7 @@ int main (int argc, char *argv[])
   }
 
   if (offset != expected_offset) {
-    printf("ABI bug: OrcProgram->code_exec should be at offset %d instead of %d\n",
+    printf("ABI bug: OrcProgram->code_exec should be at offset %ld instead of %d\n",
         offset, expected_offset);
     error = 1;
   }