1 |
scarabeus 12/02/27 18:09:25 |
2 |
|
3 |
Added: icu-4.8.1.1-fix_ltr.patch |
4 |
Log: |
5 |
Ooops rebase the patch for 4.8.1.1. |
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.1-fix_ltr.patch |
11 |
|
12 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/icu/files/icu-4.8.1.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.1-fix_ltr.patch?rev=1.1&content-type=text/plain |
14 |
|
15 |
Index: icu-4.8.1.1-fix_ltr.patch |
16 |
=================================================================== |
17 |
diff -urN icu.old/source/layout/LESwaps.h icu/source/layout/LESwaps.h |
18 |
--- icu.old/source/layout/LESwaps.h 2012-02-27 19:04:13.090199788 +0100 |
19 |
+++ icu/source/layout/LESwaps.h 2012-02-27 19:07:02.046202727 +0100 |
20 |
@@ -45,8 +45,8 @@ |
21 |
public: |
22 |
|
23 |
/** |
24 |
- * Reads a big-endian 16-bit word and returns a native-endian value. |
25 |
- * No-op on a big-endian platform, byte-swaps on a little-endian platform. |
26 |
+ * This method does the byte swap required on little endian platforms |
27 |
+ * to correctly access a (16-bit) word. |
28 |
* |
29 |
* @param value - the word to be byte swapped |
30 |
* |
31 |
@@ -56,21 +56,12 @@ |
32 |
*/ |
33 |
static le_uint16 swapWord(le_uint16 value) |
34 |
{ |
35 |
-#if (defined(U_IS_BIG_ENDIAN) && U_IS_BIG_ENDIAN) || \ |
36 |
- (defined(BYTE_ORDER) && defined(BIG_ENDIAN) && (BYTE_ORDER == BIG_ENDIAN)) || \ |
37 |
- defined(__BIG_ENDIAN__) |
38 |
- // Fastpath when we know that the platform is big-endian. |
39 |
- return value; |
40 |
-#else |
41 |
- // Reads a big-endian value on any platform. |
42 |
- const le_uint8 *p = reinterpret_cast<const le_uint8 *>(&value); |
43 |
- return (le_uint16)((p[0] << 8) | p[1]); |
44 |
-#endif |
45 |
+ return (le_uint16)((value << 8) | (value >> 8)); |
46 |
}; |
47 |
|
48 |
/** |
49 |
- * Reads a big-endian 32-bit word and returns a native-endian value. |
50 |
- * No-op on a big-endian platform, byte-swaps on a little-endian platform. |
51 |
+ * This method does the byte swapping required on little endian platforms |
52 |
+ * to correctly access a (32-bit) long. |
53 |
* |
54 |
* @param value - the long to be byte swapped |
55 |
* |
56 |
@@ -80,16 +71,11 @@ |
57 |
*/ |
58 |
static le_uint32 swapLong(le_uint32 value) |
59 |
{ |
60 |
-#if (defined(U_IS_BIG_ENDIAN) && U_IS_BIG_ENDIAN) || \ |
61 |
- (defined(BYTE_ORDER) && defined(BIG_ENDIAN) && (BYTE_ORDER == BIG_ENDIAN)) || \ |
62 |
- defined(__BIG_ENDIAN__) |
63 |
- // Fastpath when we know that the platform is big-endian. |
64 |
- return value; |
65 |
-#else |
66 |
- // Reads a big-endian value on any platform. |
67 |
- const le_uint8 *p = reinterpret_cast<const le_uint8 *>(&value); |
68 |
- return (le_uint32)((p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3]); |
69 |
-#endif |
70 |
+ return (le_uint32)( |
71 |
+ (value << 24) | |
72 |
+ ((value << 8) & 0xff0000) | |
73 |
+ ((value >> 8) & 0xff00) | |
74 |
+ (value >> 24)); |
75 |
}; |
76 |
|
77 |
private: |