Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(529)

Side by Side Diff: source/i18n/ucurr.cpp

Issue 1621843002: ICU 56 update step 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/icu.git@561
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « source/i18n/ucoleitr.cpp ('k') | source/i18n/udat.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 ********************************************************************** 2 **********************************************************************
3 * Copyright (c) 2002-2014, International Business Machines 3 * Copyright (c) 2002-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 "unicode/utypes.h" 8 #include "unicode/utypes.h"
9 9
10 #if !UCONFIG_NO_FORMATTING 10 #if !UCONFIG_NO_FORMATTING
(...skipping 989 matching lines...) Expand 10 before | Expand all | Expand 10 after
1000 } 1000 }
1001 1001
1002 // Get maximum currency name count first. 1002 // Get maximum currency name count first.
1003 getCurrencyNameCount(loc, total_currency_name_count, total_currency_symbol_c ount); 1003 getCurrencyNameCount(loc, total_currency_name_count, total_currency_symbol_c ount);
1004 1004
1005 *currencyNames = (CurrencyNameStruct*)uprv_malloc 1005 *currencyNames = (CurrencyNameStruct*)uprv_malloc
1006 (sizeof(CurrencyNameStruct) * (*total_currency_name_count)); 1006 (sizeof(CurrencyNameStruct) * (*total_currency_name_count));
1007 *currencySymbols = (CurrencyNameStruct*)uprv_malloc 1007 *currencySymbols = (CurrencyNameStruct*)uprv_malloc
1008 (sizeof(CurrencyNameStruct) * (*total_currency_symbol_count)); 1008 (sizeof(CurrencyNameStruct) * (*total_currency_symbol_count));
1009 1009
1010 if(currencyNames == NULL || currencySymbols == NULL) {
1011 ec = U_MEMORY_ALLOCATION_ERROR;
1012 }
1013
1014 if (U_FAILURE(ec)) return;
1015
1010 const UChar* s = NULL; // currency name 1016 const UChar* s = NULL; // currency name
1011 char* iso = NULL; // currency ISO code 1017 char* iso = NULL; // currency ISO code
1012 1018
1013 *total_currency_name_count = 0; 1019 *total_currency_name_count = 0;
1014 *total_currency_symbol_count = 0; 1020 *total_currency_symbol_count = 0;
1015 1021
1016 UErrorCode ec3 = U_ZERO_ERROR; 1022 UErrorCode ec3 = U_ZERO_ERROR;
1017 UErrorCode ec4 = U_ZERO_ERROR; 1023 UErrorCode ec4 = U_ZERO_ERROR;
1018 1024
1019 // Using hash to remove duplicates caused by locale fallback 1025 // Using hash to remove duplicates caused by locale fallback
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
1167 for (int32_t index = 0; index < *total_currency_symbol_count; ++index) { 1173 for (int32_t index = 0; index < *total_currency_symbol_count; ++index) {
1168 printf("index: %d\n", index); 1174 printf("index: %d\n", index);
1169 printf("iso: %s\n", (*currencySymbols)[index].IsoCode); 1175 printf("iso: %s\n", (*currencySymbols)[index].IsoCode);
1170 char curNameBuf[1024]; 1176 char curNameBuf[1024];
1171 memset(curNameBuf, 0, 1024); 1177 memset(curNameBuf, 0, 1024);
1172 u_austrncpy(curNameBuf, (*currencySymbols)[index].currencyName, (*curren cySymbols)[index].currencyNameLen); 1178 u_austrncpy(curNameBuf, (*currencySymbols)[index].currencyName, (*curren cySymbols)[index].currencyNameLen);
1173 printf("currencySymbol: %s\n", curNameBuf); 1179 printf("currencySymbol: %s\n", curNameBuf);
1174 printf("len: %d\n", (*currencySymbols)[index].currencyNameLen); 1180 printf("len: %d\n", (*currencySymbols)[index].currencyNameLen);
1175 } 1181 }
1176 #endif 1182 #endif
1183 // fail on hashtable errors
1184 if (U_FAILURE(ec3)) {
1185 ec = ec3;
1186 return;
1187 }
1188 if (U_FAILURE(ec4)) {
1189 ec = ec4;
1190 return;
1191 }
1177 } 1192 }
1178 1193
1179 // @param currencyNames: currency names array 1194 // @param currencyNames: currency names array
1180 // @param indexInCurrencyNames: the index of the character in currency names 1195 // @param indexInCurrencyNames: the index of the character in currency names
1181 // array against which the comparison is done 1196 // array against which the comparison is done
1182 // @param key: input text char to compare against 1197 // @param key: input text char to compare against
1183 // @param begin(IN/OUT): the begin index of matching range in currency names ar ray 1198 // @param begin(IN/OUT): the begin index of matching range in currency names ar ray
1184 // @param end(IN/OUT): the end index of matching range in currency names array. 1199 // @param end(IN/OUT): the end index of matching range in currency names array.
1185 static int32_t 1200 static int32_t
1186 binarySearch(const CurrencyNameStruct* currencyNames, 1201 binarySearch(const CurrencyNameStruct* currencyNames,
(...skipping 1503 matching lines...) Expand 10 before | Expand all | Expand 10 after
2690 code = tmpCode; 2705 code = tmpCode;
2691 } 2706 }
2692 } 2707 }
2693 ures_close(bundle); 2708 ures_close(bundle);
2694 } 2709 }
2695 return code; 2710 return code;
2696 } 2711 }
2697 #endif /* #if !UCONFIG_NO_FORMATTING */ 2712 #endif /* #if !UCONFIG_NO_FORMATTING */
2698 2713
2699 //eof 2714 //eof
OLDNEW
« no previous file with comments | « source/i18n/ucoleitr.cpp ('k') | source/i18n/udat.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698