]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Change a bunch of pointer <-> int casts to pointer <-> long casts so
authorJulian Seward <jseward@acm.org>
Tue, 17 Oct 2006 11:09:03 +0000 (11:09 +0000)
committerJulian Seward <jseward@acm.org>
Tue, 17 Oct 2006 11:09:03 +0000 (11:09 +0000)
as to stop gcc complaining so much on 64-bit platforms.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6306

helgrind/tests/readshared.c
memcheck/tests/brk.c
none/tests/amd64/faultstatus.c
none/tests/susphello.c
none/tests/threaded-fork.c
tests/toobig-allocs.c

index 0541e7def64ec6fec4a4175bd448d3fee112e202..3904b44bb129fb5fb3b256489f81adc9eefe7500 100644 (file)
@@ -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()
index 0025ed68342e1333cb09d1beca34032c77d4efc7..de193650183d3d5d0ec7e2f439d4409e01c7d837 100644 (file)
@@ -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;
index 6337cacf9fabfda9f9e0598f626015737574938f..c96c67dc7e6d0102d32f78cda9505e432949951a 100644 (file)
@@ -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;
-}
index 58d3c19b517395a7d2662cba4351d17cbe740003..b0d53fdc8ed5501ffa6b2dd04f86797bba17e75a 100644 (file)
@@ -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();
   
index 82c4c1d8f3eae1553f6ca09a55863264ebdb42a4..de5228c5caa15c0f76047e153da5a89a39bc6bc3 100644 (file)
@@ -8,7 +8,7 @@
 
 static void *threadmain( void *dummy )
 {
-       sleep( (int)dummy );
+       sleep( (unsigned long)dummy );
        return NULL;
 }
 
index dbf07b80dea248419368e94cce77ea705cdf7f35..1b1d12f0e23d4c708a0999ef2d8e0c5c52b74344 100644 (file)
@@ -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;