!14461 codecheck整改

Merge pull request !14461 from ustc-tianyu/cherry-pick-1724896780
This commit is contained in:
openharmony_ci 2024-08-29 09:24:27 +00:00 committed by Gitee
commit 046647b8f5
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 11 additions and 11 deletions

View File

@ -297,7 +297,7 @@ napi_value JsBrush::SetColorFilter(napi_env env, napi_callback_info info)
CHECK_PARAM_NUMBER_WITHOUT_OPTIONAL_PARAMS(argv, ARGC_ONE);
JsColorFilter* jsColorFilter = nullptr;
napi_unwrap(env, argv[0], reinterpret_cast<void **>(&jsColorFilter));
GET_UNWRAP_PARAM_OR_NULL(ARGC_ZERO, jsColorFilter);
Filter filter = brush->GetFilter();
filter.SetColorFilter(jsColorFilter ? jsColorFilter->GetColorFilter() : nullptr);
@ -340,7 +340,7 @@ napi_value JsBrush::SetImageFilter(napi_env env, napi_callback_info info)
CHECK_PARAM_NUMBER_WITHOUT_OPTIONAL_PARAMS(argv, ARGC_ONE);
JsImageFilter* jsImageFilter = nullptr;
napi_unwrap(env, argv[ARGC_ZERO], reinterpret_cast<void **>(&jsImageFilter));
GET_UNWRAP_PARAM_OR_NULL(ARGC_ZERO, jsImageFilter);
Filter filter = brush->GetFilter();
filter.SetImageFilter(jsImageFilter != nullptr ? jsImageFilter->GetImageFilter() : nullptr);
@ -365,7 +365,7 @@ napi_value JsBrush::SetMaskFilter(napi_env env, napi_callback_info info)
CHECK_PARAM_NUMBER_WITHOUT_OPTIONAL_PARAMS(argv, ARGC_ONE);
JsMaskFilter* jsMaskFilter = nullptr;
napi_unwrap(env, argv[ARGC_ZERO], reinterpret_cast<void **>(&jsMaskFilter));
GET_UNWRAP_PARAM_OR_NULL(ARGC_ZERO, jsMaskFilter);
Filter filter = brush->GetFilter();
filter.SetMaskFilter(jsMaskFilter ? jsMaskFilter->GetMaskFilter() : nullptr);
@ -412,7 +412,7 @@ napi_value JsBrush::SetShadowLayer(napi_env env, napi_callback_info info)
CHECK_PARAM_NUMBER_WITHOUT_OPTIONAL_PARAMS(argv, ARGC_ONE);
JsShadowLayer* jsShadowLayer = nullptr;
napi_unwrap(env, argv[ARGC_ZERO], reinterpret_cast<void **>(&jsShadowLayer));
GET_UNWRAP_PARAM_OR_NULL(ARGC_ZERO, jsShadowLayer);
brush->SetLooper(jsShadowLayer ? jsShadowLayer->GetBlurDrawLooper() : nullptr);
return nullptr;

View File

@ -308,7 +308,7 @@ napi_value JsPen::SetColorFilter(napi_env env, napi_callback_info info)
CHECK_PARAM_NUMBER_WITHOUT_OPTIONAL_PARAMS(argv, ARGC_ONE);
JsColorFilter* jsColorFilter = nullptr;
napi_unwrap(env, argv[0], reinterpret_cast<void **>(&jsColorFilter));
GET_UNWRAP_PARAM_OR_NULL(ARGC_ZERO, jsColorFilter);
Filter filter = pen->GetFilter();
filter.SetColorFilter(jsColorFilter ? jsColorFilter->GetColorFilter() : nullptr);
@ -351,7 +351,7 @@ napi_value JsPen::SetImageFilter(napi_env env, napi_callback_info info)
CHECK_PARAM_NUMBER_WITHOUT_OPTIONAL_PARAMS(argv, ARGC_ONE);
JsImageFilter* jsImageFilter = nullptr;
napi_unwrap(env, argv[ARGC_ZERO], reinterpret_cast<void **>(&jsImageFilter));
GET_UNWRAP_PARAM_OR_NULL(ARGC_ZERO, jsImageFilter);
Filter filter = pen->GetFilter();
filter.SetImageFilter(jsImageFilter != nullptr ? jsImageFilter->GetImageFilter() : nullptr);
@ -376,7 +376,7 @@ napi_value JsPen::SetMaskFilter(napi_env env, napi_callback_info info)
CHECK_PARAM_NUMBER_WITHOUT_OPTIONAL_PARAMS(argv, ARGC_ONE);
JsMaskFilter* jsMaskFilter = nullptr;
napi_unwrap(env, argv[ARGC_ZERO], reinterpret_cast<void **>(&jsMaskFilter));
GET_UNWRAP_PARAM_OR_NULL(ARGC_ZERO, jsMaskFilter);
Filter filter = pen->GetFilter();
filter.SetMaskFilter(jsMaskFilter ? jsMaskFilter->GetMaskFilter() : nullptr);
@ -527,7 +527,7 @@ napi_value JsPen::SetPathEffect(napi_env env, napi_callback_info info)
CHECK_PARAM_NUMBER_WITHOUT_OPTIONAL_PARAMS(argv, ARGC_ONE);
JsPathEffect* jsPathEffect = nullptr;
napi_unwrap(env, argv[ARGC_ZERO], reinterpret_cast<void **>(&jsPathEffect));
GET_UNWRAP_PARAM_OR_NULL(ARGC_ZERO, jsPathEffect);
pen->SetPathEffect(jsPathEffect ? jsPathEffect->GetPathEffect() : nullptr);
return nullptr;
@ -550,7 +550,7 @@ napi_value JsPen::SetShadowLayer(napi_env env, napi_callback_info info)
CHECK_PARAM_NUMBER_WITHOUT_OPTIONAL_PARAMS(argv, ARGC_ONE);
JsShadowLayer* jsShadowLayer = nullptr;
napi_unwrap(env, argv[ARGC_ZERO], reinterpret_cast<void **>(&jsShadowLayer));
GET_UNWRAP_PARAM_OR_NULL(ARGC_ZERO, jsShadowLayer);
pen->SetLooper(jsShadowLayer ? jsShadowLayer->GetBlurDrawLooper() : nullptr);
return nullptr;

View File

@ -67,8 +67,8 @@ napi_value JsRoundRect::Constructor(napi_env env, napi_callback_info info)
CHECK_PARAM_NUMBER_WITHOUT_OPTIONAL_PARAMS(argv, ARGC_THREE);
napi_valuetype valueType = napi_undefined;
if (argv[0] == nullptr || napi_typeof(env, argv[0], &valueType) != napi_ok || valueType != napi_object) {
ROSEN_LOGE("JsRoundRect::Constructor Argv[0] is invalid");
return NapiGetUndefined(env);
return NapiThrowError(env, DrawingErrorCode::ERROR_INVALID_PARAM,
"JsRoundRect::Constructor Argv[0] is invalid.");
}
double ltrb[ARGC_FOUR] = {0};