1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
|
Description: Fixed compilation errors by adding casts
Forwarded: https://github.com/astro/node-stringprep/pull/96/commits/fa08ad0da41bfc11e82b703c4ba26fee9481591f
Author: James Bunton <jbunton@atlassian.com>
Last-Update: 2017-09-04
--- a/node-stringprep.cc
+++ b/node-stringprep.cc
@@ -119,7 +119,7 @@
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 @@
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);
}
@@ -212,7 +212,7 @@
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 @@
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);
@@ -266,7 +266,7 @@
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 @@
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 @@
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);
|