Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
f70ddf76
Commit
f70ddf76
authored
Mar 23, 2015
by
Nikolay Sivov
Committed by
Alexandre Julliard
Mar 23, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
scrrun: Support BYREF types for integer keys.
parent
94a1838b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
3 deletions
+40
-3
dictionary.c
dlls/scrrun/dictionary.c
+6
-3
dictionary.c
dlls/scrrun/tests/dictionary.c
+34
-0
No files found.
dlls/scrrun/dictionary.c
View file @
f70ddf76
...
...
@@ -795,14 +795,17 @@ static HRESULT WINAPI dictionary_get_HashVal(IDictionary *iface, VARIANT *key, V
case
VT_BSTR
:
V_I4
(
hash
)
=
get_str_hash
(
get_key_strptr
(
key
),
This
->
method
);
break
;
case
VT_UI1
|
VT_BYREF
:
case
VT_UI1
:
V_I4
(
hash
)
=
get_num_hash
(
V_UI1
(
key
));
V_I4
(
hash
)
=
get_num_hash
(
V_
VT
(
key
)
&
VT_BYREF
?
*
V_UI1REF
(
key
)
:
V_
UI1
(
key
));
break
;
case
VT_I2
|
VT_BYREF
:
case
VT_I2
:
V_I4
(
hash
)
=
get_num_hash
(
V_I2
(
key
));
V_I4
(
hash
)
=
get_num_hash
(
V_
VT
(
key
)
&
VT_BYREF
?
*
V_I2REF
(
key
)
:
V_
I2
(
key
));
break
;
case
VT_I4
|
VT_BYREF
:
case
VT_I4
:
V_I4
(
hash
)
=
get_num_hash
(
V_I4
(
key
));
V_I4
(
hash
)
=
get_num_hash
(
V_
VT
(
key
)
&
VT_BYREF
?
*
V_I4REF
(
key
)
:
V_
I4
(
key
));
break
;
case
VT_UNKNOWN
|
VT_BYREF
:
case
VT_DISPATCH
|
VT_BYREF
:
...
...
dlls/scrrun/tests/dictionary.c
View file @
f70ddf76
...
...
@@ -429,6 +429,10 @@ static void test_hash_value(void)
ok
(
V_I4
(
&
hash
)
==
~
0u
,
"got hash 0x%08x
\n
"
,
V_I4
(
&
hash
));
for
(
i
=
0
;
i
<
sizeof
(
int_hash_tests
)
/
sizeof
(
int_hash_tests
[
0
]);
i
++
)
{
SHORT
i2
;
BYTE
ui1
;
LONG
i4
;
expected
=
get_num_hash
(
int_hash_tests
[
i
]);
V_VT
(
&
key
)
=
VT_I2
;
...
...
@@ -440,6 +444,16 @@ static void test_hash_value(void)
ok
(
V_I4
(
&
hash
)
==
expected
,
"%d: got hash 0x%08x, expected 0x%08x
\n
"
,
i
,
V_I4
(
&
hash
),
expected
);
i2
=
int_hash_tests
[
i
];
V_VT
(
&
key
)
=
VT_I2
|
VT_BYREF
;
V_I2REF
(
&
key
)
=
&
i2
;
VariantInit
(
&
hash
);
hr
=
IDictionary_get_HashVal
(
dict
,
&
key
,
&
hash
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
V_VT
(
&
hash
)
==
VT_I4
,
"got %d
\n
"
,
V_VT
(
&
hash
));
ok
(
V_I4
(
&
hash
)
==
expected
,
"%d: got hash 0x%08x, expected 0x%08x
\n
"
,
i
,
V_I4
(
&
hash
),
expected
);
V_VT
(
&
key
)
=
VT_I4
;
V_I4
(
&
key
)
=
int_hash_tests
[
i
];
VariantInit
(
&
hash
);
...
...
@@ -449,6 +463,16 @@ static void test_hash_value(void)
ok
(
V_I4
(
&
hash
)
==
expected
,
"%d: got hash 0x%08x, expected 0x%08x
\n
"
,
i
,
V_I4
(
&
hash
),
expected
);
i4
=
int_hash_tests
[
i
];
V_VT
(
&
key
)
=
VT_I4
|
VT_BYREF
;
V_I4REF
(
&
key
)
=
&
i4
;
VariantInit
(
&
hash
);
hr
=
IDictionary_get_HashVal
(
dict
,
&
key
,
&
hash
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
V_VT
(
&
hash
)
==
VT_I4
,
"got %d
\n
"
,
V_VT
(
&
hash
));
ok
(
V_I4
(
&
hash
)
==
expected
,
"%d: got hash 0x%08x, expected 0x%08x
\n
"
,
i
,
V_I4
(
&
hash
),
expected
);
expected
=
get_num_hash
((
FLOAT
)(
BYTE
)
int_hash_tests
[
i
]);
V_VT
(
&
key
)
=
VT_UI1
;
V_UI1
(
&
key
)
=
int_hash_tests
[
i
];
...
...
@@ -458,6 +482,16 @@ static void test_hash_value(void)
ok
(
V_VT
(
&
hash
)
==
VT_I4
,
"got %d
\n
"
,
V_VT
(
&
hash
));
ok
(
V_I4
(
&
hash
)
==
expected
,
"%d: got hash 0x%08x, expected 0x%08x
\n
"
,
i
,
V_I4
(
&
hash
),
expected
);
ui1
=
int_hash_tests
[
i
];
V_VT
(
&
key
)
=
VT_UI1
|
VT_BYREF
;
V_UI1REF
(
&
key
)
=
&
ui1
;
VariantInit
(
&
hash
);
hr
=
IDictionary_get_HashVal
(
dict
,
&
key
,
&
hash
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
V_VT
(
&
hash
)
==
VT_I4
,
"got %d
\n
"
,
V_VT
(
&
hash
));
ok
(
V_I4
(
&
hash
)
==
expected
,
"%d: got hash 0x%08x, expected 0x%08x
\n
"
,
i
,
V_I4
(
&
hash
),
expected
);
}
/* nan */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment