From 352332193c1146a2e82a891d7b72136acc1bee5d Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Wed, 30 Aug 2006 13:53:02 +0000 Subject: 2006-08-30 Joel Sherrill * libmisc/cpuuse/cpuuse.c, libmisc/monitor/mon-command.c, libmisc/monitor/mon-driver.c, libmisc/monitor/mon-symbols.c, libmisc/rtmonuse/rtmonuse.c, libmisc/stackchk/check.c, libnetworking/libc/res_debug.c, telnetd/telnetd.c: Remove printf format warnings. --- cpukit/ChangeLog | 8 ++++++++ cpukit/libmisc/cpuuse/cpuuse.c | 20 ++++++++++++-------- cpukit/libmisc/monitor/mon-command.c | 5 +++-- cpukit/libmisc/monitor/mon-driver.c | 3 ++- cpukit/libmisc/monitor/mon-symbols.c | 8 +++++--- cpukit/libmisc/rtmonuse/rtmonuse.c | 4 +++- cpukit/libmisc/stackchk/check.c | 23 +++++++++++++---------- cpukit/libnetworking/libc/res_debug.c | 2 +- cpukit/telnetd/telnetd.c | 7 +++++-- 9 files changed, 52 insertions(+), 28 deletions(-) (limited to 'cpukit') diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog index 6d4bc7917e..7345d134fa 100644 --- a/cpukit/ChangeLog +++ b/cpukit/ChangeLog @@ -1,3 +1,11 @@ +2006-08-30 Joel Sherrill + + * libmisc/cpuuse/cpuuse.c, libmisc/monitor/mon-command.c, + libmisc/monitor/mon-driver.c, libmisc/monitor/mon-symbols.c, + libmisc/rtmonuse/rtmonuse.c, libmisc/stackchk/check.c, + libnetworking/libc/res_debug.c, telnetd/telnetd.c: Remove printf + format warnings. + 2006-08-30 Joel Sherrill * libcsupport/src/utsname.c, libnetworking/libc/res_debug.c, diff --git a/cpukit/libmisc/cpuuse/cpuuse.c b/cpukit/libmisc/cpuuse/cpuuse.c index 2906f622df..92a46fe4b6 100644 --- a/cpukit/libmisc/cpuuse/cpuuse.c +++ b/cpukit/libmisc/cpuuse/cpuuse.c @@ -23,6 +23,7 @@ #include #include #include +#include #include @@ -98,25 +99,28 @@ void CPU_usage_Dump( void ) if ( !isprint(name[2]) ) name[2] = '*'; if ( !isprint(name[3]) ) name[3] = '*'; - ival = total_units ? the_thread->ticks_executed * 10000 / total_units : 0; - fval = ival % 100; - ival /= 100; - fprintf(stdout, "0x%08x %4s %8d %3d.%2.2d\n", + ival = total_units ? + the_thread->ticks_executed * 10000 / total_units : 0; + fval = ival % 100; + ival /= 100; + fprintf(stdout, + "0x%08" PRIu32 " %4s %8" PRId32 " %3" PRId32 + ".%2.2" PRId32"\n", the_thread->Object.id, name, the_thread->ticks_executed, - ival, - fval + ival, + fval ); } } } fprintf(stdout, - "\nTicks since last reset = %d\n", + "\nTicks since last reset = %" PRId32 "\n", _Watchdog_Ticks_since_boot - CPU_usage_Ticks_at_last_reset ); - fprintf(stdout, "\nTotal Units = %d\n", total_units ); + fprintf(stdout, "\nTotal Units = %" PRId32 "\n", total_units ); } /*PAGE diff --git a/cpukit/libmisc/monitor/mon-command.c b/cpukit/libmisc/monitor/mon-command.c index dc20dcb203..bc4c2f126a 100644 --- a/cpukit/libmisc/monitor/mon-command.c +++ b/cpukit/libmisc/monitor/mon-command.c @@ -17,6 +17,7 @@ #include #include #include +#include #ifndef MONITOR_PROMPT #define MONITOR_PROMPT "rtems" /* will have '> ' appended */ @@ -496,11 +497,11 @@ rtems_monitor_command_read(char *command, sprintf (monitor_prompt, "%s", (env_prompt == NULL) ? MONITOR_PROMPT: env_prompt); else if (rtems_monitor_default_node != rtems_monitor_node) - sprintf (monitor_prompt, "%d-%s-%d", rtems_monitor_node, + sprintf (monitor_prompt, "%" PRId32 "-%s-%" PRId32 "", rtems_monitor_node, (env_prompt == NULL) ? MONITOR_PROMPT : env_prompt, rtems_monitor_default_node); else - sprintf (monitor_prompt, "%d-%s", rtems_monitor_node, + sprintf (monitor_prompt, "%" PRId32 "-%s", rtems_monitor_node, (env_prompt == NULL) ? MONITOR_PROMPT : env_prompt); #if defined(RTEMS_UNIX) diff --git a/cpukit/libmisc/monitor/mon-driver.c b/cpukit/libmisc/monitor/mon-driver.c index 12e84f414e..48827173e5 100644 --- a/cpukit/libmisc/monitor/mon-driver.c +++ b/cpukit/libmisc/monitor/mon-driver.c @@ -30,6 +30,7 @@ #include #include /* strtoul() */ +#include #define DATACOL 15 #define CONTCOL DATACOL /* continued col */ @@ -110,7 +111,7 @@ rtems_monitor_driver_dump( { uint32_t length = 0; - length += fprintf(stdout," %d", monitor_driver->id); + length += fprintf(stdout," %" PRId32 "", monitor_driver->id); length += rtems_monitor_pad(13, length); length += fprintf(stdout,"init: "); diff --git a/cpukit/libmisc/monitor/mon-symbols.c b/cpukit/libmisc/monitor/mon-symbols.c index ac98523704..7ecae3b0e1 100644 --- a/cpukit/libmisc/monitor/mon-symbols.c +++ b/cpukit/libmisc/monitor/mon-symbols.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include "symbols.h" @@ -400,15 +401,16 @@ rtems_monitor_symbol_dump( (int) sizeof(canonical_symbol->name), canonical_symbol->name); else - length += fprintf(stdout,"<%.*s+0x%x>", + length += fprintf(stdout,"<%.*s+0x%" PRIx32 ">", (int) sizeof(canonical_symbol->name), canonical_symbol->name, canonical_symbol->offset); if (verbose) - length += fprintf(stdout," [0x%x]", canonical_symbol->value); + length += fprintf(stdout, + " [0x%" PRIx32 "]", canonical_symbol->value); } else - length += fprintf(stdout,"[0x%x]", canonical_symbol->value); + length += fprintf(stdout,"[0x%" PRIx32 "]", canonical_symbol->value); return length; } diff --git a/cpukit/libmisc/rtmonuse/rtmonuse.c b/cpukit/libmisc/rtmonuse/rtmonuse.c index 14fca3b0eb..4b8c2cbfe4 100644 --- a/cpukit/libmisc/rtmonuse/rtmonuse.c +++ b/cpukit/libmisc/rtmonuse/rtmonuse.c @@ -11,6 +11,7 @@ #include #include #include +#include #include @@ -192,7 +193,8 @@ void Period_usage_Dump( void ) fprintf(stdout, - "0x%08x %4s %6d %3d %d/%d/%5.2f %d/%d/%3.2f\n", + "0x%08" PRIx32 " %4s %6" PRId32 " %3" PRId32 " %" PRId32 + "/%" PRId32 "/%5.2f %" PRId32 "/%" PRId32 "/%3.2f\n", the_usage->id, name, the_usage->count, diff --git a/cpukit/libmisc/stackchk/check.c b/cpukit/libmisc/stackchk/check.c index 87d5b585b6..200e2812d2 100644 --- a/cpukit/libmisc/stackchk/check.c +++ b/cpukit/libmisc/stackchk/check.c @@ -22,6 +22,7 @@ #endif #include +#include /* * HACK @@ -315,17 +316,18 @@ void Stack_check_report_blown_task(void) fprintf( stderr, - "BLOWN STACK!!! Offending task(%p): id=0x%08x; name=0x%08x", + "BLOWN STACK!!! Offending task(%p): id=0x%08" PRIx32 + "; name=0x%08" PRIx32, running, running->Object.id, - (uint32_t )running->Object.name + (uint32_t) running->Object.name ); fflush(stderr); if (rtems_configuration_get_user_multiprocessing_table()) fprintf( stderr, - "; node=%d\n", + "; node=%" PRId32 "\n", rtems_configuration_get_user_multiprocessing_table()->node ); else @@ -334,10 +336,10 @@ void Stack_check_report_blown_task(void) fprintf( stderr, - " stack covers range 0x%08x - 0x%08x (%d bytes)\n", - (uint32_t ) stack->area, - (uint32_t ) stack->area + stack->size - 1, - (uint32_t ) stack->size); + " stack covers range %p - %p" PRIx32 " (%" PRId32 " bytes)\n", + stack->area, + stack->area + stack->size - 1, + stack->size); fflush(stderr); fprintf( @@ -480,11 +482,12 @@ void Stack_check_Dump_threads_usage( name[ 4 ] = '\0'; } - fprintf(stdout, "0x%08x %4s 0x%08x 0x%08x %8d %8d\n", + fprintf(stdout, "0x%08" PRIx32 " %4s %p - %p" + " %8" PRId32 " %8" PRId32 "\n", the_thread ? the_thread->Object.id : ~0, name, - (uint32_t ) stack->area, - (uint32_t ) stack->area + (uint32_t ) stack->size - 1, + stack->area, + stack->area + stack->size - 1, size, used ); diff --git a/cpukit/libnetworking/libc/res_debug.c b/cpukit/libnetworking/libc/res_debug.c index 8d41fa818d..4ea4aec144 100644 --- a/cpukit/libnetworking/libc/res_debug.c +++ b/cpukit/libnetworking/libc/res_debug.c @@ -534,7 +534,7 @@ p_time(u_int32_t value) { static char nbuf[40]; if (ns_format_ttl(value, nbuf, sizeof nbuf) < 0) - sprintf(nbuf, "%" PRIu32, value); + sprintf(nbuf, "%" PRIu32, (uint32_t) value); return (nbuf); } diff --git a/cpukit/telnetd/telnetd.c b/cpukit/telnetd/telnetd.c index ce5e331976..5f856b005a 100644 --- a/cpukit/telnetd/telnetd.c +++ b/cpukit/telnetd/telnetd.c @@ -34,6 +34,7 @@ #include #include /* memset */ #include +#include /* FIXME: This should not be here */ extern void _rtems_telnetd_register_icmds(void); @@ -124,8 +125,10 @@ int rtems_telnetd_main(int argc,char * argv[]) { if (argc>2) telnetd_task_priority=str2int(argv[2]); sc=rtems_initialize_telnetd(); if (sc!=RTEMS_SUCCESSFUL) return sc; - printf("rtems_telnetd() started with stacksize=%u,priority=%d\n", - telnetd_stack_size,telnetd_task_priority); + printf( + "rtems_telnetd() started with stacksize=%" PRIu32 + ",priority=%" PRId32 "\n", + telnetd_stack_size,telnetd_task_priority); return 0; } /***********************************************************/ -- cgit v1.2.3