From fa08ad0da41bfc11e82b703c4ba26fee9481591f Mon Sep 17 00:00:00 2001 From: James Bunton Date: Mon, 4 Sep 2017 12:03:13 +1000 Subject: [PATCH] Fixed compilation errors by adding casts --- node-stringprep.cc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/node-stringprep.cc b/node-stringprep.cc index c4d9c1f..9531ec9 100644 --- a/node-stringprep.cc +++ b/node-stringprep.cc @@ -119,7 +119,7 @@ class StringPrep : public Nan::ObjectWrap { error = U_ZERO_ERROR; dest = new UChar[destLen]; size_t w = usprep_prepare(profile, - *str, str.length(), + (const UChar*)*str, str.length(), dest, destLen, USPREP_DEFAULT, NULL, &error); @@ -141,7 +141,7 @@ class StringPrep : public Nan::ObjectWrap { destLen = w; } - Local result = Nan::New(dest, destLen).ToLocalChecked(); + Local result = Nan::New((uint16_t*)dest, destLen).ToLocalChecked(); delete[] dest; return scope.Escape(result); } @@ -212,7 +212,7 @@ NAN_METHOD(ToUnicode) UIDNAInfo uinfo = UIDNA_INFO_INITIALIZER; size_t w = uidna_nameToUnicode( uidna, - *str, str.length(), + (const UChar*)*str, str.length(), dest, destLen, &uinfo, &error); @@ -235,7 +235,7 @@ NAN_METHOD(ToUnicode) destLen = w; } - Local result = Nan::New(dest, destLen).ToLocalChecked(); + Local result = Nan::New((uint16_t*)dest, destLen).ToLocalChecked(); delete[] dest; uidna_close(uidna); info.GetReturnValue().Set(result); @@ -266,7 +266,7 @@ NAN_METHOD(ToASCII) UIDNAInfo uinfo1 = UIDNA_INFO_INITIALIZER; size_t destLen = uidna_nameToASCII( uidna, - *str, strLen, + (const UChar*)*str, strLen, NULL, 0, &uinfo1, &error); UChar *dest = NULL; @@ -278,7 +278,7 @@ NAN_METHOD(ToASCII) UIDNAInfo uinfo2 = UIDNA_INFO_INITIALIZER; uidna_nameToASCII( uidna, - *str, strLen, + (const UChar*)*str, strLen, dest, destLen, &uinfo2, &error); if (U_SUCCESS(error) && uinfo2.errors > 0) @@ -295,7 +295,7 @@ NAN_METHOD(ToASCII) return; } - Local result = Nan::New(dest, destLen).ToLocalChecked(); + Local result = Nan::New((uint16_t*)dest, destLen).ToLocalChecked(); delete[] dest; uidna_close(uidna); info.GetReturnValue().Set(result);