[3/6] msvcirt: Forward signed char exports to char functions directly

Iván Matellanes matellanesivan at gmail.com
Thu Jul 21 04:56:52 CDT 2016


signed char and char are equivalent in Visual C++, so specific functions for signed char are unnecessary.

Signed-off-by: Iván Matellanes <matellanes.ivan at gmail.com>
---
 dlls/msvcirt/msvcirt.c    | 44 ++++++++++++++++----------------------------
 dlls/msvcirt/msvcirt.spec | 24 ++++++++++++------------
 2 files changed, 28 insertions(+), 40 deletions(-)

diff --git a/dlls/msvcirt/msvcirt.c b/dlls/msvcirt/msvcirt.c
index 7ea6541..78917f8 100644
--- a/dlls/msvcirt/msvcirt.c
+++ b/dlls/msvcirt/msvcirt.c
@@ -2458,10 +2458,12 @@ void __thiscall ostream_osfx(ostream *this)
     ios_unlock(base);
 }
 
+/* ?put at ostream@@QAEAAV1 at C@Z */
+/* ?put at ostream@@QEAAAEAV1 at C@Z */
 /* ?put at ostream@@QAEAAV1 at D@Z */
 /* ?put at ostream@@QEAAAEAV1 at D@Z */
-DEFINE_THISCALL_WRAPPER(ostream_put_char, 8)
-ostream* __thiscall ostream_put_char(ostream *this, char c)
+DEFINE_THISCALL_WRAPPER(ostream_put, 8)
+ostream* __thiscall ostream_put(ostream *this, char c)
 {
     ios *base = ostream_get_ios(this);
 
@@ -2475,20 +2477,12 @@ ostream* __thiscall ostream_put_char(ostream *this, char c)
     return this;
 }
 
-/* ?put at ostream@@QAEAAV1 at C@Z */
-/* ?put at ostream@@QEAAAEAV1 at C@Z */
-DEFINE_THISCALL_WRAPPER(ostream_put_signed_char, 8)
-ostream* __thiscall ostream_put_signed_char(ostream *this, signed char c)
-{
-    return ostream_put_char(this, (char) c);
-}
-
 /* ?put at ostream@@QAEAAV1 at E@Z */
 /* ?put at ostream@@QEAAAEAV1 at E@Z */
-DEFINE_THISCALL_WRAPPER(ostream_put_unsigned_char, 8)
-ostream* __thiscall ostream_put_unsigned_char(ostream *this, unsigned char c)
+DEFINE_THISCALL_WRAPPER(ostream_put_unsigned, 8)
+ostream* __thiscall ostream_put_unsigned(ostream *this, unsigned char c)
 {
-    return ostream_put_char(this, (char) c);
+    return ostream_put(this, c);
 }
 
 /* ?seekp at ostream@@QAEAAV1 at J@Z */
@@ -2540,10 +2534,12 @@ streampos __thiscall ostream_tellp(ostream *this)
     return pos;
 }
 
+/* ?write at ostream@@QAEAAV1 at PBCH@Z */
+/* ?write at ostream@@QEAAAEAV1 at PEBCH@Z */
 /* ?write at ostream@@QAEAAV1 at PBDH@Z */
 /* ?write at ostream@@QEAAAEAV1 at PEBDH@Z */
