From: Julian Seward Date: Tue, 17 Oct 2006 11:09:03 +0000 (+0000) Subject: Change a bunch of pointer <-> int casts to pointer <-> long casts so X-Git-Tag: svn/VALGRIND_3_3_0~570 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5b26b045dd6860ddbbeff03bdfabdce0e692cfaa;p=thirdparty%2Fvalgrind.git Change a bunch of pointer <-> int casts to pointer <-> long casts so as to stop gcc complaining so much on 64-bit platforms. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6306 --- diff --git a/helgrind/tests/readshared.c b/helgrind/tests/readshared.c index 0541e7def6..3904b44bb1 100644 --- a/helgrind/tests/readshared.c +++ b/helgrind/tests/readshared.c @@ -7,12 +7,12 @@ static int shared; static void *t1(void *v) { - return (void *)(shared + 44); + return (void *)(long)(shared + 44); } static void *t2(void *v) { - return (void *)(shared + 55); + return (void *)(long)(shared + 55); } int main() diff --git a/memcheck/tests/brk.c b/memcheck/tests/brk.c index 0025ed6834..de19365018 100644 --- a/memcheck/tests/brk.c +++ b/memcheck/tests/brk.c @@ -37,7 +37,7 @@ int main(void) assert( 0 == brk(orig_ds) ); // libc brk() for (i = 0; EOL != vals[i]; i++) { - res = (void*)brk(vals[i]); + res = (void*)(long)brk(vals[i]); } return 0; diff --git a/none/tests/amd64/faultstatus.c b/none/tests/amd64/faultstatus.c index 6337cacf9f..c96c67dc7e 100644 --- a/none/tests/amd64/faultstatus.c +++ b/none/tests/amd64/faultstatus.c @@ -18,8 +18,6 @@ struct test { static const struct test *cur_test; -static int zero(); - static jmp_buf escape; #define BADADDR ((int *)0x1234) @@ -137,7 +135,3 @@ int main() return 0; } -static int zero() -{ - return 0; -} diff --git a/none/tests/susphello.c b/none/tests/susphello.c index 58d3c19b51..b0d53fdc8e 100644 --- a/none/tests/susphello.c +++ b/none/tests/susphello.c @@ -46,7 +46,7 @@ ptiSrSigHandler(int sig, siginfo_t *sip, void *arg) { //ucontext_t *ucontext = (ucontext_t *)arg; - int mypos = (int) pthread_getspecific(pKey); + long mypos = (long) pthread_getspecific(pKey); // int threadPos = (int)pthread_getspecific(srThreadKey); @@ -185,8 +185,8 @@ void takedown_altstack(void* stack) { } void *threadfunc(void *arg) { - int mypos = (int)arg; - int i; + long mypos = (long)arg; + long i; long square = 1; void* altstack = setup_altstack(); @@ -217,10 +217,10 @@ void *threadfunc(void *arg) { int main(int argc, char ** argv) { pthread_t threads[THREAD_COUNT]; pthread_attr_t attr; - int result; - int i; - int iteration; - int finished; + long result; + long i; + long iteration; + long finished; initSignalling(); diff --git a/none/tests/threaded-fork.c b/none/tests/threaded-fork.c index 82c4c1d8f3..de5228c5ca 100644 --- a/none/tests/threaded-fork.c +++ b/none/tests/threaded-fork.c @@ -8,7 +8,7 @@ static void *threadmain( void *dummy ) { - sleep( (int)dummy ); + sleep( (unsigned long)dummy ); return NULL; } diff --git a/tests/toobig-allocs.c b/tests/toobig-allocs.c index dbf07b80de..1b1d12f0e2 100644 --- a/tests/toobig-allocs.c +++ b/tests/toobig-allocs.c @@ -20,7 +20,7 @@ int main(void) fprintf(stderr, "Attempting too-big mmap()...\n"); p = mmap( 0, size, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANON, -1, 0 ); - if (-1 != (int)p) + if (-1 != (long)p) fprintf(stderr, "huge mmap() succeeded??\n"); return 0;