diff --git a/icu4c/source/common/ucase.h b/icu4c/source/common/ucase.h index 318def8246..999287ebab 100644 --- a/icu4c/source/common/ucase.h +++ b/icu4c/source/common/ucase.h @@ -41,7 +41,7 @@ U_CAPI void U_EXPORT2 ucase_close(UCaseProps *csp); -U_CAPI UCaseProps * U_EXPORT2 +U_CAPI const UCaseProps * U_EXPORT2 ucase_getSingleton(UErrorCode *pErrorCode); /** @@ -49,7 +49,7 @@ ucase_getSingleton(UErrorCode *pErrorCode); * This can be used when the real data is not available. * Using the dummy can reduce checks for available data after an initial failure. */ -U_CAPI UCaseProps * U_EXPORT2 +U_CAPI const UCaseProps * U_EXPORT2 ucase_getDummy(UErrorCode *pErrorCode); @@ -89,7 +89,7 @@ U_CAPI UChar32 U_EXPORT2 ucase_totitle(const UCaseProps *csp, UChar32 c); U_CAPI UChar32 U_EXPORT2 -ucase_fold(UCaseProps *csp, UChar32 c, uint32_t options); +ucase_fold(const UCaseProps *csp, UChar32 c, uint32_t options); /** * Adds all simple case mappings and the full case folding for c to sa, diff --git a/icu4c/source/common/uniset_props.cpp b/icu4c/source/common/uniset_props.cpp index 10079885c1..069c59fe2f 100644 --- a/icu4c/source/common/uniset_props.cpp +++ b/icu4c/source/common/uniset_props.cpp @@ -1402,7 +1402,7 @@ addCaseMapping(UnicodeSet &set, int32_t result, const UChar *full, UnicodeString UnicodeSet& UnicodeSet::closeOver(int32_t attribute) { if (attribute & (USET_CASE | USET_ADD_CASE_MAPPINGS)) { UErrorCode status = U_ZERO_ERROR; - UCaseProps *csp = ucase_getSingleton(&status); + const UCaseProps *csp = ucase_getSingleton(&status); if (U_SUCCESS(status)) { UnicodeSet foldSet(*this); UnicodeString str; diff --git a/icu4c/source/common/unistr_case.cpp b/icu4c/source/common/unistr_case.cpp index b14f35c788..8c56017a90 100644 --- a/icu4c/source/common/unistr_case.cpp +++ b/icu4c/source/common/unistr_case.cpp @@ -109,7 +109,7 @@ UnicodeString::caseMap(BreakIterator *titleIter, UErrorCode errorCode; errorCode = U_ZERO_ERROR; - UCaseProps *csp=ucase_getSingleton(&errorCode); + const UCaseProps *csp=ucase_getSingleton(&errorCode); if(U_FAILURE(errorCode)) { setToBogus(); return *this; diff --git a/icu4c/source/common/unormcmp.cpp b/icu4c/source/common/unormcmp.cpp index 106e8399b7..20e95b1469 100644 --- a/icu4c/source/common/unormcmp.cpp +++ b/icu4c/source/common/unormcmp.cpp @@ -138,7 +138,7 @@ unorm_cmpEquivFold(const UChar *s1, int32_t length1, const UChar *s2, int32_t length2, uint32_t options, UErrorCode *pErrorCode) { - UCaseProps *csp; + const UCaseProps *csp; /* current-level start/limit - s1/s2 as current */ const UChar *start1, *start2, *limit1, *limit2; diff --git a/icu4c/source/common/uprops.c b/icu4c/source/common/uprops.c index 20404066e6..1cb95c0d47 100644 --- a/icu4c/source/common/uprops.c +++ b/icu4c/source/common/uprops.c @@ -35,7 +35,7 @@ /* cleanup ------------------------------------------------------------------ */ -static UCaseProps *gCsp=NULL; +static const UCaseProps *gCsp=NULL; static UBiDiProps *gBdp=NULL; static UBool U_CALLCONV uprops_cleanup(void) { @@ -47,7 +47,7 @@ static UBool U_CALLCONV uprops_cleanup(void) { /* case mapping properties API ---------------------------------------------- */ /* get the UCaseProps singleton, or else its dummy, once and for all */ -static UCaseProps * +static const UCaseProps * getCaseProps() { /* * This lazy intialization with double-checked locking (without mutex protection for @@ -56,7 +56,7 @@ getCaseProps() { */ /* the initial check is performed by the GET_CASE_PROPS() macro */ - UCaseProps *csp; + const UCaseProps *csp; UErrorCode errorCode=U_ZERO_ERROR; csp=ucase_getSingleton(&errorCode); @@ -256,7 +256,7 @@ u_hasBinaryProperty(UChar32 c, UProperty which) { } else { if(column==UPROPS_SRC_CASE) { /* case mapping properties */ - UCaseProps *csp=GET_CASE_PROPS(); + const UCaseProps *csp=GET_CASE_PROPS(); if(csp==NULL) { return FALSE; } diff --git a/icu4c/source/common/ustr_imp.h b/icu4c/source/common/ustr_imp.h index 3b162e8ab2..1d3c11a05e 100644 --- a/icu4c/source/common/ustr_imp.h +++ b/icu4c/source/common/ustr_imp.h @@ -102,7 +102,7 @@ u_growBufferFromStatic(void *context, * @internal */ U_CFUNC int32_t -ustr_toLower(UCaseProps *csp, +ustr_toLower(const UCaseProps *csp, UChar *dest, int32_t destCapacity, const UChar *src, int32_t srcLength, const char *locale, @@ -112,7 +112,7 @@ ustr_toLower(UCaseProps *csp, * @internal */ U_CFUNC int32_t -ustr_toUpper(UCaseProps *csp, +ustr_toUpper(const UCaseProps *csp, UChar *dest, int32_t destCapacity, const UChar *src, int32_t srcLength, const char *locale, @@ -124,7 +124,7 @@ ustr_toUpper(UCaseProps *csp, * @internal */ U_CFUNC int32_t -ustr_toTitle(UCaseProps *csp, +ustr_toTitle(const UCaseProps *csp, UChar *dest, int32_t destCapacity, const UChar *src, int32_t srcLength, UBreakIterator *titleIter, @@ -138,7 +138,7 @@ ustr_toTitle(UCaseProps *csp, * @internal */ U_CFUNC int32_t -ustr_foldCase(UCaseProps *csp, +ustr_foldCase(const UCaseProps *csp, UChar *dest, int32_t destCapacity, const UChar *src, int32_t srcLength, uint32_t options, diff --git a/icu4c/source/common/ustrcase.c b/icu4c/source/common/ustrcase.c index d7531f2d3c..6946d5e4a5 100644 --- a/icu4c/source/common/ustrcase.c +++ b/icu4c/source/common/ustrcase.c @@ -125,7 +125,7 @@ UCaseMapFull(const UCaseProps *csp, UChar32 c, * context [0..srcLength[ into account. */ static int32_t -_caseMap(UCaseProps *csp, UCaseMapFull *map, +_caseMap(const UCaseProps *csp, UCaseMapFull *map, UChar *dest, int32_t destCapacity, const UChar *src, UCaseContext *csc, int32_t srcStart, int32_t srcLimit, @@ -160,7 +160,7 @@ _caseMap(UCaseProps *csp, UCaseMapFull *map, * Must get titleIter!=NULL. */ static int32_t -_toTitle(UCaseProps *csp, +_toTitle(const UCaseProps *csp, UChar *dest, int32_t destCapacity, const UChar *src, UCaseContext *csc, int32_t srcLength, @@ -223,7 +223,7 @@ _toTitle(UCaseProps *csp, } U_CFUNC int32_t -ustr_toTitle(UCaseProps *csp, +ustr_toTitle(const UCaseProps *csp, UChar *dest, int32_t destCapacity, const UChar *src, int32_t srcLength, UBreakIterator *titleIter, @@ -247,7 +247,7 @@ ustr_toTitle(UCaseProps *csp, /* functions available in the common library (for unistr_case.cpp) */ U_CFUNC int32_t -ustr_toLower(UCaseProps *csp, +ustr_toLower(const UCaseProps *csp, UChar *dest, int32_t destCapacity, const UChar *src, int32_t srcLength, const char *locale, @@ -266,7 +266,7 @@ ustr_toLower(UCaseProps *csp, } U_CFUNC int32_t -ustr_toUpper(UCaseProps *csp, +ustr_toUpper(const UCaseProps *csp, UChar *dest, int32_t destCapacity, const UChar *src, int32_t srcLength, const char *locale, @@ -285,7 +285,7 @@ ustr_toUpper(UCaseProps *csp, } U_CFUNC int32_t -ustr_foldCase(UCaseProps *csp, +ustr_foldCase(const UCaseProps *csp, UChar *dest, int32_t destCapacity, const UChar *src, int32_t srcLength, uint32_t options, @@ -333,7 +333,7 @@ caseMap(UChar *dest, int32_t destCapacity, UChar buffer[300]; UChar *temp; - UCaseProps *csp; + const UCaseProps *csp; int32_t destLength; UBool ownTitleIter; @@ -527,7 +527,7 @@ u_strcmpFold(const UChar *s1, int32_t length1, const UChar *s2, int32_t length2, uint32_t options, UErrorCode *pErrorCode) { - UCaseProps *csp; + const UCaseProps *csp; /* current-level start/limit - s1/s2 as current */ const UChar *start1, *start2, *limit1, *limit2;