Author: Jerry James gmail.com> Title: Patch for removing printf "warning: format" in bigloo source code URL: http://article.gmane.org/gmane.lisp.scheme.bigloo/5112 --- api/gstreamer/src/Clib/bglgst.c.orig 2011-01-24 06:30:52.000000000 -0700 +++ api/gstreamer/src/Clib/bglgst.c 2011-02-14 15:24:29.464185149 -0700 @@ -93,12 +93,12 @@ bglgst_use_threadsp() { /* bgl_gobject_boehm_alloc_init ... */ /*---------------------------------------------------------------------*/ static gpointer bgl_gst_alloc( gsize n ) { - fprintf( stderr, "GC_MALLOC n=%d\n", n ); + fprintf( stderr, "GC_MALLOC n=%" G_GSIZE_FORMAT "\n", n ); return GC_MALLOC( n ); } static gpointer bgl_gst_realloc( gpointer ptr, gsize n ) { - fprintf( stderr, "GC_REALLOC ptr=%p n=%d\n", ptr, n ); + fprintf( stderr, "GC_REALLOC ptr=%p n=%" G_GSIZE_FORMAT "\n", ptr, n ); return GC_REALLOC( ptr, n ); } @@ -297,7 +297,7 @@ bgl_g_value_to_obj( const GValue *gval, case G_TYPE_ENUM: { long obj = g_value_get_enum( gval ); - fprintf( stderr, "G_TYPE_ENUM not implemented yet %d (%s:%d)\n", + fprintf( stderr, "G_TYPE_ENUM not implemented yet %ld (%s:%d)\n", obj, __FILE__, __LINE__ ); return BUNSPEC; --- runtime/Clib/capply.c.orig 2011-01-24 06:30:52.000000000 -0700 +++ runtime/Clib/capply.c 2011-02-14 15:04:59.255817644 -0700 @@ -627,7 +627,7 @@ obj_t apply( obj_t function, obj_t args_ default: { char msg[ 128 ]; sprintf( msg, - "too many arguments provided (%d) in apply (max 50)", + "too many arguments provided (%ld) in apply (max 50)", -arity ); C_SYSTEM_FAILURE( BGL_ERROR, "apply", msg, function ); @@ -1229,7 +1229,7 @@ obj_t apply( obj_t function, obj_t args_ default: { char msg[ 128 ]; sprintf( msg, - "too many arguments provided (%d) in apply (max 50)", + "too many arguments provided (%ld) in apply (max 50)", arity ); C_SYSTEM_FAILURE( BGL_ERROR, "apply", msg, function ); --- runtime/Clib/cstring.c.orig 2011-01-24 06:30:52.000000000 -0700 +++ runtime/Clib/cstring.c 2011-02-14 15:04:18.391856999 -0700 @@ -293,23 +293,23 @@ integer_to_string_padding( long x, long case 8 : if( x < 0 ) { - sprintf( fmt, "-%%0%dlo", padding - 1 ); + sprintf( fmt, "-%%0%ldlo", padding - 1 ); } else { - sprintf( fmt, "%%0%dlo", padding ); + sprintf( fmt, "%%0%ldlo", padding ); } break; case 16 : if( x < 0 ) { - sprintf( fmt, "-%%0%dlx", padding - 1); + sprintf( fmt, "-%%0%ldlx", padding - 1); } else { - sprintf( fmt, "%%0%dlx", padding ); + sprintf( fmt, "%%0%ldlx", padding ); } break; default : if( x < 0 ) { - sprintf( fmt, "-%%0%dld", padding - 1 ); + sprintf( fmt, "-%%0%ldld", padding - 1 ); } else { - sprintf( fmt, "%%0%dld", padding ); + sprintf( fmt, "%%0%ldld", padding ); } break; } --- runtime/Clib/cerror.c.orig 2011-01-24 06:30:52.000000000 -0700 +++ runtime/Clib/cerror.c 2011-02-14 15:03:19.097168636 -0700 @@ -69,7 +69,7 @@ bgl_debug_typeof( obj_t obj ) { obj_t bgl_debug_header( obj_t obj ) { fprintf( stderr, "obj=%p\n", obj ); - fprintf( stderr, " TAG_MASK=%d ", (((long)obj) & TAG_MASK) ); + fprintf( stderr, " TAG_MASK=%ld ", (((long)obj) & TAG_MASK) ); switch( (((long)obj) & TAG_MASK) ) { case TAG_STRUCT: fprintf( stderr, "(TAG_STRUCT)\n" ); break; case TAG_INT: fprintf( stderr, "(TAG_INT)\n" ); break; @@ -96,7 +96,7 @@ bgl_debug_header( obj_t obj ) { } if( POINTERP( obj ) ) { - fprintf( stderr, " TYPE=%d ", TYPE( obj ) ); + fprintf( stderr, " TYPE=%ld ", TYPE( obj ) ); switch( TYPE( obj ) ) { case 0: fprintf( stderr, "(PAIR_TYPE) " ); break; case 1: fprintf( stderr, "(STRING_TYPE) " ); break; @@ -132,7 +132,7 @@ bgl_debug_header( obj_t obj ) { else fprintf( stderr, "(unknown type) " ); } - fprintf( stderr, "HEADER_SIZE=%d\n", HEADER_SIZE( CREF( obj )->header ) ); + fprintf( stderr, "HEADER_SIZE=%ld\n", HEADER_SIZE( CREF( obj )->header ) ); } return obj; --- runtime/Clib/ccontrol.c.orig 2011-01-24 06:30:52.000000000 -0700 +++ runtime/Clib/ccontrol.c 2011-02-14 15:07:40.999882828 -0700 @@ -200,9 +200,9 @@ bgl_procedure_entry_to_string( obj_t pro obj_t res = make_string_sans_fill( 17 ); if( VA_PROCEDUREP( proc ) ) { - sprintf( BSTRING_TO_STRING( res ), "%016x", PROCEDURE_VA_ENTRY( proc ) ); + sprintf( BSTRING_TO_STRING( res ), "%016lx", (long)PROCEDURE_VA_ENTRY( proc ) ); } else { - sprintf( BSTRING_TO_STRING( res ), "%016x", PROCEDURE_ENTRY( proc ) ); + sprintf( BSTRING_TO_STRING( res ), "%016lx", (long)PROCEDURE_ENTRY( proc ) ); } return res; --- bde/bmem/lib/thread.c.orig 2011-01-24 06:30:51.000000000 -0700 +++ bde/bmem/lib/thread.c 2011-02-14 15:18:41.127937649 -0700 @@ -50,9 +50,9 @@ bglthread_switch( void *this, void *next void thread_dump_statistics( FILE *f ) { if( context_switches || scheduler_awake ) { - fprintf( f, " (thread (context-switches %d) (scheduler-awake %d))\n", + fprintf( f, " (thread (context-switches %ld) (scheduler-awake %ld))\n", context_switches, scheduler_awake ); - fprintf( stderr, "thread...(context switches=%d, scheduler awake=%d)\n", + fprintf( stderr, "thread...(context switches=%ld, scheduler awake=%ld)\n", context_switches, scheduler_awake ); } --- bde/bmem/lib/alloc.c.orig 2011-01-24 06:30:52.000000000 -0700 +++ bde/bmem/lib/alloc.c 2011-02-14 15:10:55.176083686 -0700 @@ -109,7 +109,7 @@ alloc_dump_type( pa_pair_t *i, FILE *f ) /*---------------------------------------------------------------------*/ void alloc_dump( fun_alloc_info_t *i, FILE *f ) { - fprintf( f, " (%d %d %d\n", i->gc_num, + fprintf( f, " (%lu %lu %lu\n", i->gc_num, BMEMSIZE( i->dsize ), BMEMSIZE( i->isize ) ); fprintf( f, " (dtype" ); for_each( (void (*)(void *, void *))alloc_dump_type, i->dtypes, f ); @@ -486,7 +486,7 @@ GC_malloc( size_t lb ) { #if BMEMDEBUG if( bmem_debug ) { - fprintf( stderr, "GC_malloc(%d): %s %d\n", + fprintf( stderr, "GC_malloc(%zu): %s %d\n", lb, bgl_debug_trace_top_name(), get_alloc_type() ); } #endif @@ -513,7 +513,7 @@ GC_realloc( obj_t old, size_t lb ) { #if BMEMDEBUG if( bmem_debug ) { - fprintf( stderr, "GC_realloc(%d): top=%s type=%d\n", + fprintf( stderr, "GC_realloc(%zu): top=%s type=%d\n", lb, bgl_debug_trace_top_name(), get_alloc_type() ); } #endif @@ -541,7 +541,7 @@ GC_malloc_atomic( size_t lb ) { #if BMEMDEBUG if( bmem_debug ) { - fprintf( stderr, "GC_malloc_atomic(%d): top=%s type=%d\n", + fprintf( stderr, "GC_malloc_atomic(%zu): top=%s type=%d\n", lb, bgl_debug_trace_top_name(), get_alloc_type() ); } #endif @@ -623,7 +623,7 @@ BGl_registerzd2classz12zc0zz__objectz00( hash, def, constructor, virt ); - fprintf( stderr, "ok\n", cname ); + fprintf( stderr, "ok\n" ); return class; } --- bde/bmem/lib/symbol.c.orig 2011-01-24 06:30:51.000000000 -0700 +++ bde/bmem/lib/symbol.c 2011-02-14 15:13:47.727927175 -0700 @@ -33,7 +33,7 @@ make_symbol( obj_t name ) { #if BMEMDEBUG if( bmem_debug > 1 ) { - fprintf( stderr, "make_symbol: %s %p\n", name, symbol ); + fprintf( stderr, "make_symbol: %s %p\n", BSTRING_TO_STRING( name ), symbol ); } #endif symbol->symbol_t.header = MAKE_HEADER( SYMBOL_TYPE, SYMBOL_SIZE ); --- bde/bmem/lib/trace.c.orig 2011-01-24 06:30:52.000000000 -0700 +++ bde/bmem/lib/trace.c 2011-02-14 15:17:49.472275324 -0700 @@ -79,9 +79,9 @@ bgl_debug_trace_top() { fprintf( stderr, " top->name=KEYWORD %p\n", top->name ); } else { if( !POINTERP( top->name ) ) { - fprintf( stderr, " top->name=pas pointer %d\n", top->name ); + fprintf( stderr, " top->name=pas pointer %p\n", top->name ); } else { - fprintf( stderr, " top->name=pointer %p\n", TYPE( top->name ) ); + fprintf( stderr, " top->name=pointer %ld\n", TYPE( top->name ) ); } } } --- bde/bmem/lib/gchook.c.orig 2011-01-24 06:30:52.000000000 -0700 +++ bde/bmem/lib/gchook.c 2011-02-14 15:12:29.119566199 -0700 @@ -45,13 +45,13 @@ GC_collect_hook( int heapsz, long livesz gc_number++; if( heapsz > (1024 * 1024) ) { - fprintf( stderr, "gc %3d: alloc size=%.2fMB, heap size=%.2fMB, live size=%.2fMB\n", + fprintf( stderr, "gc %3lu: alloc size=%.2fMB, heap size=%.2fMB, live size=%.2fMB\n", gc_number, ((double)gc_alloc_size / (1024. * 1024.)), ((double)heapsz / (1024. * 1024.)), ((double)livesz / (1024. * 1024.)) ); } else { - fprintf( stderr, "gc %3d: alloc size=%dKB, heap size=%dKB, live size=%ldKB\n", + fprintf( stderr, "gc %3lu: alloc size=%luKB, heap size=%dKB, live size=%ldKB\n", gc_number, gc_alloc_size / 1024, heapsz / 1024, @@ -81,7 +81,7 @@ gc_alloc_size_add( int size ) { /*---------------------------------------------------------------------*/ static void GC_dump_gc( gc_info_t *i, FILE *f ) { - fprintf( f, " (%d %d %d %d)\n", + fprintf( f, " (%lu %lu %lu %lu)\n", i->number, BMEMSIZE( i->alloc_size ), BMEMSIZE( i->heap_size ),