This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Add missing iprintf and iscanf family for SPU


Jeff Johnston <jjohnstn@redhat.com> wrote:
> Kazunori Asayama wrote:
> > Here is an alternative approach:
> > 
> >   - to eliminate internal use of iprintf family, and
> >   - to leave iprintf family undefined.
> >     (or to define iprintf family as functions if required.)
> > 
> > Attached is a patch to implement this.
> > What do you think ?
> >
> 
> I don't like this idea.
> 
> If spu is replacing the stdio directory, then replace the stdio 
> directory.  Why avoid creating C files for the iprint/iscanf family 
> routines in the machine/spu directory?  For these particular functions, 
> it's not like they are complicated to write or that they are large in 
> size.  All the logic is already there and spu doesn't need specialized 
> logic.  They can either be copies of their non-integer counterparts or 
> else they can call the regular printf/scanf family routines to do the 
> work for them.

The SPU ABI causes a variable argument function to have a large
function prologue which includes many store instructions (about 300
bytes), because 72 registers are defined for passing function
parameters and they must be saved in memory at the function prologue
to construct a va list. So variable argument functions tend to be 'not
small' for SPU (although 'not large'), and I'd like to avoid linking
both of iprintf family and printf family if possible.

I agreed to provide SPU specific iprintf family implementation,
regardless of internal use of iprintf family. I'll separate these two
issues.

Attached is a patch to implement iprintf and iscanf family for
SPU. The functions are implemented in the similar way to vfiprintf in
the "stdio" directory, i.e. sources are shared between integer
versions and non-integer versions.

I ran the the same tests for offloaded printf and scanf family (except
function names), and verified that the undefined-reference in assert()
was fixed.

If OK, could you apply the patch ?


2007-02-20  Kazunori Asayama <asayama@sm.sony.co.jp>

	* libc/machine/spu/Makefile.am: Add new objects.
	* libc/machine/spu/Makefile.in: Regenerated.
	* libc/machine/spu/fiprintf.c: New file. Add implementation of
	integer-only version.
	* libc/machine/spu/fiscanf.c: Ditto.
	* libc/machine/spu/iprintf.c: Ditto.
	* libc/machine/spu/iscanf.c: Ditto.
	* libc/machine/spu/siprintf.c: Ditto.
	* libc/machine/spu/siscanf.c: Ditto.
	* libc/machine/spu/sniprintf.c: Ditto.
	* libc/machine/spu/vfiprintf.c: Ditto.
	* libc/machine/spu/vfiscanf.c: Ditto.
	* libc/machine/spu/viprintf.c: Ditto.
	* libc/machine/spu/viscanf.c: Ditto.
	* libc/machine/spu/vsiprintf.c: Ditto.
	* libc/machine/spu/vsiscanf.c: Ditto.
	* libc/machine/spu/vsniprintf.c: Ditto.
	* libc/machine/spu/fprintf.c: Add support for integer-only
	version.
	* libc/machine/spu/fscanf.c: Ditto.
	* libc/machine/spu/printf.c: Ditto.
	* libc/machine/spu/scanf.c: Ditto.
	* libc/machine/spu/snprintf.c: Ditto.
	* libc/machine/spu/sprintf.c: Ditto.
	* libc/machine/spu/sscanf.c: Ditto.
	* libc/machine/spu/vfprintf.c: Ditto.
	* libc/machine/spu/vfscanf.c: Ditto.
	* libc/machine/spu/vprintf.c: Ditto.
	* libc/machine/spu/vscanf.c: Ditto.
	* libc/machine/spu/vsnprintf.c: Ditto.
	* libc/machine/spu/vsprintf.c: Ditto.
	* libc/machine/spu/vsscanf.c: Ditto.

----
Index: newlib/newlib/libc/machine/spu/Makefile.am
===================================================================
--- newlib.orig/newlib/libc/machine/spu/Makefile.am
+++ newlib/newlib/libc/machine/spu/Makefile.am
@@ -17,7 +17,9 @@ lib_a_SOURCES = setjmp.S memcpy.c memmov
 	printf.c scanf.c vprintf.c vscanf.c \
 	setbuf.c setvbuf.c tmpfile.c \
 	sprintf.c sscanf.c snprintf.c vsscanf.c vsnprintf.c vsprintf.c \
