From ec23c7b6350ed6d5b1593573aa303489894577eb Mon Sep 17 00:00:00 2001 From: frief Date: Sun, 11 Mar 2007 20:22:30 +0000 Subject: [PATCH] * device/lib/printfl.c: 13 bytes less __data mem (12 more __idata) git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@4681 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- ChangeLog | 1 + device/lib/printfl.c | 20 ++++++++++++-------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index e2be7033..7b3b0c45 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,6 @@ 2007-03-11 Frieder Ferlemann + * device/lib/printfl.c: 13 bytes less __data mem (12 more __idata) * device/lib/printf_large.c: pointer was converted to generic pointer for mcs51 models other than model-small (Maarten noticed) diff --git a/device/lib/printfl.c b/device/lib/printfl.c index b863d7a5..70d4235a 100644 --- a/device/lib/printfl.c +++ b/device/lib/printfl.c @@ -48,12 +48,12 @@ #include <8051.h> #endif -static data char radix ; +static __data char radix ; static bit long_flag = 0; static bit string_flag =0; static bit char_flag = 0; -static char * data str ; -static data long val; +static char * __data str ; +static __data long val; /* This great loop fails with the ds390 port (2003-01-13). @@ -67,7 +67,7 @@ static data long val; */ #if NICE_LIFO_IMPLEMENTATION_BUT_NOT_PORTABLE -static data volatile char ch; +static __data volatile char ch; static bit sign; static void pval(void) @@ -177,12 +177,16 @@ void printf_small (char * fmt, ... ) reentrant #else if (radix) { - static char data buffer[12], c; + static char __idata buffer[12]; /* 37777777777(oct) */ + char __idata * stri; _ltoa (val, buffer, radix); - str = buffer; - while ((c = *str++) != '\0') - putchar (c); + stri = buffer; + while (*stri) + { + putchar (*stri); + stri++; + } } #endif else -- 2.30.2