Piotr Caban : msvcp90: Added collate<char>::do_hash implementation.

Alexandre Julliard julliard at winehq.org
Tue Dec 20 13:43:26 CST 2011


Module: wine
Branch: master
Commit: 0e8d13b82c69c1c50b927afa8e9e1554458cf931
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=0e8d13b82c69c1c50b927afa8e9e1554458cf931

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Tue Dec 20 15:57:19 2011 +0100

msvcp90: Added collate<char>::do_hash implementation.

---

 dlls/msvcp90/locale.c       |   15 +++++++++++----
 dlls/msvcp90/msvcp90.h      |    8 ++++++++
 dlls/msvcp90/msvcp90_main.c |    9 +++++++++
 3 files changed, 28 insertions(+), 4 deletions(-)

diff --git a/dlls/msvcp90/locale.c b/dlls/msvcp90/locale.c
index ec2f5d5..7b0fa5f 100644
--- a/dlls/msvcp90/locale.c
+++ b/dlls/msvcp90/locale.c
@@ -777,11 +777,18 @@ int __thiscall collate_char_compare(const collate *this, const char *first1,
 /* ?do_hash@?$collate at D@std@@MBEJPBD0 at Z */
 /* ?do_hash@?$collate at D@std@@MEBAJPEBD0 at Z */
 DEFINE_THISCALL_WRAPPER(collate_char_do_hash, 12)
+#define call_collate_char_do_hash(this, first, last) CALL_VTBL_FUNC(this, 12, LONG, \
+        (const collate*, const char*, const char*), (this, first, last))
 LONG __thiscall collate_char_do_hash(const collate *this,
         const char *first, const char *last)
 {
-    FIXME("(%p %p %p) stub\n", this, first, last);
-    return 0;
+    ULONG ret = 0;
+
+    TRACE("(%p %p %p)\n", this, first, last);
+
+    for(; first<last; first++)
+        ret = (ret<<8 | ret>>24) + *first;
+    return ret;
 }
 
 /* ?hash@?$collate at D@std@@QBEJPBD0 at Z */
@@ -790,8 +797,8 @@ DEFINE_THISCALL_WRAPPER(collate_char_hash, 12)
 LONG __thiscall collate_char_hash(const collate *this,
         const char *first, const char *last)
 {
-    FIXME("(%p %p %p) stub\n", this, first, last);
-    return 0;
+    TRACE("(%p %p %p)\n", this, first, last);
+    return call_collate_char_do_hash(this, first, last);
 }
 
 /* ?do_transform@?$collate at D@std@@MBE?AV?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@2 at PBD0@Z */
diff --git a/dlls/msvcp90/msvcp90.h b/dlls/msvcp90/msvcp90.h
index 23254af..63350fc 100644
--- a/dlls/msvcp90/msvcp90.h
+++ b/dlls/msvcp90/msvcp90.h
@@ -136,6 +136,14 @@ const rtti_object_locator name ## _rtti = { \
 
 extern void *vtbl_wrapper_0;
 extern void *vtbl_wrapper_4;
+extern void *vtbl_wrapper_12;
+extern void *vtbl_wrapper_16;
+extern void *vtbl_wrapper_20;
+extern void *vtbl_wrapper_24;
+extern void *vtbl_wrapper_28;
+extern void *vtbl_wrapper_32;
+extern void *vtbl_wrapper_36;
+extern void *vtbl_wrapper_40;
 
 #else
 
diff --git a/dlls/msvcp90/msvcp90_main.c b/dlls/msvcp90/msvcp90_main.c
index f27ac0c..ac29af9 100644
--- a/dlls/msvcp90/msvcp90_main.c
+++ b/dlls/msvcp90/msvcp90_main.c
@@ -40,6 +40,15 @@ WINE_DEFAULT_DEBUG_CHANNEL(msvcp90);
 
 DEFINE_VTBL_WRAPPER(0);
 DEFINE_VTBL_WRAPPER(4);
+DEFINE_VTBL_WRAPPER(8);
+DEFINE_VTBL_WRAPPER(12);
+DEFINE_VTBL_WRAPPER(16);
+DEFINE_VTBL_WRAPPER(20);
+DEFINE_VTBL_WRAPPER(24);
+DEFINE_VTBL_WRAPPER(28);
+DEFINE_VTBL_WRAPPER(32);
+DEFINE_VTBL_WRAPPER(36);
+DEFINE_VTBL_WRAPPER(40);
 
 #endif
 




More information about the wine-cvs mailing list