From: Markus Scherer Date: Mon, 2 May 2016 17:22:49 +0000 (+0000) Subject: ICU-12520 fix for Windows X-Git-Tag: milestone-59-0-1~467 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=20a720bb9b85ea3f839d1e2c209654e2a11fe9bb;p=icu ICU-12520 fix for Windows X-SVN-Rev: 38682 --- diff --git a/icu4c/source/common/ulist.c b/icu4c/source/common/ulist.c index 5aad2774650..26c00ecf08d 100644 --- a/icu4c/source/common/ulist.c +++ b/icu4c/source/common/ulist.c @@ -156,7 +156,8 @@ U_CAPI void U_EXPORT2 ulist_addItemBeginList(UList *list, const void *data, UBoo U_CAPI UBool U_EXPORT2 ulist_containsString(const UList *list, const char *data, int32_t length) { if (list != NULL) { - for (const UListNode *pointer = list->head; pointer != NULL; pointer = pointer->next) { + const UListNode *pointer; + for (pointer = list->head; pointer != NULL; pointer = pointer->next) { if (length == uprv_strlen(pointer->data)) { if (uprv_memcmp(data, pointer->data, length) == 0) { return TRUE; @@ -169,7 +170,8 @@ U_CAPI UBool U_EXPORT2 ulist_containsString(const UList *list, const char *data, U_CAPI UBool U_EXPORT2 ulist_removeString(UList *list, const char *data) { if (list != NULL) { - for (UListNode *pointer = list->head; pointer != NULL; pointer = pointer->next) { + UListNode *pointer; + for (pointer = list->head; pointer != NULL; pointer = pointer->next) { if (uprv_strcmp(data, pointer->data) == 0) { ulist_removeItem(list, pointer); // Remove only the first occurrence, like Java LinkedList.remove(Object).