Skip to content

Commit 7d7a34e

Browse files
committed
fix clang-tidy error
1 parent 1091611 commit 7d7a34e

5 files changed

Lines changed: 17 additions & 17 deletions

File tree

zen/include/zen/xr-system.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ zn_xr_system_connect(struct zn_xr_system *self)
6161
UNUSED static inline bool
6262
zn_xr_system_is_connected(struct zn_xr_system *self)
6363
{
64-
uint32_t connected = ZN_XR_SYSTEM_SESSION_STATE_SYNCHRONIZED |
65-
ZN_XR_SYSTEM_SESSION_STATE_VISIBLE |
66-
ZN_XR_SYSTEM_SESSION_STATE_FOCUS;
64+
const uint32_t connected = ZN_XR_SYSTEM_SESSION_STATE_SYNCHRONIZED |
65+
ZN_XR_SYSTEM_SESSION_STATE_VISIBLE |
66+
ZN_XR_SYSTEM_SESSION_STATE_FOCUS;
6767
return (self->state & connected) != 0;
6868
}
6969

zen/src/backend/immersive/remote/gl-buffer.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ GlBuffer::HandleData(struct zn_gl_buffer *c_obj, uint32_t target,
6363
{
6464
auto *self = static_cast<GlBuffer *>(c_obj->impl_data);
6565

66-
ssize_t size = zn_buffer_get_size(buffer);
66+
const ssize_t size = zn_buffer_get_size(buffer);
6767

6868
auto loop = std::make_unique<Loop>(wl_display_get_event_loop(self->display_));
6969

zen/src/backend/immersive/remote/xr-dispatcher.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ XrDispatcher::HandleGetNewGlShader(
236236
std::string source;
237237

238238
{
239-
ssize_t length = zn_buffer_get_size(buffer);
239+
const ssize_t length = zn_buffer_get_size(buffer);
240240
auto *data = zn_buffer_begin_access(buffer);
241241
source = std::string(static_cast<char *>(data), length);
242242
zn_buffer_end_access(buffer);

zen/src/backend/immersive/remote/xr-system.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@ XrSystem::is_alive() const
7777
inline bool
7878
XrSystem::is_connected() const
7979
{
80-
uint32_t connected = ZN_XR_SYSTEM_SESSION_STATE_SYNCHRONIZED |
81-
ZN_XR_SYSTEM_SESSION_STATE_VISIBLE |
82-
ZN_XR_SYSTEM_SESSION_STATE_FOCUS;
80+
const uint32_t connected = ZN_XR_SYSTEM_SESSION_STATE_SYNCHRONIZED |
81+
ZN_XR_SYSTEM_SESSION_STATE_VISIBLE |
82+
ZN_XR_SYSTEM_SESSION_STATE_FOCUS;
8383

8484
return (c_obj_.state & connected) != 0;
8585
}

zen/src/binding.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@
99

1010
#define CONFIG_SECTION_KEY "binding"
1111

12-
#define TOKEN_SHIFT "shift"
13-
#define TOKEN_CTRL "ctrl"
14-
#define TOKEN_ALT "alt"
15-
#define TOKEN_LOGO "logo"
16-
#define TOKEN_RIGHT "right"
17-
#define TOKEN_LEFT "left"
18-
#define TOKEN_UP "up"
19-
#define TOKEN_DOWN "down"
20-
#define TOKEN_SEPARATOR '+'
12+
const char *const TOKEN_SHIFT = "shift";
13+
const char *const TOKEN_CTRL = "ctrl";
14+
const char *const TOKEN_ALT = "alt";
15+
const char *const TOKEN_LOGO = "logo";
16+
const char *const TOKEN_RIGHT = "right";
17+
const char *const TOKEN_LEFT = "left";
18+
const char *const TOKEN_UP = "up";
19+
const char *const TOKEN_DOWN = "down";
20+
const char TOKEN_SEPARATOR = '+';
2121

2222
static const uint32_t ascii_to_keycode[] = {
2323
['a'] = KEY_A,

0 commit comments

Comments
 (0)