From 7d7a34ef329fc99d870e92fc658f4872f2cc0973 Mon Sep 17 00:00:00 2001 From: Aki-7 Date: Sat, 15 Jul 2023 16:19:29 +0900 Subject: [PATCH] fix clang-tidy error --- zen/include/zen/xr-system.h | 6 +++--- zen/src/backend/immersive/remote/gl-buffer.cc | 2 +- .../backend/immersive/remote/xr-dispatcher.cc | 2 +- zen/src/backend/immersive/remote/xr-system.h | 6 +++--- zen/src/binding.c | 18 +++++++++--------- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/zen/include/zen/xr-system.h b/zen/include/zen/xr-system.h index 4bf63429..3d4a284a 100644 --- a/zen/include/zen/xr-system.h +++ b/zen/include/zen/xr-system.h @@ -61,9 +61,9 @@ zn_xr_system_connect(struct zn_xr_system *self) UNUSED static inline bool zn_xr_system_is_connected(struct zn_xr_system *self) { - uint32_t connected = ZN_XR_SYSTEM_SESSION_STATE_SYNCHRONIZED | - ZN_XR_SYSTEM_SESSION_STATE_VISIBLE | - ZN_XR_SYSTEM_SESSION_STATE_FOCUS; + const uint32_t connected = ZN_XR_SYSTEM_SESSION_STATE_SYNCHRONIZED | + ZN_XR_SYSTEM_SESSION_STATE_VISIBLE | + ZN_XR_SYSTEM_SESSION_STATE_FOCUS; return (self->state & connected) != 0; } diff --git a/zen/src/backend/immersive/remote/gl-buffer.cc b/zen/src/backend/immersive/remote/gl-buffer.cc index a696bba7..1525a6ec 100644 --- a/zen/src/backend/immersive/remote/gl-buffer.cc +++ b/zen/src/backend/immersive/remote/gl-buffer.cc @@ -63,7 +63,7 @@ GlBuffer::HandleData(struct zn_gl_buffer *c_obj, uint32_t target, { auto *self = static_cast(c_obj->impl_data); - ssize_t size = zn_buffer_get_size(buffer); + const ssize_t size = zn_buffer_get_size(buffer); auto loop = std::make_unique(wl_display_get_event_loop(self->display_)); diff --git a/zen/src/backend/immersive/remote/xr-dispatcher.cc b/zen/src/backend/immersive/remote/xr-dispatcher.cc index 4b4e63ea..565aa483 100644 --- a/zen/src/backend/immersive/remote/xr-dispatcher.cc +++ b/zen/src/backend/immersive/remote/xr-dispatcher.cc @@ -236,7 +236,7 @@ XrDispatcher::HandleGetNewGlShader( std::string source; { - ssize_t length = zn_buffer_get_size(buffer); + const ssize_t length = zn_buffer_get_size(buffer); auto *data = zn_buffer_begin_access(buffer); source = std::string(static_cast(data), length); zn_buffer_end_access(buffer); diff --git a/zen/src/backend/immersive/remote/xr-system.h b/zen/src/backend/immersive/remote/xr-system.h index 9a4c7d20..bf548179 100644 --- a/zen/src/backend/immersive/remote/xr-system.h +++ b/zen/src/backend/immersive/remote/xr-system.h @@ -77,9 +77,9 @@ XrSystem::is_alive() const inline bool XrSystem::is_connected() const { - uint32_t connected = ZN_XR_SYSTEM_SESSION_STATE_SYNCHRONIZED | - ZN_XR_SYSTEM_SESSION_STATE_VISIBLE | - ZN_XR_SYSTEM_SESSION_STATE_FOCUS; + const uint32_t connected = ZN_XR_SYSTEM_SESSION_STATE_SYNCHRONIZED | + ZN_XR_SYSTEM_SESSION_STATE_VISIBLE | + ZN_XR_SYSTEM_SESSION_STATE_FOCUS; return (c_obj_.state & connected) != 0; } diff --git a/zen/src/binding.c b/zen/src/binding.c index 0e5418d5..a619b1c5 100644 --- a/zen/src/binding.c +++ b/zen/src/binding.c @@ -9,15 +9,15 @@ #define CONFIG_SECTION_KEY "binding" -#define TOKEN_SHIFT "shift" -#define TOKEN_CTRL "ctrl" -#define TOKEN_ALT "alt" -#define TOKEN_LOGO "logo" -#define TOKEN_RIGHT "right" -#define TOKEN_LEFT "left" -#define TOKEN_UP "up" -#define TOKEN_DOWN "down" -#define TOKEN_SEPARATOR '+' +const char *const TOKEN_SHIFT = "shift"; +const char *const TOKEN_CTRL = "ctrl"; +const char *const TOKEN_ALT = "alt"; +const char *const TOKEN_LOGO = "logo"; +const char *const TOKEN_RIGHT = "right"; +const char *const TOKEN_LEFT = "left"; +const char *const TOKEN_UP = "up"; +const char *const TOKEN_DOWN = "down"; +const char TOKEN_SEPARATOR = '+'; static const uint32_t ascii_to_keycode[] = { ['a'] = KEY_A,