未验证 提交 cf6f5b0d 编写于 作者: O openharmony_ci 提交者: Gitee

!9379 fix xts_cppcheck

Merge pull request !9379 from 黄开兴/master
......@@ -57,7 +57,7 @@ napi_value ImageReceiverNDKTest::Init(napi_env env, napi_value exports)
napi_define_properties(env, exports, sizeof(props) / sizeof(props[0]), props);
return exports;
}
static bool CheckArgs(size_t count, napi_value* argValues, size_t exceptCount)
static bool CheckArgs(size_t count, const napi_value* argValues, size_t exceptCount)
{
if (count != exceptCount) {
return false;
......
......@@ -147,7 +147,7 @@ static bool checkType(napi_env env, napi_value arg, napi_valuetype type)
napi_typeof(env, arg, &argType);
return (type == argType);
}
static bool checkArgs(napi_value* argValue, size_t argCount, size_t want)
static bool checkArgs(const napi_value* argValue, size_t argCount, size_t want)
{
if (argCount < want) {
DEBUG_LOG("argCount %{public}zu < want %{public}zu", argCount, want);
......@@ -414,7 +414,7 @@ napi_value ImageSourceNDKTest::GetDelayTime(napi_env env, napi_callback_info inf
struct OhosImageSourceDelayTimeList timeList;
int32_t res = OH_ImageSource_GetDelayTime(native, &timeList);
if (timeList.size == SIZE_ZERO) {
if (timeList.size == SIZE_ZERO || res != OHOS_IMAGE_RESULT_SUCCESS) {
DEBUG_LOG("Delay time list get failed");
return createUndefine(env);
}
......@@ -471,7 +471,7 @@ napi_value ImageSourceNDKTest::GetSupportedFormats(napi_env env, napi_callback_i
{
struct OhosImageSourceSupportedFormatList formatList;
int32_t res = OH_ImageSource_GetSupportedFormats(&formatList);
if (formatList.size == SIZE_ZERO) {
if (formatList.size == SIZE_ZERO || res != OHOS_IMAGE_RESULT_SUCCESS) {
DEBUG_LOG("Supported format list get failed");
return createUndefine(env);
}
......@@ -497,7 +497,7 @@ napi_value ImageSourceNDKTest::GetSupportedFormats(napi_env env, napi_callback_i
return createResultValue(env, res, result);
}
static napi_value createImageInfoNVal(napi_env env, struct OhosImageSourceInfo &imageInfo)
static napi_value createImageInfoNVal(napi_env env, const struct OhosImageSourceInfo &imageInfo)
{
napi_value result = nullptr;
napi_create_object(env, &result);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册