From: frief Date: Thu, 8 Mar 2007 22:00:32 +0000 (+0000) Subject: * device/lib/printf_large.c: 6 bytes less __data mem (6 more __idata) X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=f1007d04010ff2955d4d962c89616311ff4719d6;p=fw%2Fsdcc * device/lib/printf_large.c: 6 bytes less __data mem (6 more __idata) git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@4671 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/ChangeLog b/ChangeLog index 4c354c32..8734cc7e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2007-03-08 Frieder Ferlemann + + * device/lib/printf_large.c: 6 bytes less __data mem (6 more __idata) + 2007-03-07 Borut Razem * device/lib/pic16/libdev/pic18f[24][34]31.c: diff --git a/device/lib/printf_large.c b/device/lib/printf_large.c index 9df2285a..af2a3f6b 100644 --- a/device/lib/printf_large.c +++ b/device/lib/printf_large.c @@ -42,6 +42,12 @@ #define NULL_STRING_LENGTH 6 #endif +#if defined (SDCC_mcs51) && defined (SDCC_MODEL_SMALL) && !defined (SDCC_STACK_AUTO) +# define MEM_SPACE_BUF __idata +#else +# define MEM_SPACE_BUF +#endif + /****************************************************************************/ //typedef char * ptr_t; @@ -223,7 +229,7 @@ output_float (float f, unsigned char reqWidth, signed char reqDecimals, BOOL left, BOOL zero, BOOL sign, BOOL space) { - xdata char fpBuffer[128]; + __xdata char fpBuffer[128]; #endif //SDCC_STACK_AUTO BOOL negative = 0; unsigned long integerPart; @@ -657,10 +663,10 @@ get_conversion_spec: #endif //USE_FLOATS } else if (radix != 0) { - // Apperently we have to output an integral type + // Apparently we have to output an integral type // with radix "radix" - unsigned char store[6]; - unsigned char _AUTOMEM *pstore = &store[5]; + unsigned char MEM_SPACE_BUF store[6]; + unsigned char MEM_SPACE_BUF *pstore = &store[5]; // store value in byte[0] (LSB) ... byte[3] (MSB) if (char_argument)