diff options
author | Pedro Alves <palves@redhat.com> | 2010-03-23 23:50:22 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2010-03-23 23:50:22 +0000 |
commit | 4dfd5423376f10681378bb4400d26936ea07175d (patch) | |
tree | 283d64b64dd65a8cda6ba0184bab39316d06b84c /gdb/testsuite/gdb.threads | |
parent | 5d75f6759908cd92e5e5c622d3d040c4bc35fc46 (diff) | |
download | gdb-4dfd5423376f10681378bb4400d26936ea07175d.zip gdb-4dfd5423376f10681378bb4400d26936ea07175d.tar.gz gdb-4dfd5423376f10681378bb4400d26936ea07175d.tar.bz2 |
* gdb.threads/pthreads.c (thread1, thread2, main): Fix printf
format strings and add casts to avoid compiler warnings.
Diffstat (limited to 'gdb/testsuite/gdb.threads')
-rw-r--r-- | gdb/testsuite/gdb.threads/pthreads.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/gdb/testsuite/gdb.threads/pthreads.c b/gdb/testsuite/gdb.threads/pthreads.c index 71e704f..ba87e12 100644 --- a/gdb/testsuite/gdb.threads/pthreads.c +++ b/gdb/testsuite/gdb.threads/pthreads.c @@ -73,10 +73,10 @@ thread1 (void *arg) int i; int z = 0; - if (verbose) printf ("thread1 (%0x) ; pid = %d\n", arg, getpid ()); + if (verbose) printf ("thread1 (%0lx) ; pid = %d\n", (long) arg, getpid ()); for (i=1; i <= 10000000; i++) { - if (verbose) printf("thread1 %d\n", pthread_self ()); + if (verbose) printf("thread1 %ld\n", (long) pthread_self ()); z += i; common_routine (1); sleep(1); @@ -90,10 +90,10 @@ thread2 (void * arg) int i; int k = 0; - if (verbose) printf ("thread2 (%0x) ; pid = %d\n", arg, getpid ()); + if (verbose) printf ("thread2 (%0lx) ; pid = %d\n", (long) arg, getpid ()); for (i=1; i <= 10000000; i++) { - if (verbose) printf("thread2 %d\n", pthread_self ()); + if (verbose) printf("thread2 %ld\n", (long) pthread_self ()); k += i; common_routine (2); sleep(1); @@ -146,7 +146,7 @@ main(argc, argv) perror ("pthread_create 1"); exit (1); } - if (verbose) printf ("Made thread %d\n", tid1); + if (verbose) printf ("Made thread %ld\n", (long) tid1); sleep (1); if (pthread_create (&tid2, PTHREAD_CREATE_NULL_ARG2, thread2, (void *) 0xdeadbeef)) @@ -154,13 +154,13 @@ main(argc, argv) perror ("pthread_create 2"); exit (1); } - if (verbose) printf("Made thread %d\n", tid2); + if (verbose) printf("Made thread %ld\n", (long) tid2); sleep (1); for (j = 1; j <= 10000000; j++) { - if (verbose) printf("top %d\n", pthread_self ()); + if (verbose) printf("top %ld\n", (long) pthread_self ()); common_routine (0); sleep(1); t += j; |