Author: greatlrd
Date: Sun May 28 08:58:27 2006
New Revision: 22083
URL:
http://svn.reactos.ru/svn/reactos?rev=22083&view=rev
Log:
starteted implement float into sprintf, snprintf and alot other printf api. this is more
like a start how to implement it. This commit is more market for me. so I do not forget
where string functions of *printf api (the main api functions) are. One more thing if u
change on sprintf.c same change must be done in swprintf.c or changes into swprintf.c same
changes must be done in swprintf.c, other wise the efect of bugfix or change will not be
excutected in reactos, for u do not know if program pic the ansi or unicode version.
Modified:
trunk/reactos/lib/rtl/sprintf.c
trunk/reactos/lib/rtl/swprintf.c
Modified: trunk/reactos/lib/rtl/sprintf.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/lib/rtl/sprintf.c?rev=22083…
==============================================================================
--- trunk/reactos/lib/rtl/sprintf.c (original)
+++ trunk/reactos/lib/rtl/sprintf.c Sun May 28 08:58:27 2006
@@ -241,6 +241,8 @@
{
int len;
unsigned long long num;
+ double _double;
+
int base;
char *str, *end;
const char *s;
@@ -258,7 +260,7 @@
str = buf;
end = buf + cnt - 1;
if (end < buf - 1) {
- end = ((void *) -1);
+ end = ((char *) -1);
cnt = end - buf + 1;
}
@@ -441,6 +443,17 @@
*ip = (str - buf);
}
continue;
+
+ /* float number formats - set up the flags and "break" */
+ case 'e':
+ case 'E':
+ case 'f':
+ case 'g':
+ case 'G':
+ _double = (double)va_arg(args, double);
+ str = number(str, end, (int)_double, base, field_width, precision, flags);
+ continue;
+
/* integer number formats - set up the flags and "break" */
case 'o':
Modified: trunk/reactos/lib/rtl/swprintf.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/lib/rtl/swprintf.c?rev=2208…
==============================================================================
--- trunk/reactos/lib/rtl/swprintf.c (original)
+++ trunk/reactos/lib/rtl/swprintf.c Sun May 28 08:58:27 2006
@@ -245,6 +245,7 @@
wchar_t * str, * end;
const char *s;
const wchar_t *sw;
+ double _double;
int flags; /* flags to number() */
@@ -256,7 +257,7 @@
str = buf;
end = buf + cnt - 1;
if (end < buf - 1) {
- end = ((void *) -1);
+ end = ((wchar_t *) -1);
cnt = end - buf + 1;
}
@@ -439,6 +440,16 @@
*ip = (str - buf);
}
continue;
+ /* float number formats - set up the flags and "break" */
+ case 'e':
+ case 'E':
+ case 'f':
+ case 'g':
+ case 'G':
+ _double = (double)va_arg(args, double);
+ str = number(str, end, (int)_double, base, field_width, precision, flags);
+ continue;
+
/* integer number formats - set up the flags and "break" */
case L'o':