-DEFINE_THISCALL_WRAPPER(ostream_write_char, 12)
-ostream* __thiscall ostream_write_char(ostream *this, const char *str, int count)
+DEFINE_THISCALL_WRAPPER(ostream_write, 12)
+ostream* __thiscall ostream_write(ostream *this, const char *str, int count)
 {
     ios *base = ostream_get_ios(this);
 
@@ -2557,20 +2553,12 @@ ostream* __thiscall ostream_write_char(ostream *this, const char *str, int count
     return this;
 }
 
-/* ?write at ostream@@QAEAAV1 at PBCH@Z */
-/* ?write at ostream@@QEAAAEAV1 at PEBCH@Z */
-DEFINE_THISCALL_WRAPPER(ostream_write_signed_char, 12)
-ostream* __thiscall ostream_write_signed_char(ostream *this, const signed char *str, int count)
-{
-    return ostream_write_char(this, (const char*) str, count);
-}
-
 /* ?write at ostream@@QAEAAV1 at PBEH@Z */
 /* ?write at ostream@@QEAAAEAV1 at PEBEH@Z */
-DEFINE_THISCALL_WRAPPER(ostream_write_unsigned_char, 12)
-ostream* __thiscall ostream_write_unsigned_char(ostream *this, const unsigned char *str, int count)
+DEFINE_THISCALL_WRAPPER(ostream_write_unsigned, 12)
+ostream* __thiscall ostream_write_unsigned(ostream *this, const unsigned char *str, int count)
 {
-    return ostream_write_char(this, (const char*) str, count);
+    return ostream_write(this, (const char*) str, count);
 }
 
 /* ?writepad at ostream@@AAEAAV1 at PBD0@Z */
@@ -2858,7 +2846,7 @@ ostream* __thiscall ostream_print_ios_manip(ostream *this, ios* (__cdecl *func)(
 ostream* __cdecl ostream_endl(ostream *this)
 {
    TRACE("(%p)\n", this);
-   ostream_put_char(this, '\n');
+   ostream_put(this, '\n');
    return ostream_flush(this);
 }
 
@@ -2867,7 +2855,7 @@ ostream* __cdecl ostream_endl(ostream *this)
 ostream* __cdecl ostream_ends(ostream *this)
 {
    TRACE("(%p)\n", this);
-   return ostream_put_char(this, 0);
+   return ostream_put(this, 0);
 }
 
 /* ?flush@@YAAAVostream@@AAV1@@Z */
diff --git a/dlls/msvcirt/msvcirt.spec b/dlls/msvcirt/msvcirt.spec
index 74dde53..0a92096 100644
--- a/dlls/msvcirt/msvcirt.spec
+++ b/dlls/msvcirt/msvcirt.spec
@@ -603,12 +603,12 @@
 @ cdecl -arch=win64 ?precision at ios@@QEAAHH at Z(ptr long) ios_precision_set
 @ thiscall -arch=win32 ?precision at ios@@QBEHXZ(ptr) ios_precision_get
 @ cdecl -arch=win64 ?precision at ios@@QEBAHXZ(ptr) ios_precision_get
-@ thiscall -arch=win32 ?put at ostream@@QAEAAV1 at C@Z(ptr long) ostream_put_signed_char
-@ cdecl -arch=win64 ?put at ostream@@QEAAAEAV1 at C@Z(ptr long) ostream_put_signed_char
-@ thiscall -arch=win32 ?put at ostream@@QAEAAV1 at D@Z(ptr long) ostream_put_char
-@ cdecl -arch=win64 ?put at ostream@@QEAAAEAV1 at D@Z(ptr long) ostream_put_char
-@ thiscall -arch=win32 ?put at ostream@@QAEAAV1 at E@Z(ptr long) ostream_put_unsigned_char
-@ cdecl -arch=win64 ?put at ostream@@QEAAAEAV1 at E@Z(ptr long) ostream_put_unsigned_char
+@ thiscall -arch=win32 ?put at ostream@@QAEAAV1 at C@Z(ptr long) ostream_put
+@ cdecl -arch=win64 ?put at ostream@@QEAAAEAV1 at C@Z(ptr long) ostream_put
+@ thiscall -arch=win32 ?put at ostream@@QAEAAV1 at D@Z(ptr long) ostream_put
+@ cdecl -arch=win64 ?put at ostream@@QEAAAEAV1 at D@Z(ptr long) ostream_put
+@ thiscall -arch=win32 ?put at ostream@@QAEAAV1 at E@Z(ptr long) ostream_put_unsigned
+@ cdecl -arch=win64 ?put at ostream@@QEAAAEAV1 at E@Z(ptr long) ostream_put_unsigned
 @ thiscall -arch=win32 ?putback at istream@@QAEAAV1 at D@Z(ptr long) istream_putback
 @ cdecl -arch=win64 ?putback at istream@@QEAAAEAV1 at D@Z(ptr long) istream_putback
 @ thiscall -arch=win32 ?pword at ios@@QBEAAPAXH at Z(ptr long) ios_pword
@@ -766,12 +766,12 @@
 @ cdecl -arch=win64 ?width at ios@@QEAAHH at Z(ptr long) ios_width_set
 @ thiscall -arch=win32 ?width at ios@@QBEHXZ(ptr) ios_width_get
 @ cdecl -arch=win64 ?width at ios@@QEBAHXZ(ptr) ios_width_get
-@ thiscall -arch=win32 ?write at ostream@@QAEAAV1 at PBCH@Z(ptr str long) ostream_write_signed_char
-@ cdecl -arch=win64 ?write at ostream@@QEAAAEAV1 at PEBCH@Z(ptr str long) ostream_write_signed_char
-@ thiscall -arch=win32 ?write at ostream@@QAEAAV1 at PBDH@Z(ptr str long) ostream_write_char
-@ cdecl -arch=win64 ?write at ostream@@QEAAAEAV1 at PEBDH@Z(ptr str long) ostream_write_char
-@ thiscall -arch=win32 ?write at ostream@@QAEAAV1 at PBEH@Z(ptr str long) ostream_write_unsigned_char
-@ cdecl -arch=win64 ?write at ostream@@QEAAAEAV1 at PEBEH@Z(ptr str long) ostream_write_unsigned_char
+@ thiscall -arch=win32 ?write at ostream@@QAEAAV1 at PBCH@Z(ptr str long) ostream_write
+@ cdecl -arch=win64 ?write at ostream@@QEAAAEAV1 at PEBCH@Z(ptr str long) ostream_write
+@ thiscall -arch=win32 ?write at ostream@@QAEAAV1 at PBDH@Z(ptr str long) ostream_write
+@ cdecl -arch=win64 ?write at ostream@@QEAAAEAV1 at PEBDH@Z(ptr str long) ostream_write
+@ thiscall -arch=win32 ?write at ostream@@QAEAAV1 at PBEH@Z(ptr str long) ostream_write_unsigned
+@ cdecl -arch=win64 ?write at ostream@@QEAAAEAV1 at PEBEH@Z(ptr str long) ostream_write_unsigned
 @ thiscall -arch=win32 ?writepad at ostream@@AAEAAV1 at PBD0@Z(ptr str str) ostream_writepad
 @ cdecl -arch=win64 ?writepad at ostream@@AEAAAEAV1 at PEBD0@Z(ptr str str) ostream_writepad
 @ cdecl -arch=win32 ?ws@@YAAAVistream@@AAV1@@Z(ptr) istream_ws
-- 
2.7.4




More information about the wine-patches mailing list