diff options
author | Karl Berry <karl@freefriends.org> | 2011-06-18 23:33:11 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2011-06-18 23:33:11 +0000 |
commit | 83d4b5c0e6e4e88f2a9eea5c21774c05c0f3d4f1 (patch) | |
tree | 26ce50d9b084e41171dbcd67d238369157e01380 /Build/source/libs/icu | |
parent | e51e79e0fa5d6c4461ce15248e7a226c8954f338 (diff) |
revert LESwaps.h to ICU 4.4 to avoid complete BigEndian failure
git-svn-id: svn://tug.org/texlive/trunk@23048 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/libs/icu')
-rw-r--r-- | Build/source/libs/icu/icu-4.6-PATCHES/ChangeLog | 7 | ||||
-rw-r--r-- | Build/source/libs/icu/icu-4.6-PATCHES/patch-40-LESwaps | 63 | ||||
-rw-r--r-- | Build/source/libs/icu/icu-4.6/layout/LESwaps.h | 23 |
3 files changed, 82 insertions, 11 deletions
diff --git a/Build/source/libs/icu/icu-4.6-PATCHES/ChangeLog b/Build/source/libs/icu/icu-4.6-PATCHES/ChangeLog index f58ff44d434..0ddaac14114 100644 --- a/Build/source/libs/icu/icu-4.6-PATCHES/ChangeLog +++ b/Build/source/libs/icu/icu-4.6-PATCHES/ChangeLog @@ -1,3 +1,10 @@ +2011-06-19 Karl Berry <karl@tug.org> + + * patch-40-LESwaps: revert to ICU 4.4, as 4.6 code + is broken on BigEndian machines. + http://bugs.icu-project.org/trac/ticket/8657 + tlbuild mail, 17 Jun 2011 17:10:38 + 2011-05-11 Peter Breitenlohner <peb@mppmu.mpg.de> * patch-14-GENCCODE_ASSEMBLY (new): For amd64-kfreebsd. diff --git a/Build/source/libs/icu/icu-4.6-PATCHES/patch-40-LESwaps b/Build/source/libs/icu/icu-4.6-PATCHES/patch-40-LESwaps new file mode 100644 index 00000000000..edc5adb1fd4 --- /dev/null +++ b/Build/source/libs/icu/icu-4.6-PATCHES/patch-40-LESwaps @@ -0,0 +1,63 @@ +Index: LESwaps.h +=================================================================== +--- LESwaps.h (revision 23041) ++++ LESwaps.h (working copy) +@@ -1,6 +1,7 @@ ++ + /* + * +- * (C) Copyright IBM Corp. 1998-2010 - All Rights Reserved ++ * (C) Copyright IBM Corp. 1998-2008 - All Rights Reserved + * + */ + +@@ -22,7 +23,7 @@ + * + * @stable ICU 2.8 + */ +-#define SWAPW(value) LESwaps::swapWord((le_uint16)(value)) ++#define SWAPW(value) LESwaps::swapWord((const le_uint16 &) (value)) + + /** + * A convenience macro which invokes the swapLong member function +@@ -30,7 +31,7 @@ + * + * @stable ICU 2.8 + */ +-#define SWAPL(value) LESwaps::swapLong((le_uint32)(value)) ++#define SWAPL(value) LESwaps::swapLong((const le_uint32 &) (value)) + + /** + * This class is used to access data which stored in big endian order +@@ -54,9 +55,11 @@ + * + * @stable ICU 2.8 + */ +- static le_uint16 swapWord(le_uint16 value) ++ static le_uint16 swapWord(const le_uint16 &value) + { +- return (le_uint16)((value << 8) | (value >> 8)); ++ const le_uint8 *p = (const le_uint8 *) &value; ++ ++ return ((p[0] << 8) + p[1]); + }; + + /** +@@ -69,13 +72,11 @@ + * + * @stable ICU 2.8 + */ +- static le_uint32 swapLong(le_uint32 value) ++ static le_uint32 swapLong(const le_uint32 &value) + { +- return (le_uint32)( +- (value << 24) | +- ((value << 8) & 0xff0000) | +- ((value >> 8) & 0xff00) | +- (value >> 24)); ++ const le_uint8 *p = (const le_uint8 *) &value; ++ ++ return ((p[0] << 24) + (p[1] << 16) + (p[2] << 8) + p[3]); + }; + + private: diff --git a/Build/source/libs/icu/icu-4.6/layout/LESwaps.h b/Build/source/libs/icu/icu-4.6/layout/LESwaps.h index 489a9ae449d..5309139d673 100644 --- a/Build/source/libs/icu/icu-4.6/layout/LESwaps.h +++ b/Build/source/libs/icu/icu-4.6/layout/LESwaps.h @@ -1,6 +1,7 @@ + /* * - * (C) Copyright IBM Corp. 1998-2010 - All Rights Reserved + * (C) Copyright IBM Corp. 1998-2008 - All Rights Reserved * */ @@ -22,7 +23,7 @@ U_NAMESPACE_BEGIN * * @stable ICU 2.8 */ -#define SWAPW(value) LESwaps::swapWord((le_uint16)(value)) +#define SWAPW(value) LESwaps::swapWord((const le_uint16 &) (value)) /** * A convenience macro which invokes the swapLong member function @@ -30,7 +31,7 @@ U_NAMESPACE_BEGIN * * @stable ICU 2.8 */ -#define SWAPL(value) LESwaps::swapLong((le_uint32)(value)) +#define SWAPL(value) LESwaps::swapLong((const le_uint32 &) (value)) /** * This class is used to access data which stored in big endian order @@ -54,9 +55,11 @@ public: * * @stable ICU 2.8 */ - static le_uint16 swapWord(le_uint16 value) + static le_uint16 swapWord(const le_uint16 &value) { - return (le_uint16)((value << 8) | (value >> 8)); + const le_uint8 *p = (const le_uint8 *) &value; + + return ((p[0] << 8) + p[1]); }; /** @@ -69,13 +72,11 @@ public: * * @stable ICU 2.8 */ - static le_uint32 swapLong(le_uint32 value) + static le_uint32 swapLong(const le_uint32 &value) { - return (le_uint32)( - (value << 24) | - ((value << 8) & 0xff0000) | - ((value >> 8) & 0xff00) | - (value >> 24)); + const le_uint8 *p = (const le_uint8 *) &value; + + return ((p[0] << 24) + (p[1] << 16) + (p[2] << 8) + p[3]); }; private: |