From f727b49d606587059ac4b42a97c8599c70a7ea4a Mon Sep 17 00:00:00 2001 From: neingeist Date: Sat, 19 Apr 2014 13:18:15 +0200 Subject: [PATCH] uiowa-threads: fix compiler warnings - still broken --- uiowa-threads.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/uiowa-threads.c b/uiowa-threads.c index 2df5790..839204d 100644 --- a/uiowa-threads.c +++ b/uiowa-threads.c @@ -59,7 +59,7 @@ static jmp_buf * ref_probe = &probe_samePC; /* switches between probes */ activation record on the heap * ****/ static int stack_direction; /* +1 if stack grows up, -1 if down */ -long int local_offset; /* lowest location in AR from local vars */ +unsigned long int local_offset; /* lowest location in AR from local vars */ jmp_buf probe_record; /* nonzero entries mean fields that change */ /**** @@ -116,7 +116,7 @@ static void studyit() /* study the jump buffer */ { - int i; + unsigned long int i; long int * p; long int * sameAR; long int * samePC; @@ -169,7 +169,7 @@ static void studyit() void thread_startup_report() /* reports on the results of the study done by above code */ { - int i; + unsigned long int i; long int * jb; printf( "Thread startup study results\n" ); if (stack_direction == 1) { @@ -177,16 +177,16 @@ void thread_startup_report() } else { printf( " Stack grows down\n" ); } - printf( " Local variable offset from AR base = %1d\n", local_offset ); + printf( " Local variable offset from AR base = %1ld\n", local_offset ); printf( " Jump buffer fields subject to modification:\n" ); jb = (long int *)probe_record; for (i = 0; i < sizeof(jmp_buf); i += sizeof(long int) ) { if (*jb != 0) { - printf( " %1d\n", i ); + printf( " %1lu\n", i ); } jb++; } - printf( " Jump buffer size: %1d\n", sizeof(jmp_buf) ); + printf( " Jump buffer size: %1lu\n", sizeof(jmp_buf) ); } /**** @@ -365,7 +365,7 @@ void thread_launch( int size, void (* proc)(int), int param ) long int * probe_rec; long int local_base = (long int)&t; /* address of local t */ long int new_base; - int i; + unsigned long int i; /* the following code copies the contents of the activation record, just in case it might prove