Commit d4d96401 authored by Jon Kåre Hellan's avatar Jon Kåre Hellan

(scm_value_get_as_string): Do type conversion instead of failing for

VALUE_BOOLEAN, VALUE_INTEGER and VALUE_FLOAT.
(scm_value_get_as_int): Do type conversion instead of failing for
VALUE_BOOLEAN and VALUE_FLOAT.
(scm_value_get_as_float): Do type conversion instead of failing for
VALUE_BOOLEAN and VALUE_INTEGER.
parent 315ef49c
2002-07-07 Jon K Hellan <hellan@acm.org>
* smob-value.c (scm_value_get_as_string): Do type conversion
instead of failing for VALUE_BOOLEAN, VALUE_INTEGER and
VALUE_FLOAT.
(scm_value_get_as_int): Do type conversion instead of failing for
VALUE_BOOLEAN and VALUE_FLOAT.
(scm_value_get_as_float): Do type conversion instead of failing
for VALUE_BOOLEAN and VALUE_INTEGER.
2002-05-29 Jody Goldberg <jody@gnome.org>
* Release 1.1.4
......
......@@ -211,7 +211,10 @@ scm_value_get_as_string (SCM value_smob)
{
SCM_Value *v = (SCM_Value *) SCM_CDR (value_smob);
if (v->v->type == VALUE_STRING)
if (v->v->type == VALUE_STRING ||
v->v->type == VALUE_BOOLEAN ||
v->v->type == VALUE_INTEGER ||
v->v->type == VALUE_FLOAT)
return scm_makfrom0str (value_get_as_string (v->v));
return SCM_EOL;
......@@ -221,7 +224,9 @@ static SCM
scm_value_get_as_int (SCM value_smob)
{
SCM_Value *v = (SCM_Value *) SCM_CDR (value_smob);
if (v->v->type == VALUE_INTEGER)
if (v->v->type == VALUE_BOOLEAN ||
v->v->type == VALUE_INTEGER ||
v->v->type == VALUE_FLOAT)
return scm_long2num (value_get_as_int (v->v));
return SCM_EOL;
......@@ -232,10 +237,9 @@ scm_value_get_as_float (SCM value_smob)
{
SCM_Value *v = (SCM_Value *) SCM_CDR (value_smob);
if (v->v->type == VALUE_FLOAT)
/*
return gh_double2scm (value_get_as_float (v->v));
*/
if (v->v->type == VALUE_BOOLEAN ||
v->v->type == VALUE_INTEGER ||
v->v->type == VALUE_FLOAT)
return scm_i_dbl2big (value_get_as_float (v->v));
return SCM_EOL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment