mirror of
https://github.com/openharmony/windowmanager.git
synced 2026-07-19 17:08:11 -04:00
qclean code warning
Signed-off-by: luwei <luwei51@huawei.com> Change-Id: I80fd28b6a668ffc674cadbdffd26f0a20a3b22cc
This commit is contained in:
@@ -13,11 +13,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "screenshot_test.h"
|
||||
|
||||
#include <securec.h>
|
||||
|
||||
#include "mock_display_manager_adapter.h"
|
||||
#include "singleton_mocker.h"
|
||||
#include "screenshot_test.h"
|
||||
|
||||
using namespace testing;
|
||||
using namespace testing::ext;
|
||||
@@ -67,10 +68,14 @@ static std::shared_ptr<Media::PixelMap> CreatePixelMap()
|
||||
}
|
||||
|
||||
uint8_t *pic = (uint8_t *)data;
|
||||
memset_s(pic, voulumeSize, pixelValue, voulumeSize);
|
||||
if (memset_s(pic, voulumeSize, pixelValue, voulumeSize) != EOK) {
|
||||
free(data);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint32_t colorLen = voulumeSize * bitmapDepth;
|
||||
auto pixelMap = Media::PixelMap::Create(data, colorLen, opt);
|
||||
free(data);
|
||||
if (pixelMap == nullptr) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -108,12 +108,12 @@ int32_t DisplayManagerStub::OnRemoteRequest(uint32_t code, MessageParcel &data,
|
||||
}
|
||||
case TRANS_ID_GET_DISPLAY_SNAPSHOT: {
|
||||
DisplayId displayId = data.ReadUint64();
|
||||
std::shared_ptr<Media::PixelMap> dispalySnapshot = GetDisplaySnapshot(displayId);
|
||||
if (dispalySnapshot == nullptr) {
|
||||
std::shared_ptr<Media::PixelMap> displaySnapshot = GetDisplaySnapshot(displayId);
|
||||
if (displaySnapshot == nullptr) {
|
||||
reply.WriteParcelable(nullptr);
|
||||
break;
|
||||
}
|
||||
reply.WriteParcelable(dispalySnapshot.get());
|
||||
reply.WriteParcelable(displaySnapshot.get());
|
||||
}
|
||||
case TRANS_ID_REGISTER_DISPLAY_MANAGER_AGENT: {
|
||||
auto agent = iface_cast<IDisplayManagerAgent>(data.ReadRemoteObject());
|
||||
|
||||
@@ -75,6 +75,6 @@ private:
|
||||
{ WindowType::WINDOW_TYPE_NAVIGATION_BAR, SystemBarProperty() },
|
||||
};
|
||||
};
|
||||
}
|
||||
}
|
||||
} // namespace Rosen
|
||||
} // namespace OHOS
|
||||
#endif // OHOS_ROSEN_WINDOW_OPTION_H
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2021-2022 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
@@ -172,6 +172,6 @@ const std::unordered_map<WindowType, SystemBarProperty>& WindowOption::GetSystem
|
||||
{
|
||||
return sysBarPropMap_;
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace Rosen
|
||||
} // namespace OHOS
|
||||
|
||||
|
||||
@@ -192,5 +192,5 @@ WindowSizeChangeReason WindowNode::GetWindowSizeChangeReason() const
|
||||
{
|
||||
return windowSizeChangeReason_;
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace Rosen
|
||||
} // namespace OHOS
|
||||
|
||||
Reference in New Issue
Block a user