fix warning

Signed-off-by: bizhenhang <bizhenhang@huawei.com>
Change-Id: Ia681b83891ad2a305c38d2930120cc493d213de9
This commit is contained in:
bizhenhang 2024-07-20 13:56:37 +00:00
parent 6d3133d358
commit 5e18e4a4de
6 changed files with 21 additions and 20 deletions

View File

@ -1108,7 +1108,7 @@ bool RenderBox::HandleMouseEvent(const MouseEvent& event)
#else
LOGI("RenderBox::HandleMouseEvent: Do mouse callback with mouse event{ Global(%{public}f,%{public}f), "
"Local(%{public}f,%{public}f)}, Button(%{public}d), Action(%{public}d), Time(%{public}lld), "
"DeviceId(%{public}" PRId64 ", SourceType(%{public}d) }. Return: %{public}d",
"DeviceId(%{private}" PRId64 ", SourceType(%{public}d) }. Return: %{public}d",
info.GetGlobalLocation().GetX(), info.GetGlobalLocation().GetY(), info.GetLocalLocation().GetX(),
info.GetLocalLocation().GetY(), info.GetButton(), info.GetAction(),
info.GetTimeStamp().time_since_epoch().count(), info.GetDeviceId(), info.GetSourceDevice(),

View File

@ -36,50 +36,50 @@ public:
}
void SetXsSizeColumn(uint32_t xsSizeColumn, const Dimension& offset = UNDEFINED_DIMENSION)
{
columnInfo_->columns_[ScreenSizeType::XS] = xsSizeColumn;
columnInfo_->columns_[ScreenSizeType::XS] = static_cast<int32_t>(xsSizeColumn);
columnInfo_->dimOffsets_[ScreenSizeType::XS] = offset;
}
void SetSmSizeColumn(uint32_t smSizeColumn, const Dimension& offset = UNDEFINED_DIMENSION)
{
columnInfo_->columns_[ScreenSizeType::SM] = smSizeColumn;
columnInfo_->columns_[ScreenSizeType::SM] = static_cast<int32_t>(smSizeColumn);
columnInfo_->dimOffsets_[ScreenSizeType::SM] = offset;
}
void SetMdSizeColumn(uint32_t mdSizeColumn, const Dimension& offset = UNDEFINED_DIMENSION)
{
columnInfo_->columns_[ScreenSizeType::MD] = mdSizeColumn;
columnInfo_->columns_[ScreenSizeType::MD] = static_cast<int32_t>(mdSizeColumn);
columnInfo_->dimOffsets_[ScreenSizeType::MD] = offset;
}
void SetLgSizeColumn(uint32_t lgSizeColumn, const Dimension& offset = UNDEFINED_DIMENSION)
{
columnInfo_->columns_[ScreenSizeType::LG] = lgSizeColumn;
columnInfo_->columns_[ScreenSizeType::LG] = static_cast<int32_t>(lgSizeColumn);
columnInfo_->dimOffsets_[ScreenSizeType::LG] = offset;
}
void SetSizeColumn(GridSizeType type, uint32_t column, const Dimension& offset = UNDEFINED_DIMENSION)
{
columnInfo_->columns_[type] = column;
columnInfo_->columns_[type] = static_cast<int32_t>(column);
columnInfo_->dimOffsets_[type] = offset;
}
void SetSmSizeMaxColumn(uint32_t smSizeMaxColumn)
{
columnInfo_->maxColumns_[ScreenSizeType::SM] = smSizeMaxColumn;
columnInfo_->maxColumns_[ScreenSizeType::SM] = static_cast<int32_t>(smSizeMaxColumn);
}
void SetMdSizeMaxColumn(uint32_t mdSizeMaxColumn)
{
columnInfo_->maxColumns_[ScreenSizeType::MD] = mdSizeMaxColumn;
columnInfo_->maxColumns_[ScreenSizeType::MD] = static_cast<int32_t>(mdSizeMaxColumn);
}
void SetLgSizeMaxColumn(uint32_t lgSizeMaxColumn)
{
columnInfo_->maxColumns_[ScreenSizeType::LG] = lgSizeMaxColumn;
columnInfo_->maxColumns_[ScreenSizeType::LG] = static_cast<int32_t>(lgSizeMaxColumn);
}
void SetColumns(uint32_t columns)
{
columnInfo_->columns_[ScreenSizeType::UNDEFINED] = columns;
columnInfo_->columns_[ScreenSizeType::UNDEFINED] = static_cast<int32_t>(columns);
}
void ACE_EXPORT SetOffset(int32_t offset, GridSizeType type = GridSizeType::UNDEFINED);

View File

