1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-06-27 01:25:34 +00:00

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

field where OPT_LONG is used.

(cherry picked from commit 2454ceffb7)
This commit is contained in:
Laurent MONIN 2006-06-26 17:49:59 +02:00 committed by Kalle Olavi Niemitalo
parent 174b34a2e6
commit e4894d0414
2 changed files with 9 additions and 3 deletions

View File

@ -307,11 +307,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);
@ -519,7 +523,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

@ -562,9 +562,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;