mirror of
https://github.com/rkd77/elinks.git
synced 2025-01-03 14:57:44 -05:00
config/options: use struct option big_number field instead of number
field where OPT_LONG is used.
This commit is contained in:
parent
cde9db3d70
commit
2454ceffb7
@ -279,11 +279,15 @@ get_opt_(
|
|||||||
break;
|
break;
|
||||||
case OPT_BOOL:
|
case OPT_BOOL:
|
||||||
case OPT_INT:
|
case OPT_INT:
|
||||||
case OPT_LONG:
|
|
||||||
if (opt->value.number < opt->min
|
if (opt->value.number < opt->min
|
||||||
|| opt->value.number > opt->max)
|
|| opt->value.number > opt->max)
|
||||||
elinks_internal("Option %s has invalid value %d!", name, opt->value.number);
|
elinks_internal("Option %s has invalid value %d!", name, opt->value.number);
|
||||||
break;
|
break;
|
||||||
|
case OPT_LONG:
|
||||||
|
if (opt->value.big_number < opt->min
|
||||||
|
|| opt->value.big_number > opt->max)
|
||||||
|
elinks_internal("Option %s has invalid value %ld!", name, opt->value.big_number);
|
||||||
|
break;
|
||||||
case OPT_COMMAND:
|
case OPT_COMMAND:
|
||||||
if (!opt->value.command)
|
if (!opt->value.command)
|
||||||
elinks_internal("Option %s has no value!", name);
|
elinks_internal("Option %s has no value!", name);
|
||||||
@ -491,7 +495,7 @@ add_opt(struct option *tree, unsigned char *path, unsigned char *capt,
|
|||||||
option->value.number = (int) value;
|
option->value.number = (int) value;
|
||||||
break;
|
break;
|
||||||
case OPT_LONG:
|
case OPT_LONG:
|
||||||
option->value.number = (long) value; /* FIXME: bignumber */
|
option->value.big_number = (long) value; /* FIXME: cast from void * */
|
||||||
break;
|
break;
|
||||||
case OPT_COLOR:
|
case OPT_COLOR:
|
||||||
decode_color(value, strlen((unsigned char *) value),
|
decode_color(value, strlen((unsigned char *) value),
|
||||||
|
@ -556,9 +556,11 @@ l_get_option(LS)
|
|||||||
lua_pushboolean(S, opt->value.number);
|
lua_pushboolean(S, opt->value.number);
|
||||||
break;
|
break;
|
||||||
case OPT_INT:
|
case OPT_INT:
|
||||||
case OPT_LONG:
|
|
||||||
lua_pushnumber(S, opt->value.number);
|
lua_pushnumber(S, opt->value.number);
|
||||||
break;
|
break;
|
||||||
|
case OPT_LONG:
|
||||||
|
lua_pushnumber(S, opt->value.big_number);
|
||||||
|
break;
|
||||||
case OPT_STRING:
|
case OPT_STRING:
|
||||||
lua_pushstring(S, opt->value.string);
|
lua_pushstring(S, opt->value.string);
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user