Gentoo Archives: gentoo-commits

From: "Tomas Chvatal (scarabeus)" <scarabeus@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in dev-libs/icu/files: icu-4.8.1-fix_ltr.patch
Date: Mon, 27 Feb 2012 16:19:46
Message-Id: 20120227161935.EDD3F2004C@flycatcher.gentoo.org
1 scarabeus 12/02/27 16:19:35
2
3 Added: icu-4.8.1-fix_ltr.patch
4 Log:
5 Add patch to fix ltr ligatures issue. Wrt bug#405143.
6
7 (Portage version: 2.2.0_alpha89/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.1 dev-libs/icu/files/icu-4.8.1-fix_ltr.patch
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/icu/files/icu-4.8.1-fix_ltr.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/icu/files/icu-4.8.1-fix_ltr.patch?rev=1.1&content-type=text/plain
14
15 Index: icu-4.8.1-fix_ltr.patch
16 ===================================================================
17 --- release-4-8-1/source/layout/LESwaps.h 2011-10-07 06:52:16.240688181 +0300
18 +++ release-4-8/source/layout/LESwaps.h 2011-10-07 05:56:26.915499700 +0300
19 @@ -45,8 +45,8 @@
20 public:
21
22 /**
23 - * Reads a big-endian 16-bit word and returns a native-endian value.
24 - * No-op on a big-endian platform, byte-swaps on a little-endian platform.
25 + * This method does the byte swap required on little endian platforms
26 + * to correctly access a (16-bit) word.
27 *
28 * @param value - the word to be byte swapped
29 *
30 @@ -56,19 +56,12 @@
31 */
32 static le_uint16 swapWord(le_uint16 value)
33 {
34 -#if (defined(U_IS_BIG_ENDIAN) && U_IS_BIG_ENDIAN) || (defined(BYTE_ORDER) && defined(BIG_ENDIAN)) || defined(__BIG_ENDIAN__)
35 - // Fastpath when we know that the platform is big-endian.
36 - return value;
37 -#else
38 - // Reads a big-endian value on any platform.
39 - const le_uint8 *p = reinterpret_cast<const le_uint8 *>(&value);
40 - return (le_uint16)((p[0] << 8) | p[1]);
41 -#endif
42 + return (le_uint16)((value << 8) | (value >> 8));
43 };
44
45 /**
46 - * Reads a big-endian 32-bit word and returns a native-endian value.
47 - * No-op on a big-endian platform, byte-swaps on a little-endian platform.
48 + * This method does the byte swapping required on little endian platforms
49 + * to correctly access a (32-bit) long.
50 *
51 * @param value - the long to be byte swapped
52 *
53 @@ -78,14 +71,11 @@
54 */
55 static le_uint32 swapLong(le_uint32 value)
56 {
57 -#if (defined(U_IS_BIG_ENDIAN) && U_IS_BIG_ENDIAN) || (defined(BYTE_ORDER) && defined(BIG_ENDIAN)) || defined(__BIG_ENDIAN__)
58 - // Fastpath when we know that the platform is big-endian.
59 - return value;
60 -#else
61 - // Reads a big-endian value on any platform.
62 - const le_uint8 *p = reinterpret_cast<const le_uint8 *>(&value);
63 - return (le_uint32)((p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3]);
64 -#endif
65 + return (le_uint32)(
66 + (value << 24) |
67 + ((value << 8) & 0xff0000) |
68 + ((value >> 8) & 0xff00) |
69 + (value >> 24));
70 };
71
72 private: