]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/samples/citer/citer.cpp
ICU-66108.tar.gz
[apple/icu.git] / icuSources / samples / citer / citer.cpp
index a4a408bdd7c221c1b57a1a38e8dcd359a921e205..4d5a3bbe837dbc80a7497526228638a33e40e091 100644 (file)
@@ -1,6 +1,12 @@
 /*
 *******************************************************************************
 *
+*     © 2016 and later: Unicode, Inc. and others.
+*     License & terms of use: http://www.unicode.org/copyright.html#License
+*
+*******************************************************************************
+*******************************************************************************
+*
 *     Copyright (C) 2002-2011, International Business Machines
 *     Corporation and others.    All Rights Reserved.
 *
 
 static UFILE *out;
 
+using icu::CharacterIterator;
+using icu::StringCharacterIterator;
+using icu::UCharCharacterIterator;
+using icu::UnicodeString;
+
 void printUnicodeString(const UnicodeString &s)
 {
     u_fprintf(out, "%S", &s);
@@ -48,7 +59,7 @@ void Test::TestUChariter() {
     const UChar *testText = testString.getTerminatedBuffer();
 
     UCharCharacterIterator iter(testText, u_strlen(testText));
-    UCharCharacterIterator* test2 = (UCharCharacterIterator*)iter.clone();
+    UCharCharacterIterator* test2 = iter.clone();
 
     u_fprintf(out, "testText = %s", testChars);
 
@@ -115,7 +126,7 @@ void Test::TestStringiter() {
     const UChar *testText    = testString.getTerminatedBuffer();
 
     StringCharacterIterator iter(testText, u_strlen(testText));
-    StringCharacterIterator* test2 = (StringCharacterIterator*)iter.clone();
+    StringCharacterIterator* test2 = iter.clone();
 
     if (iter != *test2 ) {
         u_fprintf(out, "clone() or equals() failed: Two clones tested unequal\n");