FreeCalypso > hg > freecalypso-sw
annotate target-utils/libprintf/vsprintf.c @ 146:4d629b6bbcfd
gsm-fw/sprintf: %f implemented, debug output looks correct
author | Michael Spacefalcon <msokolov@ivan.Harhan.ORG> |
---|---|
date | Thu, 14 Nov 2013 19:03:52 +0000 |
parents | 40f607bb0a2c |
children |
rev | line source |
---|---|
4
5c7b3d5d5702
libprintf compiles with Anshit C GCC
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
3
diff
changeset
|
1 #include <stdarg.h> |
3
45bf8af5f061
libprintf brought in from older PPC/m68k code, but fucking GCC
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2 |
45bf8af5f061
libprintf brought in from older PPC/m68k code, but fucking GCC
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3 extern void _sprintf_putchar(); |
45bf8af5f061
libprintf brought in from older PPC/m68k code, but fucking GCC
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
4 |
45bf8af5f061
libprintf brought in from older PPC/m68k code, but fucking GCC
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
5 int |
45bf8af5f061
libprintf brought in from older PPC/m68k code, but fucking GCC
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
6 vsprintf(str, fmt, ap) |
45bf8af5f061
libprintf brought in from older PPC/m68k code, but fucking GCC
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
7 va_list ap; |
45bf8af5f061
libprintf brought in from older PPC/m68k code, but fucking GCC
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
8 char *str, *fmt; |
45bf8af5f061
libprintf brought in from older PPC/m68k code, but fucking GCC
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
9 { |
45bf8af5f061
libprintf brought in from older PPC/m68k code, but fucking GCC
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
10 char *strptr; |
45bf8af5f061
libprintf brought in from older PPC/m68k code, but fucking GCC
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
11 int len; |
45bf8af5f061
libprintf brought in from older PPC/m68k code, but fucking GCC
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
12 |
45bf8af5f061
libprintf brought in from older PPC/m68k code, but fucking GCC
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
13 strptr = str; |
45bf8af5f061
libprintf brought in from older PPC/m68k code, but fucking GCC
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
14 len = _doprnt(fmt, ap, &_sprintf_putchar, &strptr); |
45bf8af5f061
libprintf brought in from older PPC/m68k code, but fucking GCC
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
15 *strptr = '\0'; |
45bf8af5f061
libprintf brought in from older PPC/m68k code, but fucking GCC
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
16 return(len); |
45bf8af5f061
libprintf brought in from older PPC/m68k code, but fucking GCC
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
17 } |