diff options
author | Sergei Trofimovich <slyfox@gentoo.org> | 2017-07-30 23:15:45 +0100 |
---|---|---|
committer | Sergei Trofimovich <slyfox@gentoo.org> | 2017-07-30 23:15:55 +0100 |
commit | fef415c56f13404c0ec5501d26012eaf9ca34292 (patch) | |
tree | 23f87d0a5da9b37b1b7d7bd9150482ae4e68f360 /media-sound/xmms2/files | |
parent | media-libs/qimageblitz: Drop old (diff) | |
download | gentoo-fef415c56f13404c0ec5501d26012eaf9ca34292.tar.gz gentoo-fef415c56f13404c0ec5501d26012eaf9ca34292.tar.bz2 gentoo-fef415c56f13404c0ec5501d26012eaf9ca34292.zip |
media-sound/xmms2: fix hash computation on big-endian platforms
Was manifested as a single test failure in xmms2.
Package-Manager: Portage-2.3.6, Repoman-2.3.3
Diffstat (limited to 'media-sound/xmms2/files')
-rw-r--r-- | media-sound/xmms2/files/xmms2-0.8_p20161122-be-hash.patch | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/media-sound/xmms2/files/xmms2-0.8_p20161122-be-hash.patch b/media-sound/xmms2/files/xmms2-0.8_p20161122-be-hash.patch new file mode 100644 index 000000000000..5fa43298cf7f --- /dev/null +++ b/media-sound/xmms2/files/xmms2-0.8_p20161122-be-hash.patch @@ -0,0 +1,39 @@ +From d97c8b8239e8b3c5ddb951d427b7d78ea7faad25 Mon Sep 17 00:00:00 2001 +From: Sergei Trofimovich <slyfox@gentoo.org> +Date: Sun, 30 Jul 2017 23:08:02 +0100 +Subject: [PATCH] OTHER: _xmmsv_dict_hash: make hash function + endianness-agnostic + +The following code: + uint32_t k; + memcpy (&k, data, sizeof (k)); +computes different data depending on platform endianness. + +That causes test_xmmsv_serialize_coll_match test to fail +as collection order is serialized in wrong order. + +Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> +--- + src/lib/xmmstypes/xmmsv_dict.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/src/lib/xmmstypes/xmmsv_dict.c b/src/lib/xmmstypes/xmmsv_dict.c +index 5ebe4eb3..32533285 100644 +--- a/src/lib/xmmstypes/xmmsv_dict.c ++++ b/src/lib/xmmstypes/xmmsv_dict.c +@@ -66,8 +66,10 @@ _xmmsv_dict_hash (const void *key, int len) + + while (len >= 4) + { +- uint32_t k; +- memcpy (&k, data, sizeof (k)); ++ uint32_t k = data [0] ++ | data [1] << 8 ++ | data [2] << 16 ++ | data [3] << 24; + + k *= m; + k ^= k >> r; +-- +2.13.3 + |