From ca298f2b194bc55a0366fc70b6e9c50183269be3 Mon Sep 17 00:00:00 2001 From: youbing Date: Tue, 18 Oct 2022 16:50:53 +0800 Subject: [PATCH] Description: Code alarm processing#5 IssueNo: https://gitee.com/openharmony/graphic_ui/issues/I5WD6I Feature or Bugfix: Bugfix Binary Source:No Signed-off-by: youbing54 --- frameworks/graphic_math.cpp | 4 ++-- frameworks/hal_tick.cpp | 1 - interfaces/kits/gfx_utils/common_macros.h | 6 +++--- interfaces/kits/gfx_utils/graphic_math.h | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/frameworks/graphic_math.cpp b/frameworks/graphic_math.cpp index 6b3527e..4fc2b4b 100644 --- a/frameworks/graphic_math.cpp +++ b/frameworks/graphic_math.cpp @@ -57,9 +57,9 @@ float Sin(float angle) #endif } -float Fmod(float X, float Y) +float Fmod(float x, float y) { - return static_cast(X - static_cast(X / Y) * Y); + return static_cast(x - static_cast(x / y) * y); } float Cos(float angle) diff --git a/frameworks/hal_tick.cpp b/frameworks/hal_tick.cpp index 20ee327..c908364 100644 --- a/frameworks/hal_tick.cpp +++ b/frameworks/hal_tick.cpp @@ -21,7 +21,6 @@ #include #elif defined __linux__ || defined __LITEOS__ || defined __APPLE__ #include -#include "time.h" #else #include "los_tick.h" #endif diff --git a/interfaces/kits/gfx_utils/common_macros.h b/interfaces/kits/gfx_utils/common_macros.h index 630fd3a..6c19ca5 100644 --- a/interfaces/kits/gfx_utils/common_macros.h +++ b/interfaces/kits/gfx_utils/common_macros.h @@ -23,12 +23,12 @@ #define ALIGN_UP(sz, align) (((sz) + (align - 1)) & (-(align))) #define ALIGN_DOWN(sz, align) ((sz) & (-(align))) -#define _ADDR_ALIGN(ptr, sz, align) \ +#define ADDR_ALIGN(ptr, sz, align) \ do { \ uint32_t _sz = ALIGN_DOWN(sz, align); \ (ptr) = decltype(ptr)((uintptr_t)(void*)(ptr) + ((sz)-_sz)); \ (sz) = _sz; \ - } while (0); + } while (0) #define STRUCT_ALIGN(sz) alignas(sz) #ifdef ALIGNMENT_BYTES @@ -37,7 +37,7 @@ #endif #define UI_ALIGN_UP(size) ALIGN_UP((size), ALIGNMENT_BYTES) #define UI_ALIGN_DOWN(size) ALIGN_DOWN((size), ALIGNMENT_BYTES) -#define UI_ADDR_ALIGN(ptr, sz) _ADDR_ALIGN(ptr, sz, ALIGNMENT_BYTES) +#define UI_ADDR_ALIGN(ptr, sz) ADDR_ALIGN(ptr, sz, ALIGNMENT_BYTES) #define UI_STRUCT_ALIGN STRUCT_ALIGN(ALIGNMENT_BYTES) #else #define UI_ALIGN_UP(size) ALIGN_UP((size), 4U) diff --git a/interfaces/kits/gfx_utils/graphic_math.h b/interfaces/kits/gfx_utils/graphic_math.h index 9bf0f99..c4a707b 100644 --- a/interfaces/kits/gfx_utils/graphic_math.h +++ b/interfaces/kits/gfx_utils/graphic_math.h @@ -85,7 +85,7 @@ static constexpr int16_t ORDER_MATRIX_4 = 4; float Sin(float angle); float Cos(float angle); float Acos(float value); -float Fmod(float X, float Y); +float Fmod(float x, float y); uint16_t FastAtan2(int16_t x, int16_t y); float FastAtan2F(float x, float y); float Sqrt(float x);