| OLD | NEW |
| 1 /* | 1 /* |
| 2 ****************************************************************************** | 2 ****************************************************************************** |
| 3 * Copyright (C) 2009-2012, International Business Machines | 3 * Copyright (C) 2009-2014, International Business Machines |
| 4 * Corporation and others. All Rights Reserved. | 4 * Corporation and others. All Rights Reserved. |
| 5 ****************************************************************************** | 5 ****************************************************************************** |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "ulist.h" | 8 #include "ulist.h" |
| 9 #include "cmemory.h" | 9 #include "cmemory.h" |
| 10 #include "cstring.h" | 10 #include "cstring.h" |
| 11 #include "uenumimp.h" | 11 #include "uenumimp.h" |
| 12 | 12 |
| 13 typedef struct UListNode UListNode; | 13 typedef struct UListNode UListNode; |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 | 167 |
| 168 U_CAPI void U_EXPORT2 ulist_resetList(UList *list) { | 168 U_CAPI void U_EXPORT2 ulist_resetList(UList *list) { |
| 169 if (list != NULL) { | 169 if (list != NULL) { |
| 170 list->curr = list->head; | 170 list->curr = list->head; |
| 171 list->currentIndex = 0; | 171 list->currentIndex = 0; |
| 172 } | 172 } |
| 173 } | 173 } |
| 174 | 174 |
| 175 U_CAPI void U_EXPORT2 ulist_deleteList(UList *list) { | 175 U_CAPI void U_EXPORT2 ulist_deleteList(UList *list) { |
| 176 UListNode *listHead = NULL; | 176 UListNode *listHead = NULL; |
| 177 UListNode *listPointer = NULL; | 177 |
| 178 | |
| 179 if (list != NULL) { | 178 if (list != NULL) { |
| 180 listHead = list->head; | 179 listHead = list->head; |
| 181 listPointer = listHead; | |
| 182 while (listHead != NULL) { | 180 while (listHead != NULL) { |
| 183 listPointer = listHead->next; | 181 UListNode *listPointer = listHead->next; |
| 184 | 182 |
| 185 if (listHead->forceDelete) { | 183 if (listHead->forceDelete) { |
| 186 uprv_free(listHead->data); | 184 uprv_free(listHead->data); |
| 187 } | 185 } |
| 188 | 186 |
| 189 uprv_free(listHead); | 187 uprv_free(listHead); |
| 190 listHead = listPointer; | 188 listHead = listPointer; |
| 191 } | 189 } |
| 192 uprv_free(list); | 190 uprv_free(list); |
| 193 list = NULL; | 191 list = NULL; |
| 194 } | 192 } |
| 195 } | 193 } |
| 196 | 194 |
| 197 U_CAPI void U_EXPORT2 ulist_close_keyword_values_iterator(UEnumeration *en) { | 195 U_CAPI void U_EXPORT2 ulist_close_keyword_values_iterator(UEnumeration *en) { |
| 198 if (en != NULL) { | 196 if (en != NULL) { |
| (...skipping 28 matching lines...) Expand all Loading... |
| 227 return ; | 225 return ; |
| 228 } | 226 } |
| 229 | 227 |
| 230 ulist_resetList((UList *)(en->context)); | 228 ulist_resetList((UList *)(en->context)); |
| 231 } | 229 } |
| 232 | 230 |
| 233 U_CAPI UList * U_EXPORT2 ulist_getListFromEnum(UEnumeration *en) { | 231 U_CAPI UList * U_EXPORT2 ulist_getListFromEnum(UEnumeration *en) { |
| 234 return (UList *)(en->context); | 232 return (UList *)(en->context); |
| 235 } | 233 } |
| 236 | 234 |
| OLD | NEW |