From c9ed03fc4bb52c0fcf5144f385b19599b7f5bfca Mon Sep 17 00:00:00 2001 From: George Rhoten Date: Sat, 15 Mar 2003 01:57:10 +0000 Subject: [PATCH] ICU-2744 Fix some IRIX problems X-SVN-Rev: 11329 --- icu4c/source/common/rbbidata.cpp | 36 ++++++++-------- icu4c/source/common/rbbiscan.cpp | 3 +- icu4c/source/common/rbbisetb.cpp | 72 ++++++++++++++++---------------- icu4c/source/common/unistr.cpp | 16 +++---- 4 files changed, 62 insertions(+), 65 deletions(-) diff --git a/icu4c/source/common/rbbidata.cpp b/icu4c/source/common/rbbidata.cpp index bd9b10c5d28..d21bd1fb4fb 100644 --- a/icu4c/source/common/rbbidata.cpp +++ b/icu4c/source/common/rbbidata.cpp @@ -21,6 +21,23 @@ #include "uassert.h" +//----------------------------------------------------------------------------------- +// +// Trie access folding function. Copied as-is from properties code in uchar.c +// +//----------------------------------------------------------------------------------- +U_CDECL_BEGIN +static int32_t U_CALLCONV +getFoldingOffset(uint32_t data) { + /* if bit 15 is set, then the folding offset is in bits 14..0 of the 16-bit trie result */ + if(data&0x8000) { + return (int32_t)(data&0x7fff); + } else { + return 0; + } +} +U_CDECL_END + U_NAMESPACE_BEGIN //----------------------------------------------------------------------------- @@ -39,25 +56,6 @@ RBBIDataWrapper::RBBIDataWrapper(UDataMemory* udm, UErrorCode &status) { fUDataMem = udm; } - - -//----------------------------------------------------------------------------------- -// -// Trie access folding function. Copied as-is from properties code in uchar.c -// -//----------------------------------------------------------------------------------- -U_CDECL_BEGIN -static int32_t U_CALLCONV -getFoldingOffset(uint32_t data) { - /* if bit 15 is set, then the folding offset is in bits 14..0 of the 16-bit trie result */ - if(data&0x8000) { - return (int32_t)(data&0x7fff); - } else { - return 0; - } -} -U_CDECL_END - //----------------------------------------------------------------------------- // // init(). Does most of the work of construction, shared between the diff --git a/icu4c/source/common/rbbiscan.cpp b/icu4c/source/common/rbbiscan.cpp index 0902b544f5b..8793d49b4a5 100644 --- a/icu4c/source/common/rbbiscan.cpp +++ b/icu4c/source/common/rbbiscan.cpp @@ -36,8 +36,6 @@ #include "uassert.h" -U_NAMESPACE_BEGIN - //---------------------------------------------------------------------------------------- // // Unicode Set init strings for each of the character classes needed for parsing a rule file. @@ -81,6 +79,7 @@ static void U_EXPORT2 U_CALLCONV RBBISetTable_deleter(void *p) { } U_CDECL_END +U_NAMESPACE_BEGIN //---------------------------------------------------------------------------------------- // diff --git a/icu4c/source/common/rbbisetb.cpp b/icu4c/source/common/rbbisetb.cpp index cc0da963a37..4030ce6c8db 100644 --- a/icu4c/source/common/rbbisetb.cpp +++ b/icu4c/source/common/rbbisetb.cpp @@ -43,6 +43,42 @@ #include "rbbinode.h" +//------------------------------------------------------------------------ +// +// getFoldedRBBIValue Call-back function used during building of Trie table. +// Folding value: just store the offset (16 bits) +// if there is any non-0 entry. +// (It'd really be nice if the Trie builder would provide a +// simple default, so this function could go away from here.) +// +//------------------------------------------------------------------------ +/* folding value: just store the offset (16 bits) if there is any non-0 entry */ +U_CDECL_BEGIN +static uint32_t U_CALLCONV +getFoldedRBBIValue(UNewTrie *trie, UChar32 start, int32_t offset) { + uint32_t value; + UChar32 limit; + UBool inBlockZero; + + limit=start+0x400; + while(startcharAt(offset); +} +U_CDECL_END + U_NAMESPACE_BEGIN const char UnicodeString::fgClassID=0; @@ -556,14 +564,6 @@ UnicodeString UnicodeString::unescape() const { return result; } -// u_unescapeAt() callback to get a UChar from a UnicodeString -U_CDECL_BEGIN -static UChar U_CALLCONV -UnicodeString_charAt(int32_t offset, void *context) { - return ((UnicodeString*) context)->charAt(offset); -} -U_CDECL_END - UChar32 UnicodeString::unescapeAt(int32_t &offset) const { return u_unescapeAt(UnicodeString_charAt, &offset, length(), (void*)this); }