-	remove.c rename.c tmpnam.c
+	remove.c rename.c tmpnam.c \
+	iprintf.c fiprintf.c siprintf.c sniprintf.c viprintf.c vfiprintf.c vsiprintf.c vsniprintf.c \
+	iscanf.c fiscanf.c siscanf.c viscanf.c vfiscanf.c vsiscanf.c
 
 lib_a_CCASFLAGS = $(AM_CCASFLAGS)
 lib_a_CFLAGS = $(AM_CFLAGS)
Index: newlib/newlib/libc/machine/spu/Makefile.in
===================================================================
--- newlib.orig/newlib/libc/machine/spu/Makefile.in
+++ newlib/newlib/libc/machine/spu/Makefile.in
@@ -71,6 +71,13 @@ DIST_COMMON = $(srcdir)/../../../../conf
 	$(srcdir)/../../../../compile $(srcdir)/../../../../compile \
 	$(srcdir)/../../../../compile $(srcdir)/../../../../compile \
 	$(srcdir)/../../../../compile $(srcdir)/../../../../compile \
+	$(srcdir)/../../../../compile $(srcdir)/../../../../compile \
+	$(srcdir)/../../../../compile $(srcdir)/../../../../compile \
+	$(srcdir)/../../../../compile $(srcdir)/../../../../compile \
+	$(srcdir)/../../../../compile $(srcdir)/../../../../compile \
+	$(srcdir)/../../../../compile $(srcdir)/../../../../compile \
+	$(srcdir)/../../../../compile $(srcdir)/../../../../compile \
+	$(srcdir)/../../../../compile $(srcdir)/../../../../compile \
 	$(srcdir)/../../../../compile $(srcdir)/../../../../compile
 subdir = .
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
@@ -118,7 +125,14 @@ am_lib_a_OBJECTS = lib_a-setjmp.$(OBJEXT
 	lib_a-snprintf.$(OBJEXT) lib_a-vsscanf.$(OBJEXT) \
 	lib_a-vsnprintf.$(OBJEXT) lib_a-vsprintf.$(OBJEXT) \
 	lib_a-remove.$(OBJEXT) lib_a-rename.$(OBJEXT) \
-	lib_a-tmpnam.$(OBJEXT)
+	lib_a-tmpnam.$(OBJEXT) lib_a-iprintf.$(OBJEXT) \
+	lib_a-fiprintf.$(OBJEXT) lib_a-siprintf.$(OBJEXT) \
+	lib_a-sniprintf.$(OBJEXT) lib_a-viprintf.$(OBJEXT) \
+	lib_a-vfiprintf.$(OBJEXT) lib_a-vsiprintf.$(OBJEXT) \
+	lib_a-vsniprintf.$(OBJEXT) lib_a-iscanf.$(OBJEXT) \
+	lib_a-fiscanf.$(OBJEXT) lib_a-siscanf.$(OBJEXT) \
+	lib_a-viscanf.$(OBJEXT) lib_a-vfiscanf.$(OBJEXT) \
+	lib_a-vsiscanf.$(OBJEXT)
 lib_a_OBJECTS = $(am_lib_a_OBJECTS)
 DEFAULT_INCLUDES = -I. -I$(srcdir)
 depcomp =
@@ -252,7 +266,9 @@ lib_a_SOURCES = setjmp.S memcpy.c memmov
 	printf.c scanf.c vprintf.c vscanf.c \
 	setbuf.c setvbuf.c tmpfile.c \
 	sprintf.c sscanf.c snprintf.c vsscanf.c vsnprintf.c vsprintf.c \
-	remove.c rename.c tmpnam.c
+	remove.c rename.c tmpnam.c \
+	iprintf.c fiprintf.c siprintf.c sniprintf.c viprintf.c vfiprintf.c vsiprintf.c vsniprintf.c \
+	iscanf.c fiscanf.c siscanf.c viscanf.c vfiscanf.c vsiscanf.c
 
 lib_a_CCASFLAGS = $(AM_CCASFLAGS)
 lib_a_CFLAGS = $(AM_CFLAGS)
@@ -710,6 +726,90 @@ lib_a-tmpnam.o: tmpnam.c
 
 lib_a-tmpnam.obj: tmpnam.c
 	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-tmpnam.obj `if test -f 'tmpnam.c'; then $(CYGPATH_W) 'tmpnam.c'; else $(CYGPATH_W) '$(srcdir)/tmpnam.c'; fi`
+
+lib_a-iprintf.o: iprintf.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-iprintf.o `test -f 'iprintf.c' || echo '$(srcdir)/'`iprintf.c
+
+lib_a-iprintf.obj: iprintf.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-iprintf.obj `if test -f 'iprintf.c'; then $(CYGPATH_W) 'iprintf.c'; else $(CYGPATH_W) '$(srcdir)/iprintf.c'; fi`
+
+lib_a-fiprintf.o: fiprintf.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fiprintf.o `test -f 'fiprintf.c' || echo '$(srcdir)/'`fiprintf.c
+
+lib_a-fiprintf.obj: fiprintf.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fiprintf.obj `if test -f 'fiprintf.c'; then $(CYGPATH_W) 'fiprintf.c'; else $(CYGPATH_W) '$(srcdir)/fiprintf.c'; fi`
+
+lib_a-siprintf.o: siprintf.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-siprintf.o `test -f 'siprintf.c' || echo '$(srcdir)/'`siprintf.c
+
+lib_a-siprintf.obj: siprintf.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-siprintf.obj `if test -f 'siprintf.c'; then $(CYGPATH_W) 'siprintf.c'; else $(CYGPATH_W) '$(srcdir)/siprintf.c'; fi`
+
+lib_a-sniprintf.o: sniprintf.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-sniprintf.o `test -f 'sniprintf.c' || echo '$(srcdir)/'`sniprintf.c
+
+lib_a-sniprintf.obj: sniprintf.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-sniprintf.obj `if test -f 'sniprintf.c'; then $(CYGPATH_W) 'sniprintf.c'; else $(CYGPATH_W) '$(srcdir)/sniprintf.c'; fi`
+
+lib_a-viprintf.o: viprintf.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-viprintf.o `test -f 'viprintf.c' || echo '$(srcdir)/'`viprintf.c
+
+lib_a-viprintf.obj: viprintf.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-viprintf.obj `if test -f 'viprintf.c'; then $(CYGPATH_W) 'viprintf.c'; else $(CYGPATH_W) '$(srcdir)/viprintf.c'; fi`
+
+lib_a-vfiprintf.o: vfiprintf.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-vfiprintf.o `test -f 'vfiprintf.c' || echo '$(srcdir)/'`vfiprintf.c
+
+lib_a-vfiprintf.obj: vfiprintf.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-vfiprintf.obj `if test -f 'vfiprintf.c'; then $(CYGPATH_W) 'vfiprintf.c'; else $(CYGPATH_W) '$(srcdir)/vfiprintf.c'; fi`
+
+lib_a-vsiprintf.o: vsiprintf.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-vsiprintf.o `test -f 'vsiprintf.c' || echo '$(srcdir)/'`vsiprintf.c
+
+lib_a-vsiprintf.obj: vsiprintf.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-vsiprintf.obj `if test -f 'vsiprintf.c'; then $(CYGPATH_W) 'vsiprintf.c'; else $(CYGPATH_W) '$(srcdir)/vsiprintf.c'; fi`
+
+lib_a-vsniprintf.o: vsniprintf.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-vsniprintf.o `test -f 'vsniprintf.c' || echo '$(srcdir)/'`vsniprintf.c
+
+lib_a-vsniprintf.obj: vsniprintf.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-vsniprintf.obj `if test -f 'vsniprintf.c'; then $(CYGPATH_W) 'vsniprintf.c'; else $(CYGPATH_W) '$(srcdir)/vsniprintf.c'; fi`
+
+lib_a-iscanf.o: iscanf.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-iscanf.o `test -f 'iscanf.c' || echo '$(srcdir)/'`iscanf.c
+
+lib_a-iscanf.obj: iscanf.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-iscanf.obj `if test -f 'iscanf.c'; then $(CYGPATH_W) 'iscanf.c'; else $(CYGPATH_W) '$(srcdir)/iscanf.c'; fi`
+
+lib_a-fiscanf.o: fiscanf.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fiscanf.o `test -f 'fiscanf.c' || echo '$(srcdir)/'`fiscanf.c
+
+lib_a-fiscanf.obj: fiscanf.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fiscanf.obj `if test -f 'fiscanf.c'; then $(CYGPATH_W) 'fiscanf.c'; else $(CYGPATH_W) '$(srcdir)/fiscanf.c'; fi`
+
+lib_a-siscanf.o: siscanf.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-siscanf.o `test -f 'siscanf.c' || echo '$(srcdir)/'`siscanf.c
+
+lib_a-siscanf.obj: siscanf.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-siscanf.obj `if test -f 'siscanf.c'; then $(CYGPATH_W) 'siscanf.c'; else $(CYGPATH_W) '$(srcdir)/siscanf.c'; fi`
+
+lib_a-viscanf.o: viscanf.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-viscanf.o `test -f 'viscanf.c' || echo '$(srcdir)/'`viscanf.c
+
+lib_a-viscanf.obj: viscanf.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-viscanf.obj `if test -f 'viscanf.c'; then $(CYGPATH_W) 'viscanf.c'; else $(CYGPATH_W) '$(srcdir)/viscanf.c'; fi`
+
+lib_a-vfiscanf.o: vfiscanf.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-vfiscanf.o `test -f 'vfiscanf.c' || echo '$(srcdir)/'`vfiscanf.c
+
+lib_a-vfiscanf.obj: vfiscanf.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-vfiscanf.obj `if test -f 'vfiscanf.c'; then $(CYGPATH_W) 'vfiscanf.c'; else $(CYGPATH_W) '$(srcdir)/vfiscanf.c'; fi`
+
+lib_a-vsiscanf.o: vsiscanf.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-vsiscanf.o `test -f 'vsiscanf.c' || echo '$(srcdir)/'`vsiscanf.c
+
+lib_a-vsiscanf.obj: vsiscanf.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-vsiscanf.obj `if test -f 'vsiscanf.c'; then $(CYGPATH_W) 'vsiscanf.c'; else $(CYGPATH_W) '$(srcdir)/vsiscanf.c'; fi`
 uninstall-info-am:
 
 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
Index: newlib/newlib/libc/machine/spu/fiprintf.c
===================================================================
--- /dev/null
+++ newlib/newlib/libc/machine/spu/fiprintf.c
@@ -0,0 +1,2 @@
+#define INTEGER_ONLY
+#include "fprintf.c"
Index: newlib/newlib/libc/machine/spu/fiscanf.c
===================================================================
--- /dev/null
+++ newlib/newlib/libc/machine/spu/fiscanf.c
@@ -0,0 +1,2 @@
+#define INTEGER_ONLY
+#include "fscanf.c"
Index: newlib/newlib/libc/machine/spu/iprintf.c
===================================================================
--- /dev/null
+++ newlib/newlib/libc/machine/spu/iprintf.c
@@ -0,0 +1,2 @@
+#define INTEGER_ONLY
+#include "printf.c"
Index: newlib/newlib/libc/machine/spu/iscanf.c
===================================================================
--- /dev/null
+++ newlib/newlib/libc/machine/spu/iscanf.c
@@ -0,0 +1,2 @@
+#define INTEGER_ONLY
+#include "scanf.c"
Index: newlib/newlib/libc/machine/spu/siprintf.c
===================================================================
--- /dev/null
+++ newlib/newlib/libc/machine/spu/siprintf.c
@@ -0,0 +1,2 @@
+#define INTEGER_ONLY
+#include "sprintf.c"
Index: newlib/newlib/libc/machine/spu/siscanf.c
===================================================================
--- /dev/null
+++ newlib/newlib/libc/machine/spu/siscanf.c
@@ -0,0 +1,2 @@
+#define INTEGER_ONLY
+#include "sscanf.c"
Index: newlib/newlib/libc/machine/spu/sniprintf.c
===================================================================
--- /dev/null
+++ newlib/newlib/libc/machine/spu/sniprintf.c
@@ -0,0 +1,2 @@
+#define INTEGER_ONLY
+#include "snprintf.c"
Index: newlib/newlib/libc/machine/spu/vfiprintf.c
===================================================================
--- /dev/null
+++ newlib/newlib/libc/machine/spu/vfiprintf.c
@@ -0,0 +1,2 @@
+#define INTEGER_ONLY
+#include "vfprintf.c"
Index: newlib/newlib/libc/machine/spu/vfiscanf.c
===================================================================
--- /dev/null
+++ newlib/newlib/libc/machine/spu/vfiscanf.c
@@ -0,0 +1,2 @@
+#define INTEGER_ONLY
+#include "vfscanf.c"
Index: newlib/newlib/libc/machine/spu/viprintf.c
===================================================================
--- /dev/null
+++ newlib/newlib/libc/machine/spu/viprintf.c
@@ -0,0 +1,2 @@
+#define INTEGER_ONLY
+#include "vprintf.c"
Index: newlib/newlib/libc/machine/spu/viscanf.c
===================================================================
--- /dev/null
+++ newlib/newlib/libc/machine/spu/viscanf.c
@@ -0,0 +1,2 @@
+#define INTEGER_ONLY
+#include "vscanf.c"
Index: newlib/newlib/libc/machine/spu/vsiprintf.c
===================================================================
--- /dev/null
+++ newlib/newlib/libc/machine/spu/vsiprintf.c
@@ -0,0 +1,2 @@
+#define INTEGER_ONLY
+#include "vsprintf.c"
Index: newlib/newlib/libc/machine/spu/vsiscanf.c
===================================================================
--- /dev/null
+++ newlib/newlib/libc/machine/spu/vsiscanf.c
@@ -0,0 +1,2 @@
+#define INTEGER_ONLY
+#include "vsscanf.c"
Index: newlib/newlib/libc/machine/spu/vsniprintf.c
===================================================================
--- /dev/null
+++ newlib/newlib/libc/machine/spu/vsniprintf.c
@@ -0,0 +1,2 @@
+#define INTEGER_ONLY
+#include "vsnprintf.c"
Index: newlib/newlib/libc/machine/spu/fprintf.c
===================================================================
--- newlib.orig/newlib/libc/machine/spu/fprintf.c
+++ newlib/newlib/libc/machine/spu/fprintf.c
@@ -41,6 +41,10 @@ Author: Joel Schopp <jschopp@austin.ibm.
 #include <varargs.h>
 #endif
 
+#ifdef INTEGER_ONLY
+#  define fprintf fiprintf
+#endif
+
 typedef struct
 {
   int fp;
Index: newlib/newlib/libc/machine/spu/fscanf.c
===================================================================
--- newlib.orig/newlib/libc/machine/spu/fscanf.c
+++ newlib/newlib/libc/machine/spu/fscanf.c
@@ -41,6 +41,10 @@ Author: Joel Schopp <jschopp@austin.ibm.
 #include <varargs.h>
 #endif
 
+#ifdef INTEGER_ONLY
+#  define fscanf fiscanf
+#endif
+
 typedef struct
 {
   int fp;
Index: newlib/newlib/libc/machine/spu/printf.c
===================================================================
--- newlib.orig/newlib/libc/machine/spu/printf.c
+++ newlib/newlib/libc/machine/spu/printf.c
@@ -9,6 +9,10 @@
 #include <varargs.h>
 #endif
 
+#ifdef INTEGER_ONLY
+#  define printf iprintf
+#endif
+
 typedef struct
 {
   _CONST char* fmt;
Index: newlib/newlib/libc/machine/spu/scanf.c
===================================================================
--- newlib.orig/newlib/libc/machine/spu/scanf.c
+++ newlib/newlib/libc/machine/spu/scanf.c
@@ -41,6 +41,10 @@ Author: Joel Schopp <jschopp@austin.ibm.
 #include <varargs.h>
 #endif
 
+#ifdef INTEGER_ONLY
+#  define scanf iscanf
+#endif
+
 typedef struct
 {
   _CONST char* fmt;
Index: newlib/newlib/libc/machine/spu/snprintf.c
===================================================================
--- newlib.orig/newlib/libc/machine/spu/snprintf.c
+++ newlib/newlib/libc/machine/spu/snprintf.c
@@ -41,6 +41,10 @@ Author: Joel Schopp <jschopp@austin.ibm.
 #include <varargs.h>
 #endif
 
+#ifdef INTEGER_ONLY
+#  define snprintf sniprintf
+#endif
+
 typedef struct
 {
   char* str;
Index: newlib/newlib/libc/machine/spu/sprintf.c
===================================================================
--- newlib.orig/newlib/libc/machine/spu/sprintf.c
+++ newlib/newlib/libc/machine/spu/sprintf.c
@@ -41,6 +41,10 @@ Author: Joel Schopp <jschopp@austin.ibm.
 #include <varargs.h>
 #endif
 
+#ifdef INTEGER_ONLY
+#  define sprintf siprintf
+#endif
+
 typedef struct
 {
   char* str;
Index: newlib/newlib/libc/machine/spu/sscanf.c
===================================================================
--- newlib.orig/newlib/libc/machine/spu/sscanf.c
+++ newlib/newlib/libc/machine/spu/sscanf.c
@@ -41,6 +41,10 @@ Author: Joel Schopp <jschopp@austin.ibm.
 #include <varargs.h>
 #endif
 
+#ifdef INTEGER_ONLY
+#  define sscanf siscanf
+#endif
+
 typedef struct
 {
   _CONST char* str;
Index: newlib/newlib/libc/machine/spu/vfprintf.c
===================================================================
--- newlib.orig/newlib/libc/machine/spu/vfprintf.c
+++ newlib/newlib/libc/machine/spu/vfprintf.c
@@ -41,6 +41,10 @@ Author: Joel Schopp <jschopp@austin.ibm.
 #include <varargs.h>
 #endif
 
+#ifdef INTEGER_ONLY
+#  define vfprintf vfiprintf
+#endif
+
 typedef struct
 {
   int fp;
Index: newlib/newlib/libc/machine/spu/vfscanf.c
===================================================================
--- newlib.orig/newlib/libc/machine/spu/vfscanf.c
+++ newlib/newlib/libc/machine/spu/vfscanf.c
@@ -41,6 +41,10 @@ Author: Joel Schopp <jschopp@austin.ibm.
 #include <varargs.h>
 #endif
 
+#ifdef INTEGER_ONLY
+#  define vfscanf vfiscanf
+#endif
+
 typedef struct
 {
   int fp;
Index: newlib/newlib/libc/machine/spu/vprintf.c
===================================================================
--- newlib.orig/newlib/libc/machine/spu/vprintf.c
+++ newlib/newlib/libc/machine/spu/vprintf.c
@@ -9,6 +9,10 @@
 #include <varargs.h>
 #endif
 
+#ifdef INTEGER_ONLY
+#  define vprintf viprintf
+#endif
+
 typedef struct
 {
   _CONST char* fmt;
Index: newlib/newlib/libc/machine/spu/vscanf.c
===================================================================
--- newlib.orig/newlib/libc/machine/spu/vscanf.c
+++ newlib/newlib/libc/machine/spu/vscanf.c
@@ -41,6 +41,10 @@ Author: Joel Schopp <jschopp@austin.ibm.
 #include <varargs.h>
 #endif
 
+#ifdef INTEGER_ONLY
+#  define vscanf viscanf
+#endif
+
 typedef struct
 {
   char* fmt;
Index: newlib/newlib/libc/machine/spu/vsnprintf.c
===================================================================
--- newlib.orig/newlib/libc/machine/spu/vsnprintf.c
+++ newlib/newlib/libc/machine/spu/vsnprintf.c
@@ -9,6 +9,10 @@
 #include <varargs.h>
 #endif
 
+#ifdef INTEGER_ONLY
+#  define vsnprintf vsniprintf
+#endif
+
 typedef struct
 {
   char* str;
Index: newlib/newlib/libc/machine/spu/vsprintf.c
===================================================================
--- newlib.orig/newlib/libc/machine/spu/vsprintf.c
+++ newlib/newlib/libc/machine/spu/vsprintf.c
@@ -10,6 +10,10 @@
 #include <varargs.h>
 #endif
 
+#ifdef INTEGER_ONLY
+#  define vsprintf vsiprintf
+#endif
+
 typedef struct
 {
   char *str;
Index: newlib/newlib/libc/machine/spu/vsscanf.c
===================================================================
--- newlib.orig/newlib/libc/machine/spu/vsscanf.c
+++ newlib/newlib/libc/machine/spu/vsscanf.c
@@ -41,6 +41,10 @@ Author: Joel Schopp <jschopp@austin.ibm.
 #include <varargs.h>
 #endif
 
+#ifdef INTEGER_ONLY
+#  define vsscanf vsiscanf
+#endif
+
 typedef struct
 {
   _CONST char *str;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]