annotate target-utils/libprintf/sprintf.c @ 573:976aeaa2e6e1

gsm-fw/L1/include/l1_pwmgr.h: L1_PWMGR_APP_OFFSET definition needed for l1_trace.c to compile
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Mon, 11 Aug 2014 01:46:50 +0000
parents 40f607bb0a2c
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
4
5c7b3d5d5702 libprintf compiles with Anshit C GCC
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 3
diff changeset
6 sprintf(char *strdest, char *fmt, ...)
3
45bf8af5f061 libprintf brought in from older PPC/m68k code, but fucking GCC
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
7 {
45bf8af5f061 libprintf brought in from older PPC/m68k code, but fucking GCC
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
8 va_list ap;
45bf8af5f061 libprintf brought in from older PPC/m68k code, but fucking GCC
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
9 char *strptr;
45bf8af5f061 libprintf brought in from older PPC/m68k code, but fucking GCC
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
10 int len;
45bf8af5f061 libprintf brought in from older PPC/m68k code, but fucking GCC
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
11
4
5c7b3d5d5702 libprintf compiles with Anshit C GCC
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 3
diff changeset
12 strptr = strdest;
5c7b3d5d5702 libprintf compiles with Anshit C GCC
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 3
diff changeset
13 va_start(ap, fmt);
3
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);
4
5c7b3d5d5702 libprintf compiles with Anshit C GCC
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 3
diff changeset
15 va_end(ap);
3
45bf8af5f061 libprintf brought in from older PPC/m68k code, but fucking GCC
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
16 *strptr = '\0';
45bf8af5f061 libprintf brought in from older PPC/m68k code, but fucking GCC
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
17 return(len);
45bf8af5f061 libprintf brought in from older PPC/m68k code, but fucking GCC
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
18 }