From: johanknol Date: Thu, 27 Sep 2001 11:10:48 +0000 (+0000) Subject: That wasn't a good idea X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=0b9d8951b4695de31eb6a9471df839a2e689c05d;p=fw%2Fsdcc That wasn't a good idea git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1316 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/device/lib/gbz80/printf.c b/device/lib/gbz80/printf.c index 2379d8ad..d584bdb8 100644 --- a/device/lib/gbz80/printf.c +++ b/device/lib/gbz80/printf.c @@ -22,7 +22,7 @@ STATIC void _printn(unsigned u, unsigned base, char issigned, void (*emitter)(ch (*emitter)(_hex[u%base], pData); } -STATIC void _printf(char *format, void (*emitter)(char, void *), void *pData, va_list va) +STATIC void _printf(const char *format, void (*emitter)(char, void *), void *pData, va_list va) { while (*format) { if (*format == '%') { diff --git a/device/lib/vprintf.c b/device/lib/vprintf.c index bbff51b3..555f4f24 100644 --- a/device/lib/vprintf.c +++ b/device/lib/vprintf.c @@ -254,7 +254,7 @@ static void output_float (float f, unsigned char reqWidth, /*--------------------------------------------------------------------------*/ -int vsprintf (const char *buf, char *format, va_list ap) +int vsprintf (const char *buf, const char *format, va_list ap) { static bit left_justify; static bit zero_padding; diff --git a/device/lib/z80/printf.c b/device/lib/z80/printf.c index 2379d8ad..d584bdb8 100644 --- a/device/lib/z80/printf.c +++ b/device/lib/z80/printf.c @@ -22,7 +22,7 @@ STATIC void _printn(unsigned u, unsigned base, char issigned, void (*emitter)(ch (*emitter)(_hex[u%base], pData); } -STATIC void _printf(char *format, void (*emitter)(char, void *), void *pData, va_list va) +STATIC void _printf(const char *format, void (*emitter)(char, void *), void *pData, va_list va) { while (*format) { if (*format == '%') { diff --git a/src/SDCCast.c b/src/SDCCast.c index 94aa8e13..25640f80 100644 --- a/src/SDCCast.c +++ b/src/SDCCast.c @@ -2082,12 +2082,8 @@ decorateType (ast * tree) { sym_link *ltc = (tree->right ? RTYPE (tree) : LTYPE (tree)); COPYTYPE (TTYPE (tree), TETYPE (tree), ltc); - if (!tree->initMode) { - if ((IS_SPEC(TETYPE(tree)) && IS_CONSTANT (TETYPE (tree))) || - (IS_PTR(TTYPE(tree)) && DCL_PTR_CONST(TTYPE(tree)))) { + if (!tree->initMode && IS_CONSTANT(TETYPE(tree))) werror (E_CODE_WRITE, "++/--"); - } - } if (tree->right) RLVAL (tree) = 1; @@ -3115,10 +3111,8 @@ decorateType (ast * tree) RRVAL (tree) = 1; LLVAL (tree) = 1; if (!tree->initMode ) { - if ((IS_SPEC(LETYPE(tree)) && IS_CONSTANT (LETYPE (tree))) || - (IS_PTR(LTYPE(tree)) && DCL_PTR_CONST(LTYPE(tree)))) { + if ((IS_SPEC(LETYPE(tree)) && IS_CONSTANT (LETYPE (tree)))) werror (E_CODE_WRITE, " "); - } } if (LRVAL (tree)) {