From ffd09aad91904ab2776b758e5752cc0e1bc36738 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 5 Aug 2026 19:29:02 +0530 Subject: [PATCH] More C autoformat --- glfw/x11_init.c | 5 +++-- kitty/iqsort.h | 3 +-- kitty/key_encoding.c | 20 +++++++++++++++----- kitty/simd-string-impl.h | 4 ++-- 4 files changed, 21 insertions(+), 11 deletions(-) diff --git a/glfw/x11_init.c b/glfw/x11_init.c index 58c6fc32a..f96350c33 100644 --- a/glfw/x11_init.c +++ b/glfw/x11_init.c @@ -99,8 +99,9 @@ detectEWMH(void) { #define ALL_ATOMS \ S(NET_WM_STATE) \ - S(NET_WM_STATE_ABOVE) S(NET_WM_STATE_BELOW) S(NET_WM_STATE_FULLSCREEN) S(NET_WM_STATE_MAXIMIZED_VERT) S(NET_WM_STATE_MAXIMIZED_HORZ) \ - S(NET_WM_STATE_DEMANDS_ATTENTION) S(NET_WM_STATE_SKIP_TASKBAR) S(NET_WM_STATE_SKIP_PAGER) S(NET_WM_STATE_STICKY) \ + S(NET_WM_STATE_ABOVE) \ + S(NET_WM_STATE_BELOW) S(NET_WM_STATE_FULLSCREEN) S(NET_WM_STATE_MAXIMIZED_VERT) S(NET_WM_STATE_MAXIMIZED_HORZ) S(NET_WM_STATE_DEMANDS_ATTENTION) \ + S(NET_WM_STATE_SKIP_TASKBAR) S(NET_WM_STATE_SKIP_PAGER) S(NET_WM_STATE_STICKY) \ \ S(NET_WM_FULLSCREEN_MONITORS) S(NET_WM_STRUT_PARTIAL) \ \ diff --git a/kitty/iqsort.h b/kitty/iqsort.h index 07fd2ef50..95c33dda4 100644 --- a/kitty/iqsort.h +++ b/kitty/iqsort.h @@ -208,8 +208,7 @@ typedef struct { if (_right_ptr - _lo <= _QSORT_MAX_THRESH) { \ if (_hi - _left_ptr <= _QSORT_MAX_THRESH) /* Ignore both small partitions. */ \ _QSORT_POP(_lo, _hi, _top); \ - else /* Ignore small left partition. */ \ - _lo = _left_ptr; \ + else /* Ignore small left partition. */ _lo = _left_ptr; \ } else if (_hi - _left_ptr <= _QSORT_MAX_THRESH) /* Ignore small right partition. */ \ _hi = _right_ptr; \ else if (_right_ptr - _lo > _hi - _left_ptr) { \ diff --git a/kitty/key_encoding.c b/kitty/key_encoding.c index 95418b194..3920c6081 100644 --- a/kitty/key_encoding.c +++ b/kitty/key_encoding.c @@ -108,14 +108,24 @@ serialize(const EncodingData *data, char *output, const char csi_trailer) { static uint32_t convert_kp_key_to_normal_key(uint32_t key_number) { - switch (key_number) { #define S(x) \ - case GLFW_FKEY_KP_##x: key_number = GLFW_FKEY_##x; break; - S(ENTER) - S(HOME) S(END) S(INSERT) S(DELETE) S(PAGE_UP) S(PAGE_DOWN) S(UP) S(DOWN) S(LEFT) S(RIGHT) + case GLFW_FKEY_KP_##x: key_number = GLFW_FKEY_##x; break + + switch (key_number) { + S(ENTER); + S(HOME); + S(END); + S(INSERT); + S(DELETE); + S(PAGE_UP); + S(PAGE_DOWN); + S(UP); + S(DOWN); + S(LEFT); + S(RIGHT); #undef S case GLFW_FKEY_KP_0: - case GLFW_FKEY_KP_9: key_number = '0' + (key_number - GLFW_FKEY_KP_0); break; + case GLFW_FKEY_KP_9: key_number = '0' + (key_number - GLFW_FKEY_KP_0); break; case GLFW_FKEY_KP_DECIMAL: key_number = '.'; break; case GLFW_FKEY_KP_DIVIDE: key_number = '/'; break; case GLFW_FKEY_KP_MULTIPLY: key_number = '*'; break; diff --git a/kitty/simd-string-impl.h b/kitty/simd-string-impl.h index c898d2a06..01a21aeae 100644 --- a/kitty/simd-string-impl.h +++ b/kitty/simd-string-impl.h @@ -170,8 +170,8 @@ w(right, one_byte, 1) w(right, two_bytes, 2) w(right, four_bytes, 4) w(right, ei #define reverse_numbered_bytes() \ simde_mm256_setr_epi8(31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0) -static inline int -FUNC(is_zero)(const integer_t a) { + static inline int + FUNC(is_zero)(const integer_t a) { return simde_mm256_testz_si256(a, a); }