Fix compiler warnings, extra tokens at end of #endif, no newline at
[fw/sdcc] / device / lib / vprintf.c
index 1409507ed9b9026561691c2f1089dca4652a2163..ba7dd88600d486356eed756f7216808fe4fae517 100644 (file)
@@ -22,7 +22,9 @@
    You are forbidden to forbid anyone else to use, share and improve
    what you give them.   Help stamp out software-hoarding!  
 -------------------------------------------------------------------------*/
+#ifdef __ds390
 #define USE_FLOATS 1
+#endif
 
 #include <stdarg.h>
 #include <string.h>
@@ -70,7 +72,7 @@ static bit   lsd;
 /* this one NEEDS to be in data */
 static data value_t value;
 
-static unsigned short radix;
+static unsigned char radix;
 
 // jwk: TODO: this makes the whole dammed thing nonreentrent
 static int charsOutputted;
@@ -157,12 +159,12 @@ static void output_float (float f, unsigned char reqWidth,
                          signed char reqDecimals,
                          bit left, bit zero, bit sign, bit space)
 {
-  XSPEC char negative=0;
-  XSPEC long integerPart;
-  XSPEC float decimalPart;
-  XSPEC char fpBuffer[128];
-  XSPEC char fpBI=0, fpBD;
-  XSPEC unsigned char minWidth, i;
+  char negative=0;
+  long integerPart;
+  float decimalPart;
+  char fpBuffer[128];
+  char fpBI=0, fpBD;
+  unsigned char minWidth, i;
 
   // save the sign
   if (f<0) {
@@ -259,10 +261,10 @@ int vsprintf (const char *buf, const char *format, va_list ap)
   bit            long_argument;
   bit            float_argument;
 
-  XSPEC unsigned char  width;
-  XSPEC signed char decimals;
-  XSPEC unsigned char  length;
-  XSPEC char           c;
+  unsigned char  width;
+  signed char decimals;
+  unsigned char  length;
+  char           c;
 
   // reset output chars
   charsOutputted=0;
@@ -353,7 +355,7 @@ get_conversion_spec:
        goto get_conversion_spec;
 
       case 'C':
-               output_char( va_arg(ap,unsigned char) );
+               output_char( va_arg(ap,int) );
        break;
 
       case 'S':