1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
|
Description: Fix test_uctx.c for LP64
Author: NIIBE Yutaka
Last_Update: 2013-07-08
Index: pth/test_uctx.c
===================================================================
--- pth.orig/test_uctx.c
+++ pth/test_uctx.c
@@ -42,22 +42,22 @@ volatile int worker_done[10];
static void worker(void *ctx)
{
- volatile int n = (int)ctx;
+ volatile long n = (long)ctx;
volatile int i = 0;
- fprintf(stderr, "worker #%d: enter\n", n);
+ fprintf(stderr, "worker #%ld: enter\n", n);
for (i = 0; i < 100; i++) {
- fprintf(stderr, "worker #%d: working (step %d)\n", n, i);
+ fprintf(stderr, "worker #%ld: working (step %d)\n", n, i);
pth_uctx_switch(uctx[n], uctx[0]);
}
worker_done[n] = TRUE;
- fprintf(stderr, "worker #%d: exit\n", n);
+ fprintf(stderr, "worker #%ld: exit\n", n);
return;
}
static void test_working(void)
{
- volatile int i;
+ volatile long i;
volatile int todo;
fprintf(stderr, "master: startup\n");
@@ -75,9 +75,9 @@ static void test_working(void)
todo = 0;
for (i = 1; i < 10; i++) {
if (!worker_done[i]) {
- fprintf(stderr, "master: switching to worker #%d\n", i);
+ fprintf(stderr, "master: switching to worker #%ld\n", i);
pth_uctx_switch(uctx[0], uctx[i]);
- fprintf(stderr, "master: came back from worker #%d\n", i);
+ fprintf(stderr, "master: came back from worker #%ld\n", i);
todo = 1;
}
}
|