* device/include/pic16/stdio.h, device/lib/pic16/libc/stdio/streams.c,
[fw/sdcc] / device / lib / pic16 / libc / stdio / printf.c
index 6bbf2e1dbdad070d1b1fe54d2fbae769acca5546..93126937c125e19e63cb48e5f20ebd75e49b7e2a 100644 (file)
@@ -1,8 +1,8 @@
 /*-----------------------------------------------------------------
-    printf.c - 
+    printf.c -
 
     Written for pic16 port, by Vangelis Rokas, 2005 (vrokas@otenet.gr)
-    
+
     This library is free software; you can redistribute it and/or modify it
     under the terms of the GNU Library General Public License as published by the
     Free Software Foundation; either version 2, or (at your option) any
     In other words, you are welcome to use, share and improve this program.
     You are forbidden to forbid anyone else to use, share and improve
     what you give them.   Help stamp out software-hoarding!
--------------------------------------------------------------------------*/
 
-/*
-** $Id$
-*/
+   As a special exception, if you link this library with other files,
+   some of which are compiled with SDCC, to produce an executable,
+   this library does not by itself cause the resulting executable
+   to be covered by the GNU General Public License.
+   This exception does not however invalidate any other reasons why
+   the executable file might be covered by the GNU General Public License.
+-------------------------------------------------------------------------*/
 
 #include <stdarg.h>
 #include <stdio.h>
 
 #if _DEBUG
-extern void io_long(unsigned long);
-extern void io_str(char *);
+extern void io_long (unsigned long);
+extern void io_str (char *);
 #endif
 
-
-unsigned int printf(char *fmt, ...)
+int
+printf (const char *fmt, ...)
 {
-  unsigned int i;
   va_list ap;
-//  char *cfmt;
-  
+
 #if _DEBUG
-    io_str( "printf: " );
-    io_long( (unsigned long)stdout );
+  io_str ("printf: ");
+  io_long ((unsigned long) stdout);
 #endif
-//    cfmt = fmt;
-    
-    va_start(ap, fmt);
-    i = vfprintf(stdout, fmt, ap);
-    
-  return (i);
+
+  va_start (ap, fmt);
+  return vfprintf (stdout, fmt, ap);
 }