From bc605581551444a594f9227650e39bf3f171f54a Mon Sep 17 00:00:00 2001 From: renhw Date: Wed, 19 Jan 2022 20:26:00 +0800 Subject: [PATCH] code type 01-18 Signed-off-by: renhw Change-Id: I2dd78cc1a139887c89cdedc893f1aa02826f8db3 --- interfaces/innerkits/dm/display_property.h | 1 - interfaces/innerkits/wm/wm_common.h | 2 -- interfaces/kits/napi/window/native_window_module.cpp | 2 +- interfaces/kits/napi/window_stage_module.cpp | 3 +-- wm/include/window_impl.h | 2 +- wm/include/window_input_channel.h | 4 ++-- wm/src/window_stub.cpp | 2 +- wmserver/include/window_manager_proxy.h | 2 +- wmserver/include/window_manager_stub.h | 3 ++- wmserver/src/window_inner_manager.cpp | 2 +- wmtest/frameworks/inative_test.h | 2 -- wmtest/test/wm_native_test.cpp | 9 +++++---- 12 files changed, 15 insertions(+), 19 deletions(-) diff --git a/interfaces/innerkits/dm/display_property.h b/interfaces/innerkits/dm/display_property.h index 7409c0d12d..74a2fd7325 100644 --- a/interfaces/innerkits/dm/display_property.h +++ b/interfaces/innerkits/dm/display_property.h @@ -31,7 +31,6 @@ public: int height_; float xDpi_; float yDpi_; - // Surface surface_; }; } // namespace OHOS::Rosen diff --git a/interfaces/innerkits/wm/wm_common.h b/interfaces/innerkits/wm/wm_common.h index 453007fd5d..3d9a4e0e37 100644 --- a/interfaces/innerkits/wm/wm_common.h +++ b/interfaces/innerkits/wm/wm_common.h @@ -16,8 +16,6 @@ #ifndef OHOS_ROSEN_WM_COMMON_H #define OHOS_ROSEN_WM_COMMON_H -#include - namespace OHOS { namespace Rosen { enum class WindowType : uint32_t { diff --git a/interfaces/kits/napi/window/native_window_module.cpp b/interfaces/kits/napi/window/native_window_module.cpp index 28f0e1cd7b..ca5189cdfb 100644 --- a/interfaces/kits/napi/window/native_window_module.cpp +++ b/interfaces/kits/napi/window/native_window_module.cpp @@ -15,11 +15,11 @@ #include -#include "native_window_module.h" #include "window.h" #include "window_scene.h" #include "wm_common.h" #include "wm_napi_common.h" +#include "native_window_module.h" namespace OHOS { namespace Rosen { diff --git a/interfaces/kits/napi/window_stage_module.cpp b/interfaces/kits/napi/window_stage_module.cpp index b6ad1d3a65..3b79e4c277 100644 --- a/interfaces/kits/napi/window_stage_module.cpp +++ b/interfaces/kits/napi/window_stage_module.cpp @@ -20,8 +20,7 @@ extern const char _binary_window_stage_js_end[]; extern const char _binary_window_stage_abc_start[]; extern const char _binary_window_stage_abc_end[]; -extern "C" __attribute__((constructor)) -void NAPI_application_WindowStage_AutoRegister() +extern "C" __attribute__((constructor)) void NAPI_application_WindowStage_AutoRegister() { auto moduleManager = NativeModuleManager::GetInstance(); NativeModule newModuleInfo = { diff --git a/wm/include/window_impl.h b/wm/include/window_impl.h index 4c748041b8..98590c0962 100644 --- a/wm/include/window_impl.h +++ b/wm/include/window_impl.h @@ -35,7 +35,7 @@ class WindowImpl : public Window { if (uiContent_ != nullptr) { \ uiContent_->uiContentCb(); \ } \ - } while (0); + } while (0) public: WindowImpl(const sptr& option); diff --git a/wm/include/window_input_channel.h b/wm/include/window_input_channel.h index c58acb6f95..7fa6dcc6aa 100644 --- a/wm/include/window_input_channel.h +++ b/wm/include/window_input_channel.h @@ -12,12 +12,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +#ifndef OHOS_WINDOW_INPUT_CHANNEL +#define OHOS_WINDOW_INPUT_CHANNEL #include #include "refbase.h" #include "vsync_station.h" -#ifndef OHOS_WINDOW_INPUT_CHANNEL -#define OHOS_WINDOW_INPUT_CHANNEL namespace OHOS { namespace Rosen { diff --git a/wm/src/window_stub.cpp b/wm/src/window_stub.cpp index 106f7165c1..dc23c5c701 100644 --- a/wm/src/window_stub.cpp +++ b/wm/src/window_stub.cpp @@ -36,7 +36,7 @@ int WindowStub::OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParce break; } case TRANS_ID_UPDATE_WINDOW_RECT: { - struct Rect rect{ data.ReadInt32(), data.ReadInt32(), data.ReadUint32(), data.ReadUint32() }; + struct Rect rect { data.ReadInt32(), data.ReadInt32(), data.ReadUint32(), data.ReadUint32() }; UpdateWindowRect(rect); break; } diff --git a/wmserver/include/window_manager_proxy.h b/wmserver/include/window_manager_proxy.h index c0f2d21d48..8a7e799265 100644 --- a/wmserver/include/window_manager_proxy.h +++ b/wmserver/include/window_manager_proxy.h @@ -16,8 +16,8 @@ #ifndef OHOS_WINDOW_MANAGER_PROXY_H #define OHOS_WINDOW_MANAGER_PROXY_H -#include "window_manager_interface.h" #include +#include "window_manager_interface.h" namespace OHOS { namespace Rosen { diff --git a/wmserver/include/window_manager_stub.h b/wmserver/include/window_manager_stub.h index 4fa7df0aa9..1d124af888 100644 --- a/wmserver/include/window_manager_stub.h +++ b/wmserver/include/window_manager_stub.h @@ -16,8 +16,9 @@ #ifndef OHOS_WINDOW_MANAGER_STUB_H #define OHOS_WINDOW_MANAGER_STUB_H -#include "window_manager_interface.h" #include +#include "window_manager_interface.h" + namespace OHOS { namespace Rosen { class WindowManagerStub : public IRemoteStub { diff --git a/wmserver/src/window_inner_manager.cpp b/wmserver/src/window_inner_manager.cpp index b8a90f29f8..ce4688f88e 100644 --- a/wmserver/src/window_inner_manager.cpp +++ b/wmserver/src/window_inner_manager.cpp @@ -236,4 +236,4 @@ void WindowInnerManager::Init() WLOGFI("Inner window manager thread create success"); } } -} \ No newline at end of file +} diff --git a/wmtest/frameworks/inative_test.h b/wmtest/frameworks/inative_test.h index 4a0ade056c..640dd9ff09 100644 --- a/wmtest/frameworks/inative_test.h +++ b/wmtest/frameworks/inative_test.h @@ -16,10 +16,8 @@ #ifndef OHOS_ROSEN_INATIVE_TEST_H #define OHOS_ROSEN_INATIVE_TEST_H -#include #include #include -#include namespace OHOS::Rosen { class INativeTest; diff --git a/wmtest/test/wm_native_test.cpp b/wmtest/test/wm_native_test.cpp index 6d63a5e21b..d325d84c6d 100644 --- a/wmtest/test/wm_native_test.cpp +++ b/wmtest/test/wm_native_test.cpp @@ -17,7 +17,7 @@ #include #include -#include +#include #include "window.h" #include "window_life_cycle_interface.h" #include "window_option.h" @@ -65,10 +65,11 @@ void WMNativeTest::Run(int32_t argc, const char **argv) return; } - while(true) { + while (true) { scene->GoForeground(); - sleep(3); + sleep(3); // Sleep for 3 seconds scene->GoBackground(); - sleep(3); + sleep(3); // Sleep for 3 seconds } } + -- Gitee