From 699531f541ee917abbdeeb3ac26e516629efbed9 Mon Sep 17 00:00:00 2001 From: Witold Filipczyk Date: Sun, 7 Apr 2024 19:50:11 +0200 Subject: [PATCH] [options] intptr_t instead of longptr_T longptr_T was not long enough on Windows --- src/config/options.c | 2 +- src/config/options.h | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/config/options.c b/src/config/options.c index 0f25cb96..f54f3e5b 100644 --- a/src/config/options.c +++ b/src/config/options.c @@ -518,7 +518,7 @@ init_option_listbox_item(struct option *option) struct option * add_opt(struct option *tree, const char *path, const char *capt, const char *name, option_flags_T flags, enum option_type type, - long min, long max, longptr_T value, const char *desc) + long min, long max, intptr_t value, const char *desc) { struct option *option = (struct option *)mem_calloc(1, sizeof(*option)); diff --git a/src/config/options.h b/src/config/options.h index 9ce063fe..e904b1a7 100644 --- a/src/config/options.h +++ b/src/config/options.h @@ -339,7 +339,7 @@ extern union option_value *get_opt_(struct option *, const char *, struct sessio extern struct option *add_opt(struct option *, const char *, const char *, const char *, option_flags_T, enum option_type, - long, long, longptr_T, const char *); + long, long, intptr_t, const char *); /** Check whether the character @a c may be used in the name of an * option. This does not allow the '.' used in multi-part names like @@ -363,47 +363,47 @@ extern struct option *add_opt(struct option *, const char *, const char *, /*! @relates option */ #define add_opt_bool_tree(tree, path, capt, name, flags, def, desc) \ - add_opt(tree, path, capt, name, flags, OPT_BOOL, 0, 1, (longptr_T) def, DESC(desc)) + add_opt(tree, path, capt, name, flags, OPT_BOOL, 0, 1, (intptr_t) def, DESC(desc)) /*! @relates option */ #define add_opt_int_tree(tree, path, capt, name, flags, min, max, def, desc) \ - add_opt(tree, path, capt, name, flags, OPT_INT, min, max, (longptr_T) def, DESC(desc)) + add_opt(tree, path, capt, name, flags, OPT_INT, min, max, (intptr_t) def, DESC(desc)) /*! @relates option */ #define add_opt_long_tree(tree, path, capt, name, flags, min, max, def, desc) \ - add_opt(tree, path, capt, name, flags, OPT_LONG, min, max, (longptr_T) def, DESC(desc)) + add_opt(tree, path, capt, name, flags, OPT_LONG, min, max, (intptr_t) def, DESC(desc)) /*! @relates option */ #define add_opt_str_tree(tree, path, capt, name, flags, def, desc) \ do { \ char *ptr = (char *)mem_alloc(MAX_STR_LEN); \ safe_strncpy(ptr, def, MAX_STR_LEN); \ - add_opt(tree, path, capt, name, flags, OPT_STRING, 0, MAX_STR_LEN, (longptr_T) ptr, DESC(desc)); \ + add_opt(tree, path, capt, name, flags, OPT_STRING, 0, MAX_STR_LEN, (intptr_t) ptr, DESC(desc)); \ } while (0) /*! @relates option */ #define add_opt_codepage_tree(tree, path, capt, name, flags, def, desc) \ - add_opt(tree, path, capt, name, flags, OPT_CODEPAGE, 0, 0, (longptr_T) get_cp_index(def), DESC(desc)) + add_opt(tree, path, capt, name, flags, OPT_CODEPAGE, 0, 0, (intptr_t) get_cp_index(def), DESC(desc)) /*! @relates option */ #define add_opt_lang_tree(tree, path, capt, name, flags, desc) \ - add_opt(tree, path, capt, name, flags, OPT_LANGUAGE, 0, 0, (longptr_T) 0, DESC(desc)) + add_opt(tree, path, capt, name, flags, OPT_LANGUAGE, 0, 0, (intptr_t) 0, DESC(desc)) /*! @relates option */ #define add_opt_color_tree(tree, path, capt, name, flags, def, desc) \ - add_opt(tree, path, capt, name, flags, OPT_COLOR, 0, 0, (longptr_T) def, DESC(desc)) + add_opt(tree, path, capt, name, flags, OPT_COLOR, 0, 0, (intptr_t) def, DESC(desc)) /*! @relates option */ #define add_opt_command_tree(tree, path, capt, name, flags, cmd, desc) \ - add_opt(tree, path, capt, name, flags, OPT_COMMAND, 0, 0, (longptr_T) cmd, DESC(desc)); + add_opt(tree, path, capt, name, flags, OPT_COMMAND, 0, 0, (intptr_t) cmd, DESC(desc)); /*! @relates option */ #define add_opt_alias_tree(tree, path, capt, name, flags, def, desc) \ - add_opt(tree, path, capt, name, flags, OPT_ALIAS, 0, strlen(def), (longptr_T) def, DESC(desc)) + add_opt(tree, path, capt, name, flags, OPT_ALIAS, 0, strlen(def), (intptr_t) def, DESC(desc)) /*! @relates option */ #define add_opt_tree_tree(tree, path, capt, name, flags, desc) \ - add_opt(tree, path, capt, name, flags, OPT_TREE, 0, 0, (longptr_T) init_options_tree(), DESC(desc)); + add_opt(tree, path, capt, name, flags, OPT_TREE, 0, 0, (intptr_t) init_options_tree(), DESC(desc)); /* Builtin options */