Author: greatlrd
Date: Wed Jun 7 04:04:51 2006
New Revision: 22260
URL:
http://svn.reactos.ru/svn/reactos?rev=22260&view=rev
Log:
Implement %Fp now we have 25 fails with wine test for string version of *printf api
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=22260…
==============================================================================
--- trunk/reactos/lib/rtl/sprintf.c (original)
+++ trunk/reactos/lib/rtl/sprintf.c Wed Jun 7 04:04:51 2006
@@ -26,7 +26,7 @@
#define LEFT 16 /* left justified */
#define SPECIAL 32 /* 0x */
#define LARGE 64 /* use 'ABCDEF' instead of 'abcdef' */
-
+#define REMOVEHEX 256 /* use 256 as remve 0x frim BASE 16 */
typedef struct {
unsigned int mantissal:32;
unsigned int mantissah:20;
@@ -116,7 +116,7 @@
}
}
- if (type & SPECIAL) {
+ if ((type & SPECIAL) && ((type & REMOVEHEX) == 0)) {
if (base == 16)
size -= 2;
@@ -142,7 +142,7 @@
++buf;
}
- if (type & SPECIAL) {
+ if ((type & SPECIAL) && ((type & REMOVEHEX) == 0)) {
if (base==16) {
if (buf <= end)
*buf = '0';
@@ -213,7 +213,7 @@
size--;
}
}
- if (type & SPECIAL) {
+ if (type & SPECIAL) {
if (base == 16)
size -= 2;
else if (base == 8)
@@ -470,7 +470,10 @@
} else if (*fmt == 'I' && *(fmt+1) == '3' && *(fmt+2)
== '2') {
qualifier = 'l';
fmt += 3;
- }
+ } else if (*fmt == 'F' && *(fmt+1) == 'p') {
+ fmt += 1;
+ flags |= REMOVEHEX;
+ }
/* default base */
base = 10;
Modified: trunk/reactos/lib/rtl/swprintf.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/lib/rtl/swprintf.c?rev=2226…
==============================================================================
--- trunk/reactos/lib/rtl/swprintf.c (original)
+++ trunk/reactos/lib/rtl/swprintf.c Wed Jun 7 04:04:51 2006
@@ -26,7 +26,7 @@
#define LEFT 16 /* left justified */
#define SPECIAL 32 /* 0x */
#define LARGE 64 /* use 'ABCDEF' instead of 'abcdef' */
-
+#define REMOVEHEX 256 /* use 256 as remve 0x frim BASE 16 */
typedef struct {
unsigned int mantissal:32;
unsigned int mantissah:20;
@@ -116,7 +116,7 @@
}
}
- if (type & SPECIAL) {
+ if ((type & SPECIAL) && ((type & REMOVEHEX) == 0)) {
if (base == 16)
size -= 2;
}
@@ -141,7 +141,7 @@
++buf;
}
- if (type & SPECIAL) {
+ if ((type & SPECIAL) && ((type & REMOVEHEX) == 0)) {
if (base==16) {
if (buf <= end)
*buf = L'0';
@@ -468,7 +468,10 @@
} else if (*fmt == L'I' && *(fmt+1) == L'3' && *(fmt+2)
== L'2') {
qualifier = L'l';
fmt += 3;
- }
+ } else if (*fmt == L'F' && *(fmt+1) == L'p') {
+ fmt += 1;
+ flags |= REMOVEHEX;
+ }
/* default base */
base = 10;
@@ -566,8 +569,7 @@
case L'p':
if ((flags & LARGE) == 0)
- flags |= LARGE;
-
+ flags |= LARGE;
if (field_width == -1) {
field_width = 2*sizeof(void *);
flags |= ZEROPAD;