diff --git a/convertxml/js_convertxml.cpp b/convertxml/js_convertxml.cpp index 65a409449cc5d6fbc39227e9b032f7c44c4e0005..505e06d48496591c6760c15d4e2c536352dc1880 100755 --- a/convertxml/js_convertxml.cpp +++ b/convertxml/js_convertxml.cpp @@ -113,22 +113,24 @@ void ConvertXml::GetPrevNodeList(xmlNodePtr curNode) napi_create_object(env_, &elementsObject); if (curNode->type == xmlElementType::XML_PI_NODE && !m_Options.ignoreInstruction) { SetKeyValue(elementsObject, m_Options.type, GetNodeType(curNode->type)); - SetKeyValue(elementsObject, m_Options.name, (char*)curNode->name); + SetKeyValue(elementsObject, m_Options.name, reinterpret_cast(curNode->name)); if (xmlNodeGetContent(curNode) != nullptr) { - SetKeyValue(elementsObject, m_Options.instruction, (const char*)xmlNodeGetContent(curNode)); + SetKeyValue(elementsObject, m_Options.instruction, + reinterpret_cast(xmlNodeGetContent(curNode))); } m_prevObj.push_back(elementsObject); } if (curNode->type == xmlElementType::XML_COMMENT_NODE && !m_Options.ignoreComment) { SetKeyValue(elementsObject, m_Options.type, GetNodeType(curNode->type)); if (xmlNodeGetContent(curNode) != nullptr) { - SetKeyValue(elementsObject, m_Options.comment, (const char*)xmlNodeGetContent(curNode)); + SetKeyValue(elementsObject, m_Options.comment, + reinterpret_cast(xmlNodeGetContent(curNode))); } m_prevObj.push_back(elementsObject); } if (curNode->type == xmlElementType::XML_DTD_NODE && !m_Options.ignoreDoctype) { SetKeyValue(elementsObject, m_Options.type, GetNodeType(curNode->type)); - SetKeyValue(elementsObject, m_Options.doctype, (char*)curNode->name); + SetKeyValue(elementsObject, m_Options.doctype, reinterpret_cast(curNode->name)); m_prevObj.push_back(elementsObject); } } @@ -141,7 +143,8 @@ void ConvertXml::SetAttributes(xmlNodePtr curNode, napi_value &elementsObject) napi_value attrTitleObj = nullptr; napi_create_object(env_, &attrTitleObj); while (attr) { - SetKeyValue(attrTitleObj, (const char*)attr->name, (const char*)attr->children->content); + SetKeyValue(attrTitleObj, reinterpret_cast(attr->name), + reinterpret_cast(attr->children->content)); attr = attr->next; } napi_set_named_property(env_, elementsObject, m_Options.attributes.c_str(), attrTitleObj); @@ -152,17 +155,20 @@ void ConvertXml::SetXmlElementType(xmlNodePtr curNode, napi_value &elementsObjec { if (curNode->type == xmlElementType::XML_PI_NODE && !m_Options.ignoreInstruction) { if (xmlNodeGetContent(curNode) != nullptr) { - SetKeyValue(elementsObject, m_Options.instruction.c_str(), (const char*)xmlNodeGetContent(curNode)); + SetKeyValue(elementsObject, m_Options.instruction.c_str(), + reinterpret_cast(xmlNodeGetContent(curNode))); bFlag = true; } } else if (curNode->type == xmlElementType::XML_COMMENT_NODE && !m_Options.ignoreComment) { if (xmlNodeGetContent(curNode) != nullptr) { - SetKeyValue(elementsObject, m_Options.comment.c_str(), (const char*)xmlNodeGetContent(curNode)); + SetKeyValue(elementsObject, m_Options.comment.c_str(), + reinterpret_cast(xmlNodeGetContent(curNode))); bFlag = true; } } else if (curNode->type == xmlElementType::XML_CDATA_SECTION_NODE && !m_Options.ignoreCdata) { if (xmlNodeGetContent(curNode) != nullptr) { - SetKeyValue(elementsObject, m_Options.cdata, (const char*)xmlNodeGetContent(curNode)); + SetKeyValue(elementsObject, m_Options.cdata, + reinterpret_cast(xmlNodeGetContent(curNode))); bFlag = true; } } @@ -182,7 +188,7 @@ void ConvertXml::SetNodeInfo(xmlNodePtr curNode, napi_value &elementsObject) if ((curNode->type != xmlElementType::XML_COMMENT_NODE) && (curNode->type != xmlElementType::XML_CDATA_SECTION_NODE)) { if (!(curNode->type == xmlElementType::XML_PI_NODE && m_Options.ignoreInstruction)) { - SetKeyValue(elementsObject, m_Options.name, (char*)curNode->name); + SetKeyValue(elementsObject, m_Options.name, reinterpret_cast(curNode->name)); } } } @@ -192,16 +198,18 @@ void ConvertXml::SetEndInfo(xmlNodePtr curNode, napi_value &elementsObject, bool { SetKeyValue(elementsObject, m_Options.type, GetNodeType(curNode->type)); if (curNode->type == xmlElementType::XML_ELEMENT_NODE) { - SetKeyValue(elementsObject, m_Options.name.c_str(), (const char*)curNode->name); + SetKeyValue(elementsObject, m_Options.name.c_str(), reinterpret_cast(curNode->name)); bFlag = true; } else if (curNode->type == xmlElementType::XML_TEXT_NODE) { if (m_Options.trim) { if (xmlNodeGetContent(curNode) != nullptr) { - SetKeyValue(elementsObject, m_Options.text, Trim((const char*)xmlNodeGetContent(curNode))); + SetKeyValue(elementsObject, m_Options.text, + Trim(reinterpret_cast(xmlNodeGetContent(curNode)))); } } else { if (xmlNodeGetContent(curNode) != nullptr) { - SetKeyValue(elementsObject, m_Options.text, (const char*)xmlNodeGetContent(curNode)); + SetKeyValue(elementsObject, m_Options.text, + reinterpret_cast(xmlNodeGetContent(curNode))); } } if (!m_Options.ignoreText) { @@ -567,7 +575,7 @@ void ConvertXml::DealCDataInfo(bool bCData, xmlNodePtr &curNode) curNode->next && curNode->next->type == xmlElementType::XML_TEXT_NODE && curNode->next->next && curNode->next->next->type == xmlElementType::XML_CDATA_SECTION_NODE) { if (xmlNodeGetContent(curNode->next) != nullptr) { - std::string strTemp = (char*)xmlNodeGetContent(curNode->next); + std::string strTemp = reinterpret_cast(xmlNodeGetContent(curNode->next)); Replace(strTemp, " ", ""); Replace(strTemp, "\v", ""); Replace(strTemp, "\t", ""); diff --git a/convertxml/js_convertxml.js b/convertxml/js_convertxml.js old mode 100755 new mode 100644 diff --git a/convertxml/native_module_convertxml.cpp b/convertxml/native_module_convertxml.cpp index 05ca39431e8171359fbb404df137cedd841f282d..ec877c16a89ea880df8729806fa8d6c8f2a7f790 100755 --- a/convertxml/native_module_convertxml.cpp +++ b/convertxml/native_module_convertxml.cpp @@ -31,7 +31,7 @@ static napi_value ConvertXmlConstructor(napi_env env, napi_callback_info info) napi_wrap( env, thisVar, objectInfo, [](napi_env env, void *data, void *hint) { - auto obj = (ConvertXml*)data; + auto obj = reinterpret_cast(data); if (obj != nullptr) { delete obj; } @@ -53,7 +53,7 @@ static napi_value Convert(napi_env env, napi_callback_info info) std::string strXml; napi_valuetype valuetype; ConvertXml *object = nullptr; - NAPI_CALL(env, napi_unwrap(env, thisVar, (void**)&object)); + NAPI_CALL(env, napi_unwrap(env, thisVar, reinterpret_cast(&object))); if (args[0] == nullptr) { NAPI_CALL(env, napi_throw_error(env, "", "parameter is empty")); } else { diff --git a/uri/native_module_uri.cpp b/uri/native_module_uri.cpp index 96107d99f1c64928d4460a6460ca8e2200707256..23eb1c6f21434628546362cc073fa77e4b5efb75 100755 --- a/uri/native_module_uri.cpp +++ b/uri/native_module_uri.cpp @@ -52,7 +52,7 @@ namespace OHOS::Uri { } NAPI_CALL(env, napi_wrap(env, thisVar, object, [](napi_env env, void *data, void *hint) { - auto obj = (Uri*)data; + auto obj = reinterpret_cast(data); if (obj != nullptr) { delete obj; } @@ -65,7 +65,7 @@ namespace OHOS::Uri { napi_value thisVar = nullptr; NAPI_CALL(env, napi_get_cb_info(env, info, nullptr, nullptr, &thisVar, nullptr)); Uri *muri = nullptr; - NAPI_CALL(env, napi_unwrap(env, thisVar, (void**)&muri)); + NAPI_CALL(env, napi_unwrap(env, thisVar, reinterpret_cast(&muri))); std::string normalizeUri = muri->Normalize(); napi_value result = nullptr; size_t tempLen = normalizeUri.size(); @@ -82,9 +82,9 @@ namespace OHOS::Uri { NAPI_CALL(env, napi_get_cb_info(env, info, &argc, argv, &thisVar, nullptr)); Uri *muri = nullptr; - NAPI_CALL(env, napi_unwrap(env, thisVar, (void**)&muri)); + NAPI_CALL(env, napi_unwrap(env, thisVar, reinterpret_cast(&muri))); Uri *other = nullptr; - NAPI_CALL(env, napi_unwrap(env, argv[0], (void**)&other)); + NAPI_CALL(env, napi_unwrap(env, argv[0], reinterpret_cast(&other))); bool flag = muri->Equals(*other); NAPI_CALL(env, napi_get_boolean(env, flag, &result)); @@ -97,7 +97,7 @@ namespace OHOS::Uri { napi_value result = nullptr; NAPI_CALL(env, napi_get_cb_info(env, info, nullptr, nullptr, &thisVar, nullptr)); Uri *muri = nullptr; - NAPI_CALL(env, napi_unwrap(env, thisVar, (void**)&muri)); + NAPI_CALL(env, napi_unwrap(env, thisVar, reinterpret_cast(&muri))); bool flag = muri->IsAbsolute(); NAPI_CALL(env, napi_get_boolean(env, flag, &result)); return result; @@ -109,7 +109,7 @@ namespace OHOS::Uri { napi_value result = nullptr; NAPI_CALL(env, napi_get_cb_info(env, info, nullptr, nullptr, &thisVar, nullptr)); Uri *muri = nullptr; - NAPI_CALL(env, napi_unwrap(env, thisVar, (void**)&muri)); + NAPI_CALL(env, napi_unwrap(env, thisVar, reinterpret_cast(&muri))); std::string temp = muri->IsFailed(); size_t templen = temp.size(); NAPI_CALL(env, napi_create_string_utf8(env, temp.c_str(), templen, &result)); @@ -122,7 +122,7 @@ namespace OHOS::Uri { napi_value result = nullptr; NAPI_CALL(env, napi_get_cb_info(env, info, nullptr, nullptr, &thisVar, nullptr)); Uri *muri = nullptr; - NAPI_CALL(env, napi_unwrap(env, thisVar, (void**)&muri)); + NAPI_CALL(env, napi_unwrap(env, thisVar, reinterpret_cast(&muri))); std::string temp = muri->ToString(); size_t templen = temp.size(); NAPI_CALL(env, napi_create_string_utf8(env, temp.c_str(), templen, &result)); @@ -135,7 +135,7 @@ namespace OHOS::Uri { napi_value result = nullptr; NAPI_CALL(env, napi_get_cb_info(env, info, nullptr, nullptr, &thisVar, nullptr)); Uri *muri = nullptr; - NAPI_CALL(env, napi_unwrap(env, thisVar, (void**)&muri)); + NAPI_CALL(env, napi_unwrap(env, thisVar, reinterpret_cast(&muri))); std::string temp = muri->GetScheme(); size_t templen = temp.size(); NAPI_CALL(env, napi_create_string_utf8(env, temp.c_str(), templen, &result)); @@ -148,7 +148,7 @@ namespace OHOS::Uri { napi_value result = nullptr; NAPI_CALL(env, napi_get_cb_info(env, info, nullptr, nullptr, &thisVar, nullptr)); Uri *muri = nullptr; - NAPI_CALL(env, napi_unwrap(env, thisVar, (void**)&muri)); + NAPI_CALL(env, napi_unwrap(env, thisVar, reinterpret_cast(&muri))); std::string temp = muri->GetAuthority(); size_t templen = temp.size(); NAPI_CALL(env, napi_create_string_utf8(env, temp.c_str(), templen, &result)); @@ -161,7 +161,7 @@ namespace OHOS::Uri { napi_value result = nullptr; NAPI_CALL(env, napi_get_cb_info(env, info, nullptr, nullptr, &thisVar, nullptr)); Uri *muri = nullptr; - NAPI_CALL(env, napi_unwrap(env, thisVar, (void**)&muri)); + NAPI_CALL(env, napi_unwrap(env, thisVar, reinterpret_cast(&muri))); std::string temp = muri->GetSsp(); size_t templen = temp.size(); NAPI_CALL(env, napi_create_string_utf8(env, temp.c_str(), templen, &result)); @@ -174,7 +174,7 @@ namespace OHOS::Uri { napi_value result = nullptr; NAPI_CALL(env, napi_get_cb_info(env, info, nullptr, nullptr, &thisVar, nullptr)); Uri *muri = nullptr; - NAPI_CALL(env, napi_unwrap(env, thisVar, (void**)&muri)); + NAPI_CALL(env, napi_unwrap(env, thisVar, reinterpret_cast(&muri))); std::string temp = muri->GetUserinfo(); size_t templen = temp.size(); NAPI_CALL(env, napi_create_string_utf8(env, temp.c_str(), templen, &result)); @@ -187,7 +187,7 @@ namespace OHOS::Uri { napi_value result = nullptr; NAPI_CALL(env, napi_get_cb_info(env, info, nullptr, nullptr, &thisVar, nullptr)); Uri *muri = nullptr; - NAPI_CALL(env, napi_unwrap(env, thisVar, (void**)&muri)); + NAPI_CALL(env, napi_unwrap(env, thisVar, reinterpret_cast(&muri))); std::string temp = muri->GetHost(); size_t templen = temp.size(); NAPI_CALL(env, napi_create_string_utf8(env, temp.c_str(), templen, &result)); @@ -200,7 +200,7 @@ namespace OHOS::Uri { napi_value result = nullptr; NAPI_CALL(env, napi_get_cb_info(env, info, nullptr, nullptr, &thisVar, nullptr)); Uri *muri = nullptr; - NAPI_CALL(env, napi_unwrap(env, thisVar, (void**)&muri)); + NAPI_CALL(env, napi_unwrap(env, thisVar, reinterpret_cast(&muri))); std::string temp = muri->GetPort(); size_t templen = temp.size(); NAPI_CALL(env, napi_create_string_utf8(env, temp.c_str(), templen, &result)); @@ -213,7 +213,7 @@ namespace OHOS::Uri { napi_value result = nullptr; NAPI_CALL(env, napi_get_cb_info(env, info, nullptr, nullptr, &thisVar, nullptr)); Uri *muri = nullptr; - NAPI_CALL(env, napi_unwrap(env, thisVar, (void**)&muri)); + NAPI_CALL(env, napi_unwrap(env, thisVar, reinterpret_cast(&muri))); std::string temp = muri->GetPath(); size_t templen = temp.size(); NAPI_CALL(env, napi_create_string_utf8(env, temp.c_str(), templen, &result)); @@ -226,7 +226,7 @@ namespace OHOS::Uri { napi_value result = nullptr; NAPI_CALL(env, napi_get_cb_info(env, info, nullptr, nullptr, &thisVar, nullptr)); Uri *muri = nullptr; - NAPI_CALL(env, napi_unwrap(env, thisVar, (void**)&muri)); + NAPI_CALL(env, napi_unwrap(env, thisVar, reinterpret_cast(&muri))); std::string temp = muri->GetQuery(); size_t templen = temp.size(); NAPI_CALL(env, napi_create_string_utf8(env, temp.c_str(), templen, &result)); @@ -239,7 +239,7 @@ namespace OHOS::Uri { napi_value result = nullptr; NAPI_CALL(env, napi_get_cb_info(env, info, nullptr, nullptr, &thisVar, nullptr)); Uri *muri = nullptr; - NAPI_CALL(env, napi_unwrap(env, thisVar, (void**)&muri)); + NAPI_CALL(env, napi_unwrap(env, thisVar, reinterpret_cast(&muri))); std::string temp = muri->GetFragment(); size_t templen = temp.size(); NAPI_CALL(env, napi_create_string_utf8(env, temp.c_str(), templen, &result)); diff --git a/url/native_module_url.cpp b/url/native_module_url.cpp index 57fc077dffa10be2db1deee22ed75e14188a8595..75cf918a592962293553f7e86cdacb7d40030e5e 100755 --- a/url/native_module_url.cpp +++ b/url/native_module_url.cpp @@ -60,7 +60,7 @@ namespace OHOS::Url { object = new URL(env, input, base); } else if (valuetype2 == napi_object) { URL *temp = nullptr; - napi_unwrap(env, argv[1], (void**)&temp); + napi_unwrap(env, argv[1], reinterpret_cast(&temp)); object = new URL(env, input, *temp); } else { HILOG_INFO("secondParameter error"); @@ -118,7 +118,7 @@ namespace OHOS::Url { napi_value thisVar = nullptr; NAPI_CALL(env, napi_get_cb_info(env, info, nullptr, nullptr, &thisVar, nullptr)); URL *murl = nullptr; - NAPI_CALL(env, napi_unwrap(env, thisVar, (void**)&murl)); + NAPI_CALL(env, napi_unwrap(env, thisVar, reinterpret_cast(&murl))); napi_value retVal = murl->GetHostname(); return retVal; } @@ -128,7 +128,7 @@ namespace OHOS::Url { napi_value thisVar = nullptr; NAPI_CALL(env, napi_get_cb_info(env, info, nullptr, nullptr, &thisVar, nullptr)); URL *murl = nullptr; - NAPI_CALL(env, napi_unwrap(env, thisVar, (void**)&murl)); + NAPI_CALL(env, napi_unwrap(env, thisVar, reinterpret_cast(&murl))); napi_value retVal = murl->GetSearch(); return retVal; } @@ -138,7 +138,7 @@ namespace OHOS::Url { napi_value thisVar = nullptr; NAPI_CALL(env, napi_get_cb_info(env, info, nullptr, nullptr, &thisVar, nullptr)); URL *murl = nullptr; - NAPI_CALL(env, napi_unwrap(env, thisVar, (void**)&murl)); + NAPI_CALL(env, napi_unwrap(env, thisVar, reinterpret_cast(&murl))); napi_value retVal = murl->GetUsername(); return retVal; } @@ -148,7 +148,7 @@ namespace OHOS::Url { napi_value thisVar = nullptr; NAPI_CALL(env, napi_get_cb_info(env, info, nullptr, nullptr, &thisVar, nullptr)); URL *murl = nullptr; - NAPI_CALL(env, napi_unwrap(env, thisVar, (void**)&murl)); + NAPI_CALL(env, napi_unwrap(env, thisVar, reinterpret_cast(&murl))); napi_value retVal = murl->GetPassword(); return retVal; } @@ -158,7 +158,7 @@ namespace OHOS::Url { napi_value thisVar = nullptr; NAPI_CALL(env, napi_get_cb_info(env, info, nullptr, nullptr, &thisVar, nullptr)); URL *murl = nullptr; - NAPI_CALL(env, napi_unwrap(env, thisVar, (void**)&murl)); + NAPI_CALL(env, napi_unwrap(env, thisVar, reinterpret_cast(&murl))); napi_value retVal = murl->GetFragment(); return retVal; } @@ -168,7 +168,7 @@ namespace OHOS::Url { napi_value thisVar = nullptr; NAPI_CALL(env, napi_get_cb_info(env, info, nullptr, nullptr, &thisVar, nullptr)); URL *murl = nullptr; - NAPI_CALL(env, napi_unwrap(env, thisVar, (void**)&murl)); + NAPI_CALL(env, napi_unwrap(env, thisVar, reinterpret_cast(&murl))); napi_value retVal = murl->GetScheme(); return retVal; } @@ -178,7 +178,7 @@ namespace OHOS::Url { napi_value thisVar = nullptr; NAPI_CALL(env, napi_get_cb_info(env, info, nullptr, nullptr, &thisVar, nullptr)); URL *murl = nullptr; - NAPI_CALL(env, napi_unwrap(env, thisVar, (void**)&murl)); + NAPI_CALL(env, napi_unwrap(env, thisVar, reinterpret_cast(&murl))); napi_value retVal = murl->GetPort(); return retVal; } @@ -188,7 +188,7 @@ namespace OHOS::Url { napi_value thisVar = nullptr; NAPI_CALL(env, napi_get_cb_info(env, info, nullptr, nullptr, &thisVar, nullptr)); URL *murl = nullptr; - NAPI_CALL(env, napi_unwrap(env, thisVar, (void**)&murl)); + NAPI_CALL(env, napi_unwrap(env, thisVar, reinterpret_cast(&murl))); napi_value retVal = murl->GetHost(); return retVal; } @@ -198,7 +198,7 @@ namespace OHOS::Url { napi_value thisVar = nullptr; NAPI_CALL(env, napi_get_cb_info(env, info, nullptr, nullptr, &thisVar, nullptr)); URL *murl = nullptr; - NAPI_CALL(env, napi_unwrap(env, thisVar, (void**)&murl)); + NAPI_CALL(env, napi_unwrap(env, thisVar, reinterpret_cast(&murl))); napi_value retVal = murl->GetPath(); return retVal; } @@ -208,7 +208,7 @@ namespace OHOS::Url { napi_value thisVar = nullptr; NAPI_CALL(env, napi_get_cb_info(env, info, nullptr, nullptr, &thisVar, nullptr)); URL *murl = nullptr; - NAPI_CALL(env, napi_unwrap(env, thisVar, (void**)&murl)); + NAPI_CALL(env, napi_unwrap(env, thisVar, reinterpret_cast(&murl))); napi_value retVal = murl->GetOnOrOff(); return retVal; } @@ -218,7 +218,7 @@ namespace OHOS::Url { napi_value thisVar = nullptr; NAPI_CALL(env, napi_get_cb_info(env, info, nullptr, nullptr, &thisVar, nullptr)); URL *murl = nullptr; - NAPI_CALL(env, napi_unwrap(env, thisVar, (void**)&murl)); + NAPI_CALL(env, napi_unwrap(env, thisVar, reinterpret_cast(&murl))); napi_value retVal = murl->GetIsIpv6(); return retVal; } @@ -243,7 +243,7 @@ namespace OHOS::Url { type = nullptr; } URL *murl = nullptr; - NAPI_CALL(env, napi_unwrap(env, thisVar, (void**)&murl)); + NAPI_CALL(env, napi_unwrap(env, thisVar, reinterpret_cast(&murl))); murl->SetHref(input); napi_value result = nullptr; NAPI_CALL(env, napi_get_undefined(env, &result)); @@ -270,7 +270,7 @@ namespace OHOS::Url { type = nullptr; } URL *murl = nullptr; - NAPI_CALL(env, napi_unwrap(env, thisVar, (void**)&murl)); + NAPI_CALL(env, napi_unwrap(env, thisVar, reinterpret_cast(&murl))); murl->SetHostname(input); napi_value result = nullptr; NAPI_CALL(env, napi_get_undefined(env, &result)); @@ -297,7 +297,7 @@ namespace OHOS::Url { type = nullptr; } URL *murl = nullptr; - NAPI_CALL(env, napi_unwrap(env, thisVar, (void**)&murl)); + NAPI_CALL(env, napi_unwrap(env, thisVar, reinterpret_cast(&murl))); murl->SetPort(input); napi_value result = nullptr; NAPI_CALL(env, napi_get_undefined(env, &result)); @@ -324,7 +324,7 @@ namespace OHOS::Url { type = nullptr; } URL *murl = nullptr; - NAPI_CALL(env, napi_unwrap(env, thisVar, (void**)&murl)); + NAPI_CALL(env, napi_unwrap(env, thisVar, reinterpret_cast(&murl))); murl->SetHost(input); napi_value result = nullptr; NAPI_CALL(env, napi_get_undefined(env, &result)); @@ -351,7 +351,7 @@ namespace OHOS::Url { type = nullptr; } URL *murl = nullptr; - NAPI_CALL(env, napi_unwrap(env, thisVar, (void**)&murl)); + NAPI_CALL(env, napi_unwrap(env, thisVar, reinterpret_cast(&murl))); murl->SetSearch(input); napi_value result = nullptr; NAPI_CALL(env, napi_get_undefined(env, &result)); @@ -378,7 +378,7 @@ namespace OHOS::Url { type = nullptr; } URL *murl = nullptr; - NAPI_CALL(env, napi_unwrap(env, thisVar, (void**)&murl)); + NAPI_CALL(env, napi_unwrap(env, thisVar, reinterpret_cast(&murl))); murl->SetScheme(input); napi_value result = nullptr; NAPI_CALL(env, napi_get_undefined(env, &result)); @@ -405,7 +405,7 @@ namespace OHOS::Url { type = nullptr; } URL *murl = nullptr; - NAPI_CALL(env, napi_unwrap(env, thisVar, (void**)&murl)); + NAPI_CALL(env, napi_unwrap(env, thisVar, reinterpret_cast(&murl))); murl->SetFragment(input); napi_value result = nullptr; NAPI_CALL(env, napi_get_undefined(env, &result)); @@ -432,7 +432,7 @@ namespace OHOS::Url { type = nullptr; } URL *murl = nullptr; - NAPI_CALL(env, napi_unwrap(env, thisVar, (void**)&murl)); + NAPI_CALL(env, napi_unwrap(env, thisVar, reinterpret_cast(&murl))); murl->SetUsername(input); napi_value result = nullptr; NAPI_CALL(env, napi_get_undefined(env, &result)); @@ -459,7 +459,7 @@ namespace OHOS::Url { type = nullptr; } URL *murl = nullptr; - NAPI_CALL(env, napi_unwrap(env, thisVar, (void**)&murl)); + NAPI_CALL(env, napi_unwrap(env, thisVar, reinterpret_cast(&murl))); murl->SetPath(input); napi_value result = nullptr; NAPI_CALL(env, napi_get_undefined(env, &result)); @@ -486,7 +486,7 @@ namespace OHOS::Url { type = nullptr; } URL *murl = nullptr; - NAPI_CALL(env, napi_unwrap(env, thisVar, (void**)&murl)); + NAPI_CALL(env, napi_unwrap(env, thisVar, reinterpret_cast(&murl))); murl->SetPassword(input); napi_value result = nullptr; NAPI_CALL(env, napi_get_undefined(env, &result)); @@ -537,7 +537,7 @@ namespace OHOS::Url { } } URLSearchParams *murl = nullptr; - NAPI_CALL(env, napi_unwrap(env, thisVar, (void**)&murl)); + NAPI_CALL(env, napi_unwrap(env, thisVar, reinterpret_cast(&murl))); murl->SetArray(vec); napi_value result = nullptr; NAPI_CALL(env, napi_get_undefined(env, &result)); @@ -549,7 +549,7 @@ namespace OHOS::Url { napi_value thisVar = nullptr; NAPI_CALL(env, napi_get_cb_info(env, info, nullptr, nullptr, &thisVar, nullptr)); URLSearchParams *murl = nullptr; - NAPI_CALL(env, napi_unwrap(env, thisVar, (void**)&murl)); + NAPI_CALL(env, napi_unwrap(env, thisVar, reinterpret_cast(&murl))); napi_value retVal = murl->GetArray(); return retVal; } @@ -565,7 +565,7 @@ namespace OHOS::Url { return nullptr; } URLSearchParams *object = nullptr; - napi_unwrap(env, thisVar, (void**)&object); + napi_unwrap(env, thisVar, reinterpret_cast(&object)); napi_value result = object->Get(args); return result; } @@ -581,7 +581,7 @@ namespace OHOS::Url { return nullptr; } URLSearchParams *object = nullptr; - napi_unwrap(env, thisVar, (void**)&object); + napi_unwrap(env, thisVar, reinterpret_cast(&object)); napi_value result = object->GetAll(args); return result; } @@ -598,7 +598,7 @@ namespace OHOS::Url { return nullptr; } URLSearchParams *object = nullptr; - napi_unwrap(env, thisVar, (void**)&object); + napi_unwrap(env, thisVar, reinterpret_cast(&object)); object->Append(args[0], args[1]); return nullptr; } @@ -614,7 +614,7 @@ namespace OHOS::Url { return nullptr; } URLSearchParams *object = nullptr; - napi_unwrap(env, thisVar, (void**)&object); + napi_unwrap(env, thisVar, reinterpret_cast(&object)); object->Delete(args); return nullptr; } @@ -626,7 +626,7 @@ namespace OHOS::Url { napi_value args = nullptr; napi_get_cb_info(env, info, &argc, &args, &thisVar, nullptr); URLSearchParams *object = nullptr; - napi_unwrap(env, thisVar, (void**)&object); + napi_unwrap(env, thisVar, reinterpret_cast(&object)); object->ForEach(args, thisVar); return nullptr; } @@ -638,7 +638,7 @@ namespace OHOS::Url { napi_value args = nullptr; napi_get_cb_info(env, info, &argc, &args, &thisVar, nullptr); URLSearchParams *object = nullptr; - napi_unwrap(env, thisVar, (void**)&object); + napi_unwrap(env, thisVar, reinterpret_cast(&object)); napi_value result = object->Entries(); return result; } @@ -650,7 +650,7 @@ namespace OHOS::Url { napi_value args = nullptr; NAPI_CALL(env, napi_get_cb_info(env, info, &argc, &args, &thisVar, nullptr)); URLSearchParams *object = nullptr; - NAPI_CALL(env, napi_unwrap(env, thisVar, (void**)&object)); + NAPI_CALL(env, napi_unwrap(env, thisVar, reinterpret_cast(&object))); napi_value result = object->IsHas(args); return result; } @@ -662,7 +662,7 @@ namespace OHOS::Url { napi_value args[2] = { 0 }; napi_get_cb_info(env, info, &argc, args, &thisVar, nullptr); URLSearchParams *object = nullptr; - napi_unwrap(env, thisVar, (void**)&object); + napi_unwrap(env, thisVar, reinterpret_cast(&object)); object->Set(args[0], args[1]); return nullptr; } @@ -674,7 +674,7 @@ namespace OHOS::Url { napi_value args = nullptr; napi_get_cb_info(env, info, &argc, &args, &thisVar, nullptr); URLSearchParams *object = nullptr; - napi_unwrap(env, thisVar, (void**)&object); + napi_unwrap(env, thisVar, reinterpret_cast(&object)); object->Sort(); return nullptr; } @@ -686,7 +686,7 @@ namespace OHOS::Url { napi_value args = nullptr; napi_get_cb_info(env, info, &argc, &args, &thisVar, nullptr); URLSearchParams *object = nullptr; - napi_unwrap(env, thisVar, (void**)&object); + napi_unwrap(env, thisVar, reinterpret_cast(&object)); napi_value result = object->ToString(); return result; } @@ -698,7 +698,7 @@ namespace OHOS::Url { napi_value args = nullptr; napi_get_cb_info(env, info, &argc, &args, &thisVar, nullptr); URLSearchParams *object = nullptr; - napi_unwrap(env, thisVar, (void**)&object); + napi_unwrap(env, thisVar, reinterpret_cast(&object)); napi_value result = object->IterByKeys(); return result; } @@ -710,7 +710,7 @@ namespace OHOS::Url { napi_value args = nullptr; napi_get_cb_info(env, info, &argc, &args, &thisVar, nullptr); URLSearchParams *object = nullptr; - napi_unwrap(env, thisVar, (void**)&object); + napi_unwrap(env, thisVar, reinterpret_cast(&object)); napi_value result = object->IterByValues(); return result; }