mirror of
https://github.com/i3/i3.git
synced 2025-12-01 12:06:20 +00:00
Update to clang-format-20 (#6521)
This commit is contained in:
4
.github/workflows/main.yml
vendored
4
.github/workflows/main.yml
vendored
@ -86,8 +86,8 @@ jobs:
|
|||||||
run: ./release-notes/generator.pl
|
run: ./release-notes/generator.pl
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get install -y clang-format-15
|
sudo apt-get install -y clang-format-20
|
||||||
- name: Check formatting
|
- name: Check formatting
|
||||||
run: clang-format-15 --dry-run --Werror $(git ls-files '*.c' '*.h')
|
run: clang-format-20 --dry-run --Werror $(git ls-files '*.c' '*.h')
|
||||||
- name: Verify safe wrapper functions are used
|
- name: Verify safe wrapper functions are used
|
||||||
run: ./travis/check-safe-wrappers.sh
|
run: ./travis/check-safe-wrappers.sh
|
||||||
|
|||||||
@ -75,9 +75,9 @@ xcb_visualtype_t *visual_type = NULL;
|
|||||||
#define WIN_HEIGHT (15 * font.height + TEXT_PADDING)
|
#define WIN_HEIGHT (15 * font.height + TEXT_PADDING)
|
||||||
|
|
||||||
#define col_x(col) \
|
#define col_x(col) \
|
||||||
(((col)-1) * char_width + TEXT_PADDING)
|
(((col) - 1) * char_width + TEXT_PADDING)
|
||||||
#define row_y(row) \
|
#define row_y(row) \
|
||||||
(((row)-1) * font.height + TEXT_PADDING)
|
(((row) - 1) * font.height + TEXT_PADDING)
|
||||||
|
|
||||||
enum { STEP_WELCOME,
|
enum { STEP_WELCOME,
|
||||||
STEP_GENERATE } current_step = STEP_WELCOME;
|
STEP_GENERATE } current_step = STEP_WELCOME;
|
||||||
|
|||||||
@ -96,8 +96,7 @@ int main(int argc, char *argv[]) {
|
|||||||
{"follow", no_argument, 0, 'f'},
|
{"follow", no_argument, 0, 'f'},
|
||||||
#endif
|
#endif
|
||||||
{"help", no_argument, 0, 'h'},
|
{"help", no_argument, 0, 'h'},
|
||||||
{0, 0, 0, 0}
|
{0, 0, 0, 0}};
|
||||||
};
|
|
||||||
|
|
||||||
#if !defined(__OpenBSD__)
|
#if !defined(__OpenBSD__)
|
||||||
char *options_string = "s:vfVh";
|
char *options_string = "s:vfVh";
|
||||||
|
|||||||
@ -96,7 +96,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
#define SLIST_HEAD_INITIALIZER(head) \
|
#define SLIST_HEAD_INITIALIZER(head) \
|
||||||
{ NULL }
|
{NULL}
|
||||||
|
|
||||||
#define SLIST_ENTRY(type) \
|
#define SLIST_ENTRY(type) \
|
||||||
struct { \
|
struct { \
|
||||||
@ -174,7 +174,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
#define LIST_HEAD_INITIALIZER(head) \
|
#define LIST_HEAD_INITIALIZER(head) \
|
||||||
{ NULL }
|
{NULL}
|
||||||
|
|
||||||
#define LIST_ENTRY(type) \
|
#define LIST_ENTRY(type) \
|
||||||
struct { \
|
struct { \
|
||||||
@ -256,7 +256,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
#define SIMPLEQ_HEAD_INITIALIZER(head) \
|
#define SIMPLEQ_HEAD_INITIALIZER(head) \
|
||||||
{ NULL, &(head).sqh_first }
|
{NULL, &(head).sqh_first}
|
||||||
|
|
||||||
#define SIMPLEQ_ENTRY(type) \
|
#define SIMPLEQ_ENTRY(type) \
|
||||||
struct { \
|
struct { \
|
||||||
@ -322,7 +322,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
#define TAILQ_HEAD_INITIALIZER(head) \
|
#define TAILQ_HEAD_INITIALIZER(head) \
|
||||||
{ NULL, &(head).tqh_first }
|
{NULL, &(head).tqh_first}
|
||||||
|
|
||||||
#define TAILQ_ENTRY(type) \
|
#define TAILQ_ENTRY(type) \
|
||||||
struct { \
|
struct { \
|
||||||
@ -447,9 +447,7 @@
|
|||||||
|
|
||||||
#define CIRCLEQ_HEAD_INITIALIZER(head) \
|
#define CIRCLEQ_HEAD_INITIALIZER(head) \
|
||||||
{ \
|
{ \
|
||||||
CIRCLEQ_END(&head) \
|
CIRCLEQ_END(&head), CIRCLEQ_END(&head)}
|
||||||
, CIRCLEQ_END(&head) \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define CIRCLEQ_ENTRY(type) \
|
#define CIRCLEQ_ENTRY(type) \
|
||||||
struct { \
|
struct { \
|
||||||
|
|||||||
@ -31,7 +31,7 @@
|
|||||||
|
|
||||||
/** The XCB_CW_EVENT_MASK for its frame */
|
/** The XCB_CW_EVENT_MASK for its frame */
|
||||||
#define FRAME_EVENT_MASK (XCB_EVENT_MASK_BUTTON_PRESS | /* …mouse is pressed/released */ \
|
#define FRAME_EVENT_MASK (XCB_EVENT_MASK_BUTTON_PRESS | /* …mouse is pressed/released */ \
|
||||||
XCB_EVENT_MASK_BUTTON_RELEASE | \
|
XCB_EVENT_MASK_BUTTON_RELEASE | \
|
||||||
XCB_EVENT_MASK_POINTER_MOTION | /* …mouse is moved */ \
|
XCB_EVENT_MASK_POINTER_MOTION | /* …mouse is moved */ \
|
||||||
XCB_EVENT_MASK_EXPOSURE | /* …our window needs to be redrawn */ \
|
XCB_EVENT_MASK_EXPOSURE | /* …our window needs to be redrawn */ \
|
||||||
XCB_EVENT_MASK_STRUCTURE_NOTIFY | /* …the frame gets destroyed */ \
|
XCB_EVENT_MASK_STRUCTURE_NOTIFY | /* …the frame gets destroyed */ \
|
||||||
|
|||||||
@ -61,7 +61,7 @@ uint32_t get_colorpixel(const char *hex) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#define RGB_8_TO_16(i) (65535 * ((i)&0xFF) / 255)
|
#define RGB_8_TO_16(i) (65535 * ((i) & 0xFF) / 255)
|
||||||
int r16 = RGB_8_TO_16(r);
|
int r16 = RGB_8_TO_16(r);
|
||||||
int g16 = RGB_8_TO_16(g);
|
int g16 = RGB_8_TO_16(g);
|
||||||
int b16 = RGB_8_TO_16(b);
|
int b16 = RGB_8_TO_16(b);
|
||||||
|
|||||||
@ -54,7 +54,7 @@ static struct injected_reply getmonitors_reply = {NULL, 0};
|
|||||||
static struct injected_reply getoutputinfo_reply = {NULL, 0};
|
static struct injected_reply getoutputinfo_reply = {NULL, 0};
|
||||||
/* END RandR 1.5 specific */
|
/* END RandR 1.5 specific */
|
||||||
|
|
||||||
#define XCB_PAD(i) (-(i)&3)
|
#define XCB_PAD(i) (-(i) & 3)
|
||||||
|
|
||||||
struct connstate {
|
struct connstate {
|
||||||
/* clientw is a libev watcher for the connection which we accept()ed. */
|
/* clientw is a libev watcher for the connection which we accept()ed. */
|
||||||
|
|||||||
Reference in New Issue
Block a user