2006-08-30 Joel Sherrill <joel@OARcorp.com>

* 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.
This commit is contained in:
Joel Sherrill
2006-08-30 13:53:02 +00:00
parent 48b1e29a7d
commit 352332193c
9 changed files with 52 additions and 28 deletions

View File

@@ -1,3 +1,11 @@
2006-08-30 Joel Sherrill <joel@OARcorp.com>
* 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 <joel@OARcorp.com>
* libcsupport/src/utsname.c, libnetworking/libc/res_debug.c,

View File

@@ -23,6 +23,7 @@
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include <inttypes.h>
#include <rtems/cpuuse.h>
@@ -98,10 +99,13 @@ 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;
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",
fprintf(stdout,
"0x%08" PRIu32 " %4s %8" PRId32 " %3" PRId32
".%2.2" PRId32"\n",
the_thread->Object.id,
name,
the_thread->ticks_executed,
@@ -113,10 +117,10 @@ void CPU_usage_Dump( void )
}
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

View File

@@ -17,6 +17,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <inttypes.h>
#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)

View File

@@ -30,6 +30,7 @@
#include <stdio.h>
#include <stdlib.h> /* strtoul() */
#include <inttypes.h>
#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: ");

View File

@@ -21,6 +21,7 @@
#include <rtems.h>
#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>
#include <rtems/monitor.h>
#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;
}

View File

@@ -11,6 +11,7 @@
#include <stdio.h>
#include <assert.h>
#include <ctype.h>
#include <inttypes.h>
#include <rtems/rtmonuse.h>
@@ -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,

View File

@@ -22,6 +22,7 @@
#endif
#include <rtems.h>
#include <inttypes.h>
/*
* HACK
@@ -315,7 +316,8 @@ 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
@@ -325,7 +327,7 @@ void Stack_check_report_blown_task(void)
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
);

View File

@@ -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);
}

View File

@@ -34,6 +34,7 @@
#include <stdlib.h>
#include <string.h> /* memset */
#include <stdio.h>
#include <inttypes.h>
/* FIXME: This should not be here */
extern void _rtems_telnetd_register_icmds(void);
@@ -124,7 +125,9 @@ 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",
printf(
"rtems_telnetd() started with stacksize=%" PRIu32
",priority=%" PRId32 "\n",
telnetd_stack_size,telnetd_task_priority);
return 0;
}