From 57492636052aa51ea20c5e1f6230ab5710278fe2 Mon Sep 17 00:00:00 2001 From: javalsai Date: Fri, 16 Jan 2026 00:51:05 +0100 Subject: [PATCH] bodge: shut linter --- include/desktop_exec.h | 10 +++++++--- include/macros.h | 8 ++++---- src/desktop_exec.c | 4 ++++ src/ui.c | 6 +++--- 4 files changed, 18 insertions(+), 10 deletions(-) diff --git a/include/desktop_exec.h b/include/desktop_exec.h index 3374445..9504fb8 100644 --- a/include/desktop_exec.h +++ b/include/desktop_exec.h @@ -1,10 +1,14 @@ -#ifndef DESKTOP_EXEC_H_ -#define DESKTOP_EXEC_H_ +// TODO: rewrite properly +// NOLINTBEGIN(clang-diagnostic-nullability-completeness) -#include "macros.h" +#ifndef DESKTOP_EXEC_H_ + #define DESKTOP_EXEC_H_ + + #include "macros.h" int execvpe_desktop(char** args, char* NNULLABLE* NNULLABLE envlist); int parse_exec_string(const char* exec_s, int* arg_count, char*** args); void free_parsed_args(int arg_count, char** args); #endif +// NOLINTEND(clang-diagnostic-nullability-completeness) diff --git a/include/macros.h b/include/macros.h index 5cc3a26..7ba3f79 100644 --- a/include/macros.h +++ b/include/macros.h @@ -7,25 +7,25 @@ #endif // Do we just replace the compiler with clang?? -#if defined(__clang__) +#ifdef __clang__ #define NULLABLE _Nullable #else #define NULLABLE #endif -#if defined(__clang__) +#ifdef __clang__ #define NNULLABLE _Nonnull #else #define NNULLABLE #endif -#if defined(__clang__) +#ifdef __clang__ #define UNULLABLE _Null_unspecified #else #define UNULLABLE #endif -#if defined(__clang__) +#ifdef __clang__ #define COMPILER_VERSION __VERSION__ #elif defined(__GNUC__) #define xstr(s) str(s) diff --git a/src/desktop_exec.c b/src/desktop_exec.c index a2a7dac..08d9b4f 100644 --- a/src/desktop_exec.c +++ b/src/desktop_exec.c @@ -1,3 +1,5 @@ +// TODO: rewrite properly +// NOLINTBEGIN(clang-diagnostic-nullability-completeness) #include #include #include @@ -133,6 +135,7 @@ int push_arg(struct ctx* st) { 3 = syntax Important: call free_parsed_args afterwards to free the passed ***args */ + // NOLINTBEGIN(readability-function-cognitive-complexity) int parse_exec_string(const char* exec_s, int* arg_count, char*** args) { if (!exec_s || !args || !arg_count) return 1; @@ -226,3 +229,4 @@ syntax_err: return 3; } // NOLINTEND(readability-function-cognitive-complexity) +// NOLINTEND(clang-diagnostic-nullability-completeness) diff --git a/src/ui.c b/src/ui.c index 1dda21c..b0457ba 100644 --- a/src/ui.c +++ b/src/ui.c @@ -193,8 +193,8 @@ void scratch_print_ui() { .y = ((window.ws_row - BOX_HEIGHT) / 2), // leave more space under }; - if (window.ws_row < BOX_HEIGHT + INNER_BOX_OUT_MARGIN * 2 || - window.ws_col < BOX_WIDTH + INNER_BOX_OUT_MARGIN * 2) { + if (window.ws_row < BOX_HEIGHT + (INNER_BOX_OUT_MARGIN * 2) || + window.ws_col < BOX_WIDTH + (INNER_BOX_OUT_MARGIN * 2)) { printf("\033[2J\033[H"); // Clear screen printf("\x1b[1;31mScreen too small\x1b[0m\n"); printf("\x1b[%s;%sm\x1b[2J", g_config->colors.bg, g_config->colors.fg); @@ -537,7 +537,7 @@ static void print_footer() { utf8len(g_config->strings.f_refresh) + utf8len(KEY_NAMES[g_config->functions.refresh]); - bsize += 2 * 2 + 3 * 1; + bsize += (2 * 2) + (3 * 1); if (fido_enabled) { bsize += utf8len(g_config->strings.f_fido) +