From 2adf6bbb4c9f96beae9e2f565e279738c6fc0ab6 Mon Sep 17 00:00:00 2001 From: George Rhoten Date: Tue, 29 Apr 2003 18:14:37 +0000 Subject: [PATCH] ICU-2699 Fixed some compiler warnings X-SVN-Rev: 11728 --- icu4c/source/common/uidna.cpp | 12 ++++++------ icu4c/source/test/intltest/idnaref.cpp | 16 ++++++++-------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/icu4c/source/common/uidna.cpp b/icu4c/source/common/uidna.cpp index fe51157f15..fdf502abef 100644 --- a/icu4c/source/common/uidna.cpp +++ b/icu4c/source/common/uidna.cpp @@ -163,8 +163,8 @@ uidna_toASCII(const UChar* src, int32_t srcLength, int32_t j=0; //get the options - UBool allowUnassigned = options & UIDNA_ALLOW_UNASSIGNED; - UBool useSTD3ASCIIRules = (options & UIDNA_USE_STD3_RULES) >>1; + UBool allowUnassigned = (UBool)((options & UIDNA_ALLOW_UNASSIGNED) != 0); + UBool useSTD3ASCIIRules = (UBool)((options & UIDNA_USE_STD3_RULES) != 0); int32_t failPos = -1; // step 2 @@ -315,8 +315,8 @@ uidna_toUnicode(const UChar* src, int32_t srcLength, } //get the options - UBool allowUnassigned = options & UIDNA_ALLOW_UNASSIGNED; - UBool useSTD3ASCIIRules = (options & UIDNA_USE_STD3_RULES) >>1; + UBool allowUnassigned = (UBool)((options & UIDNA_ALLOW_UNASSIGNED) != 0); + UBool useSTD3ASCIIRules = (UBool)((options & UIDNA_USE_STD3_RULES) != 0); UChar b1Stack[MAX_LABEL_BUFFER_SIZE], b2Stack[MAX_LABEL_BUFFER_SIZE], b3Stack[MAX_LABEL_BUFFER_SIZE]; @@ -514,8 +514,8 @@ uidna_IDNToASCII( const UChar *src, int32_t srcLength, } //get the options - UBool allowUnassigned = options & UIDNA_ALLOW_UNASSIGNED; - UBool useSTD3ASCIIRules = (options & UIDNA_USE_STD3_RULES) >>1; + UBool allowUnassigned = (UBool)((options & UIDNA_ALLOW_UNASSIGNED) != 0); + UBool useSTD3ASCIIRules = (UBool)((options & UIDNA_USE_STD3_RULES) != 0); UChar *start=NULL, *limit=NULL; diff --git a/icu4c/source/test/intltest/idnaref.cpp b/icu4c/source/test/intltest/idnaref.cpp index 6974df0b0b..bd0aca93d5 100644 --- a/icu4c/source/test/intltest/idnaref.cpp +++ b/icu4c/source/test/intltest/idnaref.cpp @@ -262,8 +262,8 @@ idnaref_toASCII(const UChar* src, int32_t srcLength, reqLength=0; //get the options - UBool allowUnassigned = options & IDNAREF_ALLOW_UNASSIGNED; - UBool useSTD3ASCIIRules = (options & IDNAREF_USE_STD3_RULES) >>1; + UBool allowUnassigned = (UBool)((options & IDNAREF_ALLOW_UNASSIGNED) != 0); + UBool useSTD3ASCIIRules = (UBool)((options & IDNAREF_USE_STD3_RULES) != 0); UBool* caseFlags = NULL; @@ -421,8 +421,8 @@ idnaref_toUnicode(const UChar* src, int32_t srcLength, UBool srcIsASCII = TRUE; //get the options - UBool allowUnassigned = options & IDNAREF_ALLOW_UNASSIGNED; - UBool useSTD3ASCIIRules = (options & IDNAREF_USE_STD3_RULES) >>1; + UBool allowUnassigned = (UBool)((options & IDNAREF_ALLOW_UNASSIGNED) != 0); + UBool useSTD3ASCIIRules = (UBool)((options & IDNAREF_USE_STD3_RULES) != 0); if(U_FAILURE(*status)){ goto CLEANUP; @@ -632,8 +632,8 @@ idnaref_IDNToASCII( const UChar* src, int32_t srcLength, int32_t b1Capacity = MAX_LABEL_BUFFER_SIZE; //get the options - UBool allowUnassigned = options & IDNAREF_ALLOW_UNASSIGNED; - UBool useSTD3ASCIIRules = (options & IDNAREF_USE_STD3_RULES) >>1; + UBool allowUnassigned = (UBool)((options & IDNAREF_ALLOW_UNASSIGNED) != 0); + UBool useSTD3ASCIIRules = (UBool)((options & IDNAREF_USE_STD3_RULES) != 0); UBool done = FALSE; if(U_FAILURE(*status)){ @@ -787,8 +787,8 @@ idnaref_IDNToUnicode( const UChar* src, int32_t srcLength, int32_t b1Capacity = MAX_LABEL_BUFFER_SIZE; //get the options - UBool allowUnassigned = options & IDNAREF_ALLOW_UNASSIGNED; - UBool useSTD3ASCIIRules = (options & IDNAREF_USE_STD3_RULES) >>1; + UBool allowUnassigned = (UBool)((options & IDNAREF_ALLOW_UNASSIGNED) != 0); + UBool useSTD3ASCIIRules = (UBool)((options & IDNAREF_USE_STD3_RULES) != 0); if(U_FAILURE(*status)){ goto CLEANUP;