OSDN Git Service
(root)
/
android-x86
/
external-mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f7d1689
)
translate: Fix translate_key_compare().
author
Michal Krol
<michal@vmware.com>
Tue, 29 Dec 2009 21:49:31 +0000
(22:49 +0100)
committer
Michal Krol
<michal@vmware.com>
Tue, 29 Dec 2009 21:49:31 +0000
(22:49 +0100)
Sizes of translate keys must also match.
src/gallium/auxiliary/translate/translate.h
patch
|
blob
|
history
diff --git
a/src/gallium/auxiliary/translate/translate.h
b/src/gallium/auxiliary/translate/translate.h
index
34526eb
..
1afdf19
100644
(file)
--- a/
src/gallium/auxiliary/translate/translate.h
+++ b/
src/gallium/auxiliary/translate/translate.h
@@
-103,8
+103,13
@@
static INLINE int translate_keysize( const struct translate_key *key )
static INLINE int translate_key_compare( const struct translate_key *a,
const struct translate_key *b )
{
- int keysize = translate_keysize(a);
- return memcmp(a, b, keysize);
+ int keysize_a = translate_keysize(a);
+ int keysize_b = translate_keysize(b);
+
+ if (keysize_a != keysize_b) {
+ return keysize_a - keysize_b;
+ }
+ return memcmp(a, b, keysize_a);
}