@ -61,6 +61,7 @@ const char PLAYER_ERROR_CODE_CREATEFAIL[] = "error_video_000001";
const char PLAYER_ERROR_MSG_CREATEFAIL[] = "Create player failed.";
const char PLAYER_ERROR_CODE_FILEINVALID[] = "error_video_000002";
const char PLAYER_ERROR_MSG_FILEINVALID[] = "File invalid.";
const int32_t DURATION_THOUSAND = 1000;
void Player::Create(const std::function<void(int64_t)>& onCreate)
{
@ -201,9 +202,9 @@ void Player::SetSurfaceId(int64_t id, bool isTexture)
void Player::OnPrepared(const std::string& param)
{
currentPos_ = 0;
width_ = GetIntParam(param, PLAYER_PARAM_WIDTH);
height_ = GetIntParam(param, PLAYER_PARAM_HEIGHT);
duration_ = GetIntParam(param, PLAYER_PARAM_DURATION) / 1000;
width_ = static_cast<uint32_t>(GetIntParam(param, PLAYER_PARAM_WIDTH));
height_ = static_cast<uint32_t>(GetIntParam(param, PLAYER_PARAM_HEIGHT));
duration_ = static_cast<uint32_t>(GetIntParam(param, PLAYER_PARAM_DURATION) / DURATION_THOUSAND);
isPlaying_ = GetIntParam(param, PLAYER_PARAM_ISPLAYING) == 1;
isNeedFreshForce_ = GetIntParam(param, PLAYER_PARAM_NEEDFRESHFORCE) == 1;
isPrepared_ = true;
@ -246,7 +247,7 @@ void Player::OnCompletion(const std::string& param)
void Player::OnSeekComplete(const std::string& param)
{
currentPos_ = GetIntParam(param, PLAYER_PARAM_CURRENTPOS);
currentPos_ = static_cast<uint32_t>(GetIntParam(param, PLAYER_PARAM_CURRENTPOS));
if (!onCurrentPosListener_.empty()) {
onCurrentPosListener_.back()(currentPos_);
}
@ -304,7 +305,7 @@ void Player::GetCurrentTime()
void Player::OnTimeGetted(const std::string& result)
{
currentPos_ = GetIntParam(result, PLAYER_PARAM_CURRENTPOS);
currentPos_ = static_cast<uint32_t>(GetIntParam(result, PLAYER_PARAM_CURRENTPOS));
if (!onCurrentPosListener_.empty()) {
onCurrentPosListener_.back()(currentPos_);
}

View File

@ -200,7 +200,7 @@ void VideoElement::InitStatus(const RefPtr<VideoComponent>& videoComponent)
if (isMediaPlayerFullStatus_) {
pastPlayingStatus_ = videoComponent->GetPastPlayingStatus();
if (startTime_ != 0) {
currentPos_ = startTime_;
currentPos_ = static_cast<uint32_t>(startTime_);
IntTimeToText(currentPos_, currentPosText_);
}
}
@ -1347,7 +1347,7 @@ void VideoElement::OnCurrentTimeChange(uint32_t currentPos)
#ifdef OHOS_STANDARD_SYSTEM
if (isMediaPlayerFullStatus_ && startTime_ != 0) {
if (GreatNotEqual(startTime_, currentPos)) {
currentPos = startTime_;
currentPos = static_cast<uint32_t>(startTime_);
}
}
if (currentPos == currentPos_ || isStop_) {
@ -1356,7 +1356,7 @@ void VideoElement::OnCurrentTimeChange(uint32_t currentPos)
if (duration_ == 0) {
int32_t duration = 0;
if (mediaPlayer_->GetDuration(duration) == 0) {
duration_ = duration / MILLISECONDS_TO_SECONDS;
duration_ = static_cast<int32_t>(duration / MILLISECONDS_TO_SECONDS);
IntTimeToText(duration_, durationText_);
}
}

View File

@ -431,7 +431,7 @@ private:
double x_ = 0.0;
double y_ = 0.0;
OH_NativeXComponent_TouchEvent touchEvent_;
OH_NativeXComponent_MouseEvent mouseEvent_;
OH_NativeXComponent_MouseEvent mouseEvent_ { .x = 0, .y = 0 };
OH_NativeXComponent_KeyEvent keyEvent_;
OH_NativeXComponent_Callback* callback_ = nullptr;
OH_NativeXComponent_MouseEvent_Callback* mouseEventCallback_ = nullptr;

View File

@ -127,7 +127,7 @@ private:
void SetTouchPoint(
const std::list<TouchLocationInfo>& touchInfoList, const int64_t timeStamp, const TouchType& touchType);
OH_NativeXComponent_TouchEventType ConvertNativeXComponentTouchEvent(const TouchType& touchType);
OH_NativeXComponent_TouchEvent touchEventPoint_;
OH_NativeXComponent_TouchEvent touchEventPoint_ { .screenX = 0, .screenY = 0 };
std::vector<XComponentTouchPoint> nativeXComponentTouchPoints_;
#ifdef OHOS_PLATFORM
int64_t startIncreaseTime_ = 0;