1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-09-28 03:06:20 -04:00

config/options: use struct option big_number field instead of number

field where OPT_LONG is used.
This commit is contained in:
Laurent MONIN 2006-06-26 17:49:59 +02:00 committed by Laurent MONIN
parent cde9db3d70
commit 2454ceffb7
2 changed files with 9 additions and 3 deletions

View File

@ -279,11 +279,15 @@ get_opt_(
break;
case OPT_BOOL:
case OPT_INT:
case OPT_LONG:
if (opt->value.number < opt->min
|| opt->value.number > opt->max)
elinks_internal("Option %s has invalid value %d!", name, opt->value.number);
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:
if (!opt->value.command)
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;
break;
case OPT_LONG:
option->value.number = (long) value; /* FIXME: bignumber */
option->value.big_number = (long) value; /* FIXME: cast from void * */
break;
case OPT_COLOR:
decode_color(value, strlen((unsigned char *) value),

View File

@ -556,9 +556,11 @@ l_get_option(LS)
lua_pushboolean(S, opt->value.number);
break;
case OPT_INT:
case OPT_LONG:
lua_pushnumber(S, opt->value.number);
break;
case OPT_LONG:
lua_pushnumber(S, opt->value.big_number);
break;
case OPT_STRING:
lua_pushstring(S, opt->value.string);
break;