From a6e52426c37d43e36defd10cd1ef92841a78ef51 Mon Sep 17 00:00:00 2001 From: George Rhoten Date: Tue, 21 Mar 2006 05:04:29 +0000 Subject: [PATCH] ICU-4707 Fix some compiler warnings X-SVN-Rev: 19387 --- icu4c/source/common/ubidi_props.c | 10 +++++++--- icu4c/source/common/ucase.c | 13 ++++++++----- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/icu4c/source/common/ubidi_props.c b/icu4c/source/common/ubidi_props.c index 4cba512d648..1226fab9187 100644 --- a/icu4c/source/common/ubidi_props.c +++ b/icu4c/source/common/ubidi_props.c @@ -1,7 +1,7 @@ /* ******************************************************************************* * -* Copyright (C) 2004-2005, International Business Machines +* Copyright (C) 2004-2006, International Business Machines * Corporation and others. All Rights Reserved. * ******************************************************************************* @@ -199,17 +199,21 @@ ubidi_closeProps(UBiDiProps *bdp) { /* UBiDiProps singleton ----------------------------------------------------- */ static UBiDiProps *gBdp=NULL, *gBdpDummy=NULL; +#if !UBIDI_HARDCODE_DATA static UErrorCode gErrorCode=U_ZERO_ERROR; static int8_t gHaveData=0; +#endif static UBool U_CALLCONV ubidi_cleanup(void) { ubidi_closeProps(gBdp); gBdp=NULL; - gErrorCode=U_ZERO_ERROR; - gHaveData=0; ubidi_closeProps(gBdpDummy); gBdpDummy=NULL; +#if !UBIDI_HARDCODE_DATA + gErrorCode=U_ZERO_ERROR; + gHaveData=0; +#endif return TRUE; } diff --git a/icu4c/source/common/ucase.c b/icu4c/source/common/ucase.c index de3f79a7ed4..43f4eaafcd8 100644 --- a/icu4c/source/common/ucase.c +++ b/icu4c/source/common/ucase.c @@ -1,7 +1,7 @@ /* ******************************************************************************* * -* Copyright (C) 2004-2005, International Business Machines +* Copyright (C) 2004-2006, International Business Machines * Corporation and others. All Rights Reserved. * ******************************************************************************* @@ -204,16 +204,20 @@ ucase_close(UCaseProps *csp) { /* UCaseProps singleton ----------------------------------------------------- */ static UCaseProps *gCsp=NULL, *gCspDummy=NULL; +#if !UCASE_HARDCODE_DATA static UErrorCode gErrorCode=U_ZERO_ERROR; static int8_t gHaveData=0; +#endif static UBool U_CALLCONV ucase_cleanup(void) { ucase_close(gCsp); gCsp=NULL; - gErrorCode=U_ZERO_ERROR; - gHaveData=0; ucase_close(gCspDummy); gCspDummy=NULL; +#if !UCASE_HARDCODE_DATA + gErrorCode=U_ZERO_ERROR; + gHaveData=0; +#endif return TRUE; } @@ -605,7 +609,7 @@ strcmpMax(const UChar *s, int32_t length, const UChar *t, int32_t max) { U_CAPI UBool U_EXPORT2 ucase_addStringCaseClosure(const UCaseProps *csp, const UChar *s, int32_t length, const USetAdder *sa) { const UChar *unfold, *p; - int32_t i, start, limit, result, unfoldRows, unfoldRowWidth, unfoldStringWidth, unfoldCPWidth; + int32_t i, start, limit, result, unfoldRows, unfoldRowWidth, unfoldStringWidth; if(csp->unfold==NULL || s==NULL) { return FALSE; /* no reverse case folding data, or no string */ @@ -625,7 +629,6 @@ ucase_addStringCaseClosure(const UCaseProps *csp, const UChar *s, int32_t length unfoldRows=unfold[UCASE_UNFOLD_ROWS]; unfoldRowWidth=unfold[UCASE_UNFOLD_ROW_WIDTH]; unfoldStringWidth=unfold[UCASE_UNFOLD_STRING_WIDTH]; - unfoldCPWidth=unfoldRowWidth-unfoldStringWidth; unfold+=unfoldRowWidth; if(length>unfoldStringWidth) {