From 114acc4d796b68faeb149b834868972f94de21ef Mon Sep 17 00:00:00 2001 From: cuz Date: Sun, 13 Aug 2000 16:16:49 +0000 Subject: [PATCH] Fixed param type qualifiers in several function definitions git-svn-id: svn://svn.cc65.org/cc65/trunk@278 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- libsrc/common/bsearch.c | 5 +++-- libsrc/common/cprintf.c | 2 +- libsrc/common/fdopen.c | 2 +- libsrc/common/fprintf.c | 2 +- libsrc/common/fputs.c | 2 +- libsrc/common/freopen.c | 2 +- libsrc/common/fwrite.c | 2 +- libsrc/common/printf.c | 4 ++-- libsrc/common/sprintf.c | 2 +- libsrc/common/vcprintf.c | 2 +- libsrc/common/vfprintf.c | 3 ++- libsrc/common/vprintf.c | 2 +- libsrc/common/vsprintf.c | 2 +- 13 files changed, 17 insertions(+), 15 deletions(-) diff --git a/libsrc/common/bsearch.c b/libsrc/common/bsearch.c index 47cbc4e1c..1d3ef2597 100644 --- a/libsrc/common/bsearch.c +++ b/libsrc/common/bsearch.c @@ -10,9 +10,10 @@ -void* bsearch (void* key, void* base, size_t n, size_t size, int (*cmp) (void*, void*)) +void* bsearch (const void* key, const void* base, size_t n, size_t size, + int (*cmp) (const void*, const void*)) { - int current; + int current; int result; int found = 0; int first = 0; diff --git a/libsrc/common/cprintf.c b/libsrc/common/cprintf.c index a9d46ecbd..4ce56917b 100644 --- a/libsrc/common/cprintf.c +++ b/libsrc/common/cprintf.c @@ -11,7 +11,7 @@ -int cprintf (char* format, ...) +int cprintf (const char* format, ...) { va_list ap; va_start (ap, format); diff --git a/libsrc/common/fdopen.c b/libsrc/common/fdopen.c index ee0f07ee5..f7df76d94 100644 --- a/libsrc/common/fdopen.c +++ b/libsrc/common/fdopen.c @@ -13,7 +13,7 @@ -FILE* fdopen (int handle, char* /*mode*/) +FILE* fdopen (int handle, const char* /*mode*/) { FILE* f; diff --git a/libsrc/common/fprintf.c b/libsrc/common/fprintf.c index afa111f79..010180bf8 100644 --- a/libsrc/common/fprintf.c +++ b/libsrc/common/fprintf.c @@ -11,7 +11,7 @@ -int fprintf (FILE* /*F*/, char* format, ...) +int fprintf (FILE* /*F*/, const char* format, ...) { va_list ap; va_start (ap, format); diff --git a/libsrc/common/fputs.c b/libsrc/common/fputs.c index f4dcbbf9d..2fd42efae 100644 --- a/libsrc/common/fputs.c +++ b/libsrc/common/fputs.c @@ -13,7 +13,7 @@ -int fputs (char* s, FILE* f) +int fputs (const char* s, FILE* f) { /* Check if the file is open or if there is an error condition */ if ((f->f_flags & _FOPEN) == 0 || (f->f_flags & (_FERROR | _FEOF)) != 0) { diff --git a/libsrc/common/freopen.c b/libsrc/common/freopen.c index bbad5b326..da86b2685 100644 --- a/libsrc/common/freopen.c +++ b/libsrc/common/freopen.c @@ -13,7 +13,7 @@ -FILE* freopen (char* name, char* mode, FILE* f) +FILE* freopen (const char* name, const char* mode, FILE* f) { /* Check if the file is open, if so, close it */ if ((f->f_flags & _FOPEN) == 0) { diff --git a/libsrc/common/fwrite.c b/libsrc/common/fwrite.c index 7978d2d2c..30ceaea0a 100644 --- a/libsrc/common/fwrite.c +++ b/libsrc/common/fwrite.c @@ -13,7 +13,7 @@ -size_t fwrite (void* buf, size_t size, size_t count, FILE* f) +size_t fwrite (const void* buf, size_t size, size_t count, FILE* f) { int bytes; diff --git a/libsrc/common/printf.c b/libsrc/common/printf.c index 7f0fcb4a0..f5228ef4b 100644 --- a/libsrc/common/printf.c +++ b/libsrc/common/printf.c @@ -1,6 +1,6 @@ /* * printf.c - * + * * Ullrich von Bassewitz, 11.08.1998 */ @@ -11,7 +11,7 @@ -int printf (char* format, ...) +int printf (const char* format, ...) { va_list ap; va_start (ap, format); diff --git a/libsrc/common/sprintf.c b/libsrc/common/sprintf.c index 26b03486d..15c028fbf 100644 --- a/libsrc/common/sprintf.c +++ b/libsrc/common/sprintf.c @@ -11,7 +11,7 @@ -int sprintf (char* /*buf*/, char* format, ...) +int sprintf (char* /*buf*/, const char* format, ...) { va_list ap; va_start (ap, format); diff --git a/libsrc/common/vcprintf.c b/libsrc/common/vcprintf.c index 97e8214d4..4b54cdbdc 100644 --- a/libsrc/common/vcprintf.c +++ b/libsrc/common/vcprintf.c @@ -26,7 +26,7 @@ static void out (struct outdesc* d, char* buf, unsigned count) -int vcprintf (char* format, va_list ap) +int vcprintf (const char* format, va_list ap) { struct outdesc d; diff --git a/libsrc/common/vfprintf.c b/libsrc/common/vfprintf.c index a150aaa0c..f33c9c47e 100644 --- a/libsrc/common/vfprintf.c +++ b/libsrc/common/vfprintf.c @@ -25,7 +25,7 @@ static void out (struct outdesc* d, char* buf, unsigned count) -int vfprintf (FILE* f, char* format, va_list ap) +int vfprintf (FILE* f, const char* format, va_list ap) { struct outdesc d; @@ -42,3 +42,4 @@ int vfprintf (FILE* f, char* format, va_list ap) + diff --git a/libsrc/common/vprintf.c b/libsrc/common/vprintf.c index 923d3e5c1..7ad77b396 100644 --- a/libsrc/common/vprintf.c +++ b/libsrc/common/vprintf.c @@ -12,7 +12,7 @@ -int vprintf (char* format, va_list ap) +int vprintf (const char* format, va_list ap) { return vfprintf (stdout, format, ap); } diff --git a/libsrc/common/vsprintf.c b/libsrc/common/vsprintf.c index 8b5700b2b..9b55da9c0 100644 --- a/libsrc/common/vsprintf.c +++ b/libsrc/common/vsprintf.c @@ -25,7 +25,7 @@ static void out (struct outdesc* d, char* buf, unsigned count) -int vsprintf (char* buf, char* format, va_list ap) +int vsprintf (char* buf, const char* format, va_list ap) { struct outdesc d;