From 55f7088309a023cf6fee77d28271389200177985 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Sat, 2 Mar 2024 20:58:59 +0100 Subject: [PATCH] Refactor --- zathura/config.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/zathura/config.c b/zathura/config.c index b5515fb..d6c2ef0 100644 --- a/zathura/config.c +++ b/zathura/config.c @@ -18,25 +18,18 @@ #include #include -#define GLOBAL_RC "/etc/zathurarc" +#define GLOBAL_RC "/etc/zathurarc" #define ZATHURA_RC "zathurarc" -static void -cb_jumplist_change(girara_session_t* session, const char* UNUSED(name), - girara_setting_type_t UNUSED(type), const void* value, void* UNUSED(data)) -{ +static void cb_jumplist_change(girara_session_t* session, const char* UNUSED(name), girara_setting_type_t UNUSED(type), + const void* value, void* UNUSED(data)) { g_return_if_fail(value != NULL); g_return_if_fail(session != NULL); g_return_if_fail(session->global.data != NULL); zathura_t* zathura = session->global.data; - const int* ivalue = value; - - if (*ivalue < 0) { - zathura->jumplist.max_size = 0; - } else { - zathura->jumplist.max_size = *ivalue; - } + const int* ivalue = value; + zathura->jumplist.max_size = MAX(0, *ivalue); if (zathura->jumplist.list != NULL && zathura->jumplist.size != 0) { zathura_jumplist_trim(zathura);