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

Unified Diff: source/samples/numfmt/main.cpp

Issue 845603002: Update ICU to 54.1 step 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/icu.git@master
Patch Set: remove unusued directories Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « source/samples/msgfmt/msgfmt.sln ('k') | source/samples/numfmt/numfmt.sln » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/samples/numfmt/main.cpp
diff --git a/source/samples/numfmt/main.cpp b/source/samples/numfmt/main.cpp
index 5adffe3643e58f166de096d16ae5a19a6fac20f3..ee375ff72b9123e9b79396004de00ad4d72e6f7c 100644
--- a/source/samples/numfmt/main.cpp
+++ b/source/samples/numfmt/main.cpp
@@ -1,6 +1,6 @@
/********************************************************************
* COPYRIGHT:
- * Copyright (c) 1999-2010, International Business Machines Corporation and
+ * Copyright (c) 1999-2014, International Business Machines Corporation and
* others. All Rights Reserved.
********************************************************************/
@@ -16,8 +16,6 @@
#include <stdlib.h>
#include <string.h>
-#define LENGTHOF(array) (int32_t)(sizeof(array)/sizeof((array)[0]))
-
extern "C" void capi();
void cppapi();
@@ -153,12 +151,12 @@ setNumberFormatCurrency_2_4(NumberFormat &nf, const char *currency, UErrorCode &
int32_t i;
- for(i=0; i<LENGTHOF(currencyMap); ++i) {
+ for(i=0; i<UPRV_LENGTHOF(currencyMap); ++i) {
if(strcmp(currency, currencyMap[i].currency)==0) {
break;
}
}
- if(i==LENGTHOF(currencyMap)) {
+ if(i==UPRV_LENGTHOF(currencyMap)) {
// a more specific error code would be useful in a real application
errorCode=U_UNSUPPORTED_ERROR;
return;
@@ -235,7 +233,7 @@ showCurrencyFormatting(UBool useICU26API) {
// TODO: Using printf() here assumes that the runtime encoding is ASCII-friendly
// and can therefore be mixed with UTF-8
- for(i=0; i<LENGTHOF(sampleLocaleIDs); ++i) {
+ for(i=0; i<UPRV_LENGTHOF(sampleLocaleIDs); ++i) {
printf("show currency formatting (method for %s) in the locale \"%s\"\n",
useICU26API ? "ICU 2.6" : "before ICU 2.6",
sampleLocaleIDs[i]);
@@ -249,7 +247,7 @@ showCurrencyFormatting(UBool useICU26API) {
continue;
}
- for(j=0; j<LENGTHOF(sampleCurrencies); ++j) {
+ for(j=0; j<UPRV_LENGTHOF(sampleCurrencies); ++j) {
printf(" - format currency \"%s\": ", sampleCurrencies[j]);
// set the actual currency to be formatted
« no previous file with comments | « source/samples/msgfmt/msgfmt.sln ('k') | source/samples/numfmt/numfmt.sln » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698