Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed compilation errors by adding casts #96

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions node-stringprep.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -141,7 +141,7 @@ class StringPrep : public Nan::ObjectWrap {
destLen = w;
}

Local<Value> result = Nan::New<String>(dest, destLen).ToLocalChecked();
Local<Value> result = Nan::New<String>((uint16_t*)dest, destLen).ToLocalChecked();
delete[] dest;
return scope.Escape(result);
}
Expand Down Expand Up @@ -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);

Expand All @@ -235,7 +235,7 @@ NAN_METHOD(ToUnicode)
destLen = w;
}

Local<String> result = Nan::New<String>(dest, destLen).ToLocalChecked();
Local<String> result = Nan::New<String>((uint16_t*)dest, destLen).ToLocalChecked();
delete[] dest;
uidna_close(uidna);
info.GetReturnValue().Set(result);
Expand Down Expand Up @@ -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;
Expand All @@ -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)
Expand All @@ -295,7 +295,7 @@ NAN_METHOD(ToASCII)
return;
}

Local<String> result = Nan::New<String>(dest, destLen).ToLocalChecked();
Local<String> result = Nan::New<String>((uint16_t*)dest, destLen).ToLocalChecked();
delete[] dest;
uidna_close(uidna);
info.GetReturnValue().Set(result);
Expand Down