From b068721c68e769f132303e171e71b01fd6021e69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Santos=20Costa=20II?= Date: Mon, 22 Mar 2010 15:01:54 +0000 Subject: [PATCH] fix type warnings. --- C/errors.c | 8 ++++---- C/heapgc.c | 60 +++++++++++++++++++++++++++--------------------------- H/amiops.h | 4 ++++ H/rheap.h | 8 -------- 4 files changed, 38 insertions(+), 42 deletions(-) diff --git a/C/errors.c b/C/errors.c index 3d6c857bb..c4ac88921 100644 --- a/C/errors.c +++ b/C/errors.c @@ -290,10 +290,10 @@ dump_stack(void) fprintf (stderr,"%%\n%% PC: %s\n",(char *)H); detect_bug_location(CP, FIND_PRED_FROM_ANYWHERE, (char *)H, 256); fprintf (stderr,"%% Continuation: %s\n",(char *)H); - fprintf (stderr,"%% %ldKB of Global Stack (%p--%p)\n",(long int)(sizeof(CELL)*(H-H0))/1024,H0,H); - fprintf (stderr,"%% %ldKB of Local Stack (%p--%p)\n",(long int)(sizeof(CELL)*(LCL0-ASP))/1024,ASP,LCL0); - fprintf (stderr,"%% %ldKB of Trail (%p--%p)\n",(long int)((ADDR)TR-Yap_TrailBase)/1024,Yap_TrailBase,TR); - fprintf (stderr,"%% Performed %d garbage collections\n", GcCalls); + fprintf (stderr,"%% %luKB of Global Stack (%p--%p)\n",(unsigned long int)(sizeof(CELL)*(H-H0))/1024,H0,H); + fprintf (stderr,"%% %luKB of Local Stack (%p--%p)\n",(unsigned long int)(sizeof(CELL)*(LCL0-ASP))/1024,ASP,LCL0); + fprintf (stderr,"%% %luKB of Trail (%p--%p)\n",(unsigned long int)((ADDR)TR-Yap_TrailBase)/1024,Yap_TrailBase,TR); + fprintf (stderr,"%% Performed %ld garbage collections\n", (unsigned long int)GcCalls); #if LOW_LEVEL_TRACER { extern long long vsc_count; diff --git a/C/heapgc.c b/C/heapgc.c index 964aef088..3e884f4ce 100644 --- a/C/heapgc.c +++ b/C/heapgc.c @@ -3302,15 +3302,15 @@ compact_heap(void) #ifdef DEBUG if (dest != start_from-1) - fprintf(Yap_stderr,"%% Bad Dest (%d): %p should be %p\n", - GcCalls, - dest, - start_from); + fprintf(Yap_stderr,"%% Bad Dest (%lu): %p should be %p\n", + (unsigned long int)GcCalls, + dest, + start_from); if (total_marked != found_marked) - fprintf(Yap_stderr,"%% Upward (%d): %ld total against %ld found\n", - GcCalls, - (unsigned long int)total_marked, - (unsigned long int)found_marked); + fprintf(Yap_stderr,"%% Upward (%lu): %lu total against %lu found\n", + (unsigned long int)GcCalls, + (unsigned long int)total_marked, + (unsigned long int)found_marked); found_marked = start_from-H0; #endif @@ -3366,10 +3366,10 @@ compact_heap(void) } #ifdef DEBUG if (total_marked != found_marked) - fprintf(Yap_stderr,"%% Downward (%d): %ld total against %ld found\n", - GcCalls, - (unsigned long int)total_marked, - (unsigned long int)found_marked); + fprintf(Yap_stderr,"%% Downward (%lu): %lu total against %lu found\n", + (unsigned long int)GcCalls, + (unsigned long int)total_marked, + (unsigned long int)found_marked); #endif H = dest; /* reset H */ @@ -3475,15 +3475,15 @@ icompact_heap(void) #ifdef DEBUG if (dest != H0-1) - fprintf(Yap_stderr,"%% Bad Dest (%d): %p should be %p\n", - GcCalls, - dest, - H0-1); + fprintf(Yap_stderr,"%% Bad Dest (%lu): %p should be %p\n", + (unsigned long int)GcCalls, + dest, + H0-1); if (total_marked != found_marked) - fprintf(Yap_stderr,"%% Upward (%d): %ld total against %ld found\n", - GcCalls, - (unsigned long int)total_marked, - (unsigned long int)found_marked); + fprintf(Yap_stderr,"%% Upward (%lu): %lu total against %lu found\n", + (unsigned long int)GcCalls, + (unsigned long int)total_marked, + (unsigned long int)found_marked); found_marked = 0; #endif @@ -3538,15 +3538,15 @@ icompact_heap(void) } #ifdef DEBUG if (H0+total_marked != dest) - fprintf(Yap_stderr,"%% Downward (%d): %p total against %p found\n", - GcCalls, - H0+total_marked, - dest); + fprintf(Yap_stderr,"%% Downward (%lu): %p total against %p found\n", + (unsigned long int)GcCalls, + H0+total_marked, + dest); if (total_marked != found_marked) - fprintf(Yap_stderr,"%% Downward (%d): %ld total against %ld found\n", - GcCalls, - (unsigned long int)total_marked, - (unsigned long int)found_marked); + fprintf(Yap_stderr,"%% Downward (%lu): %lu total against %lu found\n", + (unsigned long int)GcCalls, + (unsigned long int)total_marked, + (unsigned long int)found_marked); #endif H = dest; /* reset H */ @@ -3746,7 +3746,7 @@ do_gc(Int predarity, CELL *current_env, yamop *nextop) #if defined(YAPOR) || defined(THREADS) fprintf(Yap_stderr, "%% Worker Id %d:\n", worker_id); #endif - fprintf(Yap_stderr, "%% Start of garbage collection %d:\n", GcCalls); + fprintf(Yap_stderr, "%% Start of garbage collection %lu:\n", (unsigned long int)GcCalls); fprintf(Yap_stderr, "%% Global: %8ld cells (%p-%p)\n", (long int)heap_cells,H0,H); fprintf(Yap_stderr, "%% Local:%8ld cells (%p-%p)\n", (unsigned long int)(LCL0-ASP),LCL0,ASP); fprintf(Yap_stderr, "%% Trail:%8ld cells (%p-%p)\n", @@ -3885,7 +3885,7 @@ do_gc(Int predarity, CELL *current_env, yamop *nextop) TotGcTime += gc_time; TotGcRecovered += heap_cells-tot; if (gc_verbose) { - fprintf(Yap_stderr, "%% GC %d took %g sec, total of %g sec doing GC so far.\n", GcCalls, (double)gc_time/1000, (double)TotGcTime/1000); + fprintf(Yap_stderr, "%% GC %lu took %g sec, total of %g sec doing GC so far.\n", (unsigned long int)GcCalls, (double)gc_time/1000, (double)TotGcTime/1000); fprintf(Yap_stderr, "%% Left %ld cells free in stacks.\n", (unsigned long int)(ASP-H)); } diff --git a/H/amiops.h b/H/amiops.h index bd6d25c09..4e8115c1b 100644 --- a/H/amiops.h +++ b/H/amiops.h @@ -436,6 +436,8 @@ reset_trail(tr_fr_ptr TR0) { } } +inline EXTERN void reset_attvars(CELL *dvarsmin, CELL *dvarsmax); + inline EXTERN void reset_attvars(CELL *dvarsmin, CELL *dvarsmax) { if (dvarsmin) { @@ -452,6 +454,8 @@ reset_attvars(CELL *dvarsmin, CELL *dvarsmax) { } } +inline EXTERN void close_attvar_chain(CELL *dvarsmin, CELL *dvarsmax); + inline EXTERN void close_attvar_chain(CELL *dvarsmin, CELL *dvarsmax) { if (dvarsmin) { diff --git a/H/rheap.h b/H/rheap.h index b1c919489..18bbade64 100755 --- a/H/rheap.h +++ b/H/rheap.h @@ -966,14 +966,6 @@ RestoreBallTerm(int wid) } } -static void -RestoreScratchPad(int wid) -{ - if (ScratchPad.ptr) { - ScratchPad.ptr = AddrAdjust(ScratchPad.ptr); - } -} - #include "rglobals.h" /* restore the failcodes */