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':
Author: greatlrd
Date: Sun May 28 05:32:32 2006
New Revision: 22082
URL: http://svn.reactos.ru/svn/reactos?rev=22082&view=rev
Log:
making one more wine msvcrt printf test pass
now it is 62 fails instead of 63 fails
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=22082…
==============================================================================
--- trunk/reactos/lib/rtl/sprintf.c (original)
+++ trunk/reactos/lib/rtl/sprintf.c Sun May 28 05:32:32 2006
@@ -506,7 +506,7 @@
{
/* don't write out a null byte if the buf size is zero */
//*end = '\0';
- if (str-buf >=cnt )
+ if (str-buf >cnt )
{
*end = '\0';
}
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 05:32:32 2006
@@ -504,7 +504,7 @@
{
/* don't write out a null byte if the buf size is zero */
//*end = '\0';
- if (str-buf >=cnt )
+ if (str-buf >cnt )
{
*end = L'\0';
}
Author: greatlrd
Date: Sun May 28 04:51:16 2006
New Revision: 22081
URL: http://svn.reactos.ru/svn/reactos?rev=22081&view=rev
Log:
fixing two hiden bug in reactos, null termante the string right at end, code tested in vs, but it seam no affact on wine test mscvrt printf test. What hell is the snprintf function call to ??
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=22081…
==============================================================================
--- trunk/reactos/lib/rtl/sprintf.c (original)
+++ trunk/reactos/lib/rtl/sprintf.c Sun May 28 04:51:16 2006
@@ -253,6 +253,8 @@
number of chars for from string */
int qualifier; /* 'h', 'l', 'L', 'I' or 'w' for integer fields */
+ /* clear the string buffer with zero so we do not need NULL terment it at end */
+
str = buf;
end = buf + cnt - 1;
if (end < buf - 1) {
@@ -501,8 +503,20 @@
if (str <= end)
*str = '\0';
else if (cnt > 0)
+ {
/* don't write out a null byte if the buf size is zero */
- *end = '\0';
+ //*end = '\0';
+ if (str-buf >=cnt )
+ {
+ *end = '\0';
+ }
+ else
+ {
+ end++;
+ *end = '\0';
+ }
+
+ }
return str-buf;
}
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 04:51:16 2006
@@ -500,9 +500,21 @@
}
if (str <= end)
*str = L'\0';
- else if (cnt > 0)
+ else if (cnt > 0)
+ {
/* don't write out a null byte if the buf size is zero */
- *end = L'\0';
+ //*end = '\0';
+ if (str-buf >=cnt )
+ {
+ *end = L'\0';
+ }
+ else
+ {
+ end++;
+ *end = L'\0';
+ }
+
+ }
return str-buf;
}
Author: greatlrd
Date: Sat May 27 19:32:22 2006
New Revision: 22079
URL: http://svn.reactos.ru/svn/reactos?rev=22079&view=rev
Log:
[AUDIT] this file is clean, and well document where it comes from, so no sign of trace was notice in this file
Modified:
trunk/reactos/lib/crt/io/open.c (props changed)
Propchange: trunk/reactos/lib/crt/io/open.c
------------------------------------------------------------------------------
--- svn:needs-lock (original)
+++ svn:needs-lock (removed)
@@ -1,1 +1,0 @@
-*