Feat: 安全告警代码整改0614

Signed-off-by: yangziyong <nsyangziyong@huawei.com>
Change-Id: Ia10fb3aa3ae15ca6c313e70801966b8025e0401d
This commit is contained in:
yangziyong 2024-06-15 13:40:48 +08:00
parent 776e8612f7
commit 5ff5035249
14 changed files with 16 additions and 15 deletions

View File

@ -511,7 +511,7 @@ bool JsiCallbackInfo::GetDoubleArrayArg(size_t index, std::vector<double>& value
return false;
}
auto arrayRef = Local<ArrayRef>(arg);
int32_t length = arrayRef->Length(info_->GetVM());
uint32_t length = arrayRef->Length(info_->GetVM());
valueArr.reserve(length);
for (int32_t i = 0; i < length; ++i) {
auto jsDouble = panda::ArrayRef::GetValueAt(info_->GetVM(), arrayRef, i);

View File

@ -50,7 +50,7 @@ ArkUINativeModuleValue ParticleBridge::SetDisturbanceField(ArkUIRuntimeCallInfo*
ArkTSUtils::ParseJsInteger(vm, strength, strengthValue);
dataVector[index * DISTURBANCE_FIELD_SIZE + STEP_0].f32 = static_cast<float>(strengthValue);
Local<JSValueRef> shape = panda::ArrayRef::GetValueAt(vm, array, index * DISTURBANCE_FIELD_SIZE + STEP_1);
uint32_t shapeValue = 0;
int32_t shapeValue = 0;
ArkTSUtils::ParseJsInteger(vm, shape, shapeValue);
dataVector[index * DISTURBANCE_FIELD_SIZE + STEP_1].i32 = shapeValue;
Local<JSValueRef> sizeWidth = panda::ArrayRef::GetValueAt(vm, array, index * DISTURBANCE_FIELD_SIZE + STEP_2);

View File

@ -158,7 +158,7 @@ ArkUINativeModuleValue RelativeContainerBridge::SetBarrier(ArkUIRuntimeCallInfo*
}
if (referencedIdVal->IsArray(vm)) {
auto array = panda::Local<panda::ArrayRef>(referencedIdVal);
int32_t referenceSize = array->Length(vm);
uint32_t referenceSize = array->Length(vm);
std::vector<ArkUI_CharPtr> referencedIds;
ParseReferencedId(vm, referenceSize, array, referencedIds);
info.referencedId = referencedIds.data();

View File

@ -54,7 +54,7 @@ DataPanelModel* DataPanelModel::GetInstance()
} // namespace OHOS::Ace
namespace OHOS::Ace::Framework {
namespace {
constexpr int32_t TYPE_CYCLE = 0;
constexpr uint32_t TYPE_CYCLE = 0;
bool CheckJSCallbackInfo(
const std::string& callerName, const JSCallbackInfo& info, std::vector<JSCallbackInfoType>& infoTypes)
@ -105,7 +105,7 @@ bool CheckJSCallbackInfo(
}
constexpr size_t MAX_COUNT = 9;
int32_t JSDataPanel::dataPanelType_ = 0;
uint32_t JSDataPanel::dataPanelType_ = 0;
void JSDataPanel::JSBind(BindingTarget globalObj)
{

View File

@ -34,7 +34,7 @@ private:
static bool ConvertGradientColor(const JsiRef<JsiValue>& itemParam, OHOS::Ace::NG::Gradient& gradient);
static bool ConvertResourceColor(const JsiRef<JsiValue>& itemParam, OHOS::Ace::NG::Gradient& gradient);
static void ConvertThemeColor(std::vector<OHOS::Ace::NG::Gradient>& colors);
static int32_t dataPanelType_;
static uint32_t dataPanelType_;
};
} // namespace OHOS::Ace::Framework
#endif // FRAMEWORKS_BRIDGE_DECLARATIVE_FRONTEND_JS_VIEW_JS_DATA_PANEL_H

View File

@ -1241,7 +1241,7 @@ void JSParagraphStyleSpan::ParseJsWordBreak(const JSRef<JSObject>& obj, SpanPara
return;
}
JSRef<JSVal> args = obj->GetProperty("wordBreak");
uint32_t index = WORD_BREAK_TYPES_DEFAULT;
int32_t index = WORD_BREAK_TYPES_DEFAULT;
if (args->IsNumber()) {
index = args->ToNumber<int32_t>();
}

View File

@ -234,7 +234,7 @@ void EventManager::RecordHitEmptyMessage(
auto hitEmptyMessage = JsonUtil::Create(true);
auto container = Container::Current();
CHECK_NULL_VOID(container);
auto windowId = 0;
uint32_t windowId = 0;
#ifdef WINDOW_SCENE_SUPPORTED
windowId = NG::WindowSceneHelper::GetWindowIdForWindowScene(frameNode);
#endif

View File

@ -4504,7 +4504,8 @@ void WebDelegate::OnPermissionRequestPrompt(const std::shared_ptr<OHOS::NWeb::NW
[weak = WeakClaim(this), request]() {
auto delegate = weak.Upgrade();
CHECK_NULL_VOID(delegate);
if (request->ResourceAcessId() & OHOS::NWeb::NWebAccessRequest::Resources::CLIPBOARD_READ_WRITE) {
if (static_cast<uint32_t>(request->ResourceAcessId())
& OHOS::NWeb::NWebAccessRequest::Resources::CLIPBOARD_READ_WRITE) {
auto webPattern = delegate->webPattern_.Upgrade();
CHECK_NULL_VOID(webPattern);
auto clipboardCallback = webPattern->GetPermissionClipboardCallback();

View File

@ -552,7 +552,7 @@ void TextFieldContentModifier::ModifyDecorationInTextStyle(TextStyle& textStyle)
void TextFieldContentModifier::UpdateTextDecorationMeasureFlag(PropertyChangeFlag& flag)
{
if (textDecoration_.has_value() && textDecorationColor_.has_value() && textDecorationColorAlpha_) {
uint8_t alpha = static_cast<int>(std::floor(textDecorationColorAlpha_->Get() + ROUND_VALUE));
uint8_t alpha = static_cast<uint32_t>(std::floor(textDecorationColorAlpha_->Get() + ROUND_VALUE));
if (textDecoration_.value() == TextDecoration::UNDERLINE && alpha != textDecorationColor_.value().GetAlpha()) {
flag |= PROPERTY_UPDATE_MEASURE;
} else if (textDecoration_.value() == TextDecoration::NONE && alpha != 0.0) {

View File

@ -90,7 +90,7 @@ private:
bool needPaintSelect_ = false;
bool needPaintPreviewText = false;
PreviewTextStyle previewTextStyle_;
PreviewTextStyle previewTextStyle_ = PreviewTextStyle::NORMAL;
WeakPtr<Pattern> pattern_;
WeakPtr<ScrollBar> scrollBar_;
WeakPtr<ScrollEdgeEffect> edgeEffect_;

View File

@ -183,7 +183,7 @@ private:
#endif
std::u16string text_;
int32_t placeholderCnt_ = 0;
TextAlign textAlign_;
TextAlign textAlign_ = TextAlign::START;
static uint32_t destructCount;
std::list<size_t> placeholderPosition_;
bool hasExternalParagraph_ = false;

View File

@ -3519,7 +3519,7 @@ void SetDragPreviewOptions(ArkUINodeHandle node, ArkUIDragPreViewOptions dragPre
if (!dragPreviewOptions.isModeArray) {
ParseDragPreviewMode(option, dragPreviewOptions.mode, isAuto);
} else {
for (size_t i = 0; i < dragPreviewOptions.modeArrayLength; i++) {
for (int32_t i = 0; i < dragPreviewOptions.modeArrayLength; i++) {
ParseDragPreviewMode(option, dragPreviewOptions.modeArray[i], isAuto);
if (isAuto) {
break;

View File

@ -77,7 +77,7 @@ void SetListItemGroupChildrenMainSize(ArkUINodeHandle node, ArkUIListChildrenMai
{
auto* frameNode = reinterpret_cast<FrameNode*>(node);
CHECK_NULL_VOID(frameNode);
for (int i = 0; i < option->mainSize.size(); i++) {
for (uint32_t i = 0; i < option->mainSize.size(); i++) {
if (option->mainSize[i] > 0) {
option->mainSize[i] =
Dimension(option->mainSize[i], static_cast<OHOS::Ace::DimensionUnit>(unit)).ConvertToPx();

View File

@ -255,7 +255,7 @@ int32_t OH_ArkUI_ListChildrenMainSizeOption_UpdateSize(
float OH_ArkUI_ListChildrenMainSizeOption_GetMainSize(ArkUI_ListChildrenMainSize* option, int32_t index)
{
CHECK_NULL_RETURN(option, -1);
if (index < 0 || option->mainSize.size() - 1 < index) {
if (index < 0 || option->mainSize.size() - 1 < static_cast<uint32_t>(index)) {
return -1;
}
return option->mainSize[index];