Hi Alexandre,
On 10/04/16 22:49, GOUJON Alexandre wrote:
- MSVCRT_size_t hash = 0x811c9dc5;
MSVCRT_size_t hash;
MSVCRT_size_t fnvPrime; const char *p;
if(sizeof(void*) == sizeof(int))
{
hash = 0x811c9dc5;
fnvPrime = 0x1000193;
}
else
{
hash = 0xcbf29ce484222325;
fnvPrime = 0x100000001b3;
}
Please change name of fnvPrime variable to something like fnv_prime. Also you will need to initialize it using #ifdef, something like this should work: #ifdef _WIN64 MSVCRT_size_t hash = ... #else MSVCRT_size_t hash = ... #endif
- return hash ^ (hash >> 32);
This will also cause compilation warning during 32-bit compilation.
diff --git a/dlls/ucrtbase/tests/cpp.c b/dlls/ucrtbase/tests/cpp.c index 1a01fea..659269c 100644 --- a/dlls/ucrtbase/tests/cpp.c +++ b/dlls/ucrtbase/tests/cpp.c @@ -163,7 +163,7 @@ static void test___std_type_info(void) ti1.mangled[2] = 0; hash1 = p___std_type_info_hash(&ti1); #ifdef _WIN64
- todo_wine ok(hash1 == 0xcbf29ce44fd0bfc1, "hash = %p\n", (void*)hash1);
- ok(hash1 == 0xcbf29ce44fd0bfc1, "hash = %p\n", (void*)hash1);
And this.
Thanks, Piotr
Piotr Caban piotr.caban@gmail.com wrote:
- return hash ^ (hash >> 32);
This will also cause compilation warning during 32-bit compilation.
diff --git a/dlls/ucrtbase/tests/cpp.c b/dlls/ucrtbase/tests/cpp.c index 1a01fea..659269c 100644 --- a/dlls/ucrtbase/tests/cpp.c +++ b/dlls/ucrtbase/tests/cpp.c @@ -163,7 +163,7 @@ static void test___std_type_info(void) ti1.mangled[2] = 0; hash1 = p___std_type_info_hash(&ti1); #ifdef _WIN64
- todo_wine ok(hash1 == 0xcbf29ce44fd0bfc1, "hash = %p\n", (void*)hash1);
- ok(hash1 == 0xcbf29ce44fd0bfc1, "hash = %p\n", (void*)hash1);
And this.
This one can't cause a compilation warning since it's conditionally compiled.
On 10/05/16 10:57, Dmitry Timoshkov wrote:
Piotr Caban piotr.caban@gmail.com wrote:
- return hash ^ (hash >> 32);
This will also cause compilation warning during 32-bit compilation.
diff --git a/dlls/ucrtbase/tests/cpp.c b/dlls/ucrtbase/tests/cpp.c index 1a01fea..659269c 100644 --- a/dlls/ucrtbase/tests/cpp.c +++ b/dlls/ucrtbase/tests/cpp.c @@ -163,7 +163,7 @@ static void test___std_type_info(void) ti1.mangled[2] = 0; hash1 = p___std_type_info_hash(&ti1); #ifdef _WIN64
- todo_wine ok(hash1 == 0xcbf29ce44fd0bfc1, "hash = %p\n", (void*)hash1);
- ok(hash1 == 0xcbf29ce44fd0bfc1, "hash = %p\n", (void*)hash1);
And this.
This one can't cause a compilation warning since it's conditionally compiled.
I've thought about this one: if(sizeof(void*) == sizeof(int)) ok(hash1 == 0x40c5b8c, "hash = %p\n", (void*)hash1); + else + ok(hash1 == 0xaf63bc4c29620a60, "hash = %p\n", (void*)hash1);
On 10/05/2016 10:56 AM, Piotr Caban wrote:
<snip> Please change name of fnvPrime variable to something like fnv_prime. Also you will need to initialize it using #ifdef, something like this should work: #ifdef _WIN64 MSVCRT_size_t hash = ... #else MSVCRT_size_t hash = ... #endif <snip>
Done.
You used both #ifdef _WIN64 and if(sizeof(void*) == sizeof(int)) in the test but now I see the difference. I just sent another version.
Thanks for the feedback!