Imported Upstream version 58.1
[platform/upstream/icu.git] / source / test / intltest / winnmtst.cpp
index 225919c..12c25f8 100644 (file)
@@ -1,3 +1,5 @@
+// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
 /*
 ********************************************************************************
 *   Copyright (C) 2005-2016, International Business Machines
@@ -191,7 +193,7 @@ static UnicodeString &getWindowsFormat(int32_t lcid, UBool currency, UnicodeStri
             if (lastError == ERROR_INSUFFICIENT_BUFFER) {
                 int newLength = GetCurrencyFormatW(lcid, 0, nBuffer, NULL, NULL, 0);
 
-                buffer = NEW_ARRAY(UChar, newLength);
+                buffer = NEW_ARRAY(wchar_t, newLength);
                 buffer[0] = 0x0000;
                 GetCurrencyFormatW(lcid, 0, nBuffer, NULL, buffer, newLength);
             }
@@ -205,14 +207,14 @@ static UnicodeString &getWindowsFormat(int32_t lcid, UBool currency, UnicodeStri
             if (lastError == ERROR_INSUFFICIENT_BUFFER) {
                 int newLength = GetNumberFormatW(lcid, 0, nBuffer, NULL, NULL, 0);
 
-                buffer = NEW_ARRAY(UChar, newLength);
+                buffer = NEW_ARRAY(wchar_t, newLength);
                 buffer[0] = 0x0000;
                 GetNumberFormatW(lcid, 0, nBuffer, NULL, buffer, newLength);
             }
         }
     }
 
-    appendTo.append(buffer, (int32_t) wcslen(buffer));
+    appendTo.append((const UChar *)buffer, (int32_t) wcslen(buffer));
 
     if (buffer != stackBuffer) {
         DELETE_ARRAY(buffer);