From 038b8b3919c801b7065a9ec3f5aee5ea9653b5d9 Mon Sep 17 00:00:00 2001 From: Tony Breeds Date: Tue, 18 Oct 2011 11:19:23 +1100 Subject: [PATCH] warnings: Add explict prototype for prom_vfprintf() Also update GCC format attributes Signed-off-by: Tony Breeds --- include/prom.h | 17 +++++++++-------- second/prom.c | 10 +++++----- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/include/prom.h b/include/prom.h index 62e6548..0462e39 100644 --- a/include/prom.h +++ b/include/prom.h @@ -74,15 +74,16 @@ void prom_putchar (char); int prom_nbgetchar(); #ifdef __GNUC__ -void prom_vprintf (char *fmt, va_list ap) __attribute__ ((format (printf, 1, 0))); -void prom_fprintf (prom_handle dev, char *fmt, ...) __attribute__ ((format (printf, 2, 3))); -void prom_printf (char *fmt, ...) __attribute__ ((format (printf, 1, 2))); -void prom_debug (char *fmt, ...) __attribute__ ((format (printf, 1, 2))); +void prom_vprintf (const char *fmt, va_list ap) __attribute__ ((format (printf, 1, 0))); +void prom_vfprintf (prom_handle file, const char *fmt, va_list ap) __attribute__ ((format (printf, 2, 0))); +void prom_fprintf (prom_handle dev, const char *fmt, ...) __attribute__ ((format (printf, 2, 3))); +void prom_printf (const char *fmt, ...) __attribute__ ((format (printf, 1, 2))); +void prom_debug (const char *fmt, ...) __attribute__ ((format (printf, 1, 2))); #else -void prom_vprintf (char *fmt, va_list ap); -void prom_fprintf (prom_handle dev, char *fmt, ...); -void prom_printf (char *fmt, ...); -void prom_debug (char *fmt, ...); +void prom_vprintf (const char *fmt, va_list ap); +void prom_fprintf (prom_handle dev, const char *fmt, ...); +void prom_printf (const char *fmt, ...); +void prom_debug (const char *fmt, ...); #endif void prom_perror (int error, char *filename); diff --git a/second/prom.c b/second/prom.c index 51870d9..a991884 100644 --- a/second/prom.c +++ b/second/prom.c @@ -439,7 +439,7 @@ prom_puts (prom_handle file, char *s) } void -prom_vfprintf (prom_handle file, char *fmt, va_list ap) +prom_vfprintf (prom_handle file, const char *fmt, va_list ap) { static char printf_buf[2048]; vsprintf (printf_buf, fmt, ap); @@ -447,7 +447,7 @@ prom_vfprintf (prom_handle file, char *fmt, va_list ap) } void -prom_vprintf (char *fmt, va_list ap) +prom_vprintf (const char *fmt, va_list ap) { static char printf_buf[2048]; vsprintf (printf_buf, fmt, ap); @@ -455,7 +455,7 @@ prom_vprintf (char *fmt, va_list ap) } void -prom_fprintf (prom_handle file, char *fmt, ...) +prom_fprintf (prom_handle file, const char *fmt, ...) { va_list ap; va_start (ap, fmt); @@ -464,7 +464,7 @@ prom_fprintf (prom_handle file, char *fmt, ...) } void -prom_printf (char *fmt, ...) +prom_printf (const char *fmt, ...) { va_list ap; va_start (ap, fmt); @@ -473,7 +473,7 @@ prom_printf (char *fmt, ...) } void -prom_debug (char *fmt, ...) +prom_debug (const char *fmt, ...) { va_list ap; -- 2.39.2