1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

[options] intptr_t instead of longptr_T

longptr_T was not long enough on Windows
This commit is contained in:
Witold Filipczyk 2024-04-07 19:50:11 +02:00
parent 82b16247d3
commit 699531f541
2 changed files with 12 additions and 12 deletions

View File

@ -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));

View File

@ -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 */