Commit c0531c9a authored by Michael Meeks's avatar Michael Meeks

Renamed several functions.

parent 88d90f6e
1999-05-13 Michael Meeks <michael@imaginator.com>
* src/expr.h: Updated all prototypes.
* *.c:
s/\<value_float *(/value_new_float (/g
s/\<value_int *(/value_new_int (/g
s/\<value_str *(/value_new_string (/g
s/\<value_string *(/value_get_as_string (/g
s/\<value_cellrange *(/value_new_cellrange (/g
s/\<value_get_as_double *(/value_get_as_float (/g
s/\<value_get_bool *(/value_get_as_bool (/g
* src/expr.c: Moved all pertainant Value functions to the
same place to aid possible splitting.
1999-05-13 Michael Meeks <michael@imaginator.com>
* src/expr.c (value_area_get_at_x_y): Added warning
......
1999-05-13 Michael Meeks <michael@imaginator.com>
* src/expr.h: Updated all prototypes.
* *.c:
s/\<value_float *(/value_new_float (/g
s/\<value_int *(/value_new_int (/g
s/\<value_str *(/value_new_string (/g
s/\<value_string *(/value_get_as_string (/g
s/\<value_cellrange *(/value_new_cellrange (/g
s/\<value_get_as_double *(/value_get_as_float (/g
s/\<value_get_bool *(/value_get_as_bool (/g
* src/expr.c: Moved all pertainant Value functions to the
same place to aid possible splitting.
1999-05-13 Michael Meeks <michael@imaginator.com>
* src/expr.c (value_area_get_at_x_y): Added warning
......
1999-05-13 Michael Meeks <michael@imaginator.com>
* src/expr.h: Updated all prototypes.
* *.c:
s/\<value_float *(/value_new_float (/g
s/\<value_int *(/value_new_int (/g
s/\<value_str *(/value_new_string (/g
s/\<value_string *(/value_get_as_string (/g
s/\<value_cellrange *(/value_new_cellrange (/g
s/\<value_get_as_double *(/value_get_as_float (/g
s/\<value_get_bool *(/value_get_as_bool (/g
* src/expr.c: Moved all pertainant Value functions to the
same place to aid possible splitting.
1999-05-13 Michael Meeks <michael@imaginator.com>
* src/expr.c (value_area_get_at_x_y): Added warning
......
1999-05-13 Michael Meeks <michael@imaginator.com>
* src/expr.h: Updated all prototypes.
* *.c:
s/\<value_float *(/value_new_float (/g
s/\<value_int *(/value_new_int (/g
s/\<value_str *(/value_new_string (/g
s/\<value_string *(/value_get_as_string (/g
s/\<value_cellrange *(/value_new_cellrange (/g
s/\<value_get_as_double *(/value_get_as_float (/g
s/\<value_get_bool *(/value_get_as_bool (/g
* src/expr.c: Moved all pertainant Value functions to the
same place to aid possible splitting.
1999-05-13 Michael Meeks <michael@imaginator.com>
* src/expr.c (value_area_get_at_x_y): Added warning
......
......@@ -1439,16 +1439,16 @@ biff_get_rk (guint8 *ptr)
answer = BIFF_GETDOUBLE(tmp);
answer /= (type == eIEEEx100)?100.0:1.0;
ans = value_float (answer);
ans = value_new_float (answer);
break;
case eInt:
ans = value_int ((number>>2));
ans = value_new_int ((number>>2));
break;
case eIntx100:
if (number%100==0)
ans = value_int ((number>>2)/100);
ans = value_new_int ((number>>2)/100);
else
ans = value_float ((number>>2)/100.0);
ans = value_new_float ((number>>2)/100.0);
break;
}
return ans;
......@@ -1546,7 +1546,7 @@ ms_excel_read_cell (BIFF_QUERY * q, MS_EXCEL_SHEET * sheet)
/* Can be ignored on read side */
break ;
case BIFF_NUMBER: {
Value *v = value_float (BIFF_GETDOUBLE (q->data + 6));
Value *v = value_new_float (BIFF_GETDOUBLE (q->data + 6));
ms_excel_sheet_insert_val (sheet, EX_GETXF (q), EX_GETCOL (q),
EX_GETROW (q), v);
break;
......
......@@ -1439,16 +1439,16 @@ biff_get_rk (guint8 *ptr)
answer = BIFF_GETDOUBLE(tmp);
answer /= (type == eIEEEx100)?100.0:1.0;
ans = value_float (answer);
ans = value_new_float (answer);
break;
case eInt:
ans = value_int ((number>>2));
ans = value_new_int ((number>>2));
break;
case eIntx100:
if (number%100==0)
ans = value_int ((number>>2)/100);
ans = value_new_int ((number>>2)/100);
else
ans = value_float ((number>>2)/100.0);
ans = value_new_float ((number>>2)/100.0);
break;
}
return ans;
......@@ -1546,7 +1546,7 @@ ms_excel_read_cell (BIFF_QUERY * q, MS_EXCEL_SHEET * sheet)
/* Can be ignored on read side */
break ;
case BIFF_NUMBER: {
Value *v = value_float (BIFF_GETDOUBLE (q->data + 6));
Value *v = value_new_float (BIFF_GETDOUBLE (q->data + 6));
ms_excel_sheet_insert_val (sheet, EX_GETXF (q), EX_GETCOL (q),
EX_GETROW (q), v);
break;
......
......@@ -443,7 +443,7 @@ expr_tree_string (const char *str)
{
ExprTree *e = expr_tree_new();
e->oper = OPER_CONSTANT;
e->u.constant = value_str (str);
e->u.constant = value_new_string (str);
return e;
}
......@@ -737,9 +737,9 @@ ms_excel_parse_formula (MS_EXCEL_SHEET *sheet, guint8 *mem,
ptg_length = 24 ;
}
if ((txt = biff_name_data_get_name (sheet, extn_name_idx)))
parse_list_push_raw (&stack, value_str (txt));
parse_list_push_raw (&stack, value_new_string (txt));
else
parse_list_push_raw (&stack, value_str ("DuffName"));
parse_list_push_raw (&stack, value_new_string ("DuffName"));
break ;
}
case FORMULA_PTG_REF_3D: /* see S59E2B.HTM */
......@@ -778,7 +778,7 @@ ms_excel_parse_formula (MS_EXCEL_SHEET *sheet, guint8 *mem,
fn_col, fn_row, 0) ;
make_inter_sheet_ref (sheet->wb, extn_idx, first, last) ;
parse_list_push_raw (&stack, value_cellrange (first, last));
parse_list_push_raw (&stack, value_new_cellrange (first, last));
ptg_length = 10 ;
}
else
......@@ -810,7 +810,7 @@ ms_excel_parse_formula (MS_EXCEL_SHEET *sheet, guint8 *mem,
ptg_length = 6 ;
}
parse_list_push_raw (&stack, value_cellrange (first, last));
parse_list_push_raw (&stack, value_new_cellrange (first, last));
if (first) g_free (first) ;
if (last) g_free (last) ;
......@@ -835,7 +835,7 @@ ms_excel_parse_formula (MS_EXCEL_SHEET *sheet, guint8 *mem,
guint8 opts=BIFF_GETBYTE(data);
if (opts == 1) {
value_array_set (v, lpx, lpy,
value_float (BIFF_GETDOUBLE(data+1)));
value_new_float (BIFF_GETDOUBLE(data+1)));
data+=9;
ptg_length+=9;
} else if (opts == 2) {
......@@ -843,7 +843,7 @@ ms_excel_parse_formula (MS_EXCEL_SHEET *sheet, guint8 *mem,
char *str = biff_get_text (data+2,
BIFF_GETBYTE(data+1),
&len);
value_array_set (v, lpx, lpy, value_str(str));
value_array_set (v, lpx, lpy, value_new_string (str));
g_free (str);
data+=len+2;
ptg_length+=2+len;
......@@ -916,7 +916,7 @@ ms_excel_parse_formula (MS_EXCEL_SHEET *sheet, guint8 *mem,
ptg_length = 0 ;
break ;
case FORMULA_PTG_MISSARG: /* FIXME: Need Null Arg. type. */
parse_list_push_raw (&stack, value_str (""));
parse_list_push_raw (&stack, value_new_string (""));
ptg_length = 0 ;
break ;
case FORMULA_PTG_ATTR: /* FIXME: not fully implemented */
......@@ -939,7 +939,7 @@ ms_excel_parse_formula (MS_EXCEL_SHEET *sheet, guint8 *mem,
fn_col, fn_row, shared,
w) ;
else
tr = expr_tree_value (value_str (""));
tr = expr_tree_value (value_new_string (""));
parse_list_push (&stack, tr);
ptg_length += w ;
} else if (grbit & 0x04) { /* AttrChoose 'optimised' my foot. */
......@@ -994,27 +994,27 @@ ms_excel_parse_formula (MS_EXCEL_SHEET *sheet, guint8 *mem,
case FORMULA_PTG_ERR:
{
parse_list_push_raw (&stack,
value_str(biff_get_error_text(BIFF_GETBYTE(cur))));
value_new_string (biff_get_error_text(BIFF_GETBYTE(cur))));
ptg_length = 1 ;
break ;
}
case FORMULA_PTG_INT:
{
guint16 num = BIFF_GETWORD(cur) ;
parse_list_push_raw (&stack, value_int(num));
parse_list_push_raw (&stack, value_new_int (num));
ptg_length = 2 ;
break;
}
case FORMULA_PTG_BOOL: /* FIXME: True / False */
{
parse_list_push_raw (&stack, value_int (BIFF_GETBYTE(cur)));
parse_list_push_raw (&stack, value_new_int (BIFF_GETBYTE(cur)));
ptg_length = 1 ;
break ;
}
case FORMULA_PTG_NUM:
{
double tmp = BIFF_GETDOUBLE(cur) ;
parse_list_push_raw (&stack, value_float (tmp));
parse_list_push_raw (&stack, value_new_float (tmp));
ptg_length = 8 ;
break ;
}
......@@ -1036,7 +1036,7 @@ ms_excel_parse_formula (MS_EXCEL_SHEET *sheet, guint8 *mem,
/* printf ("<v7 PTG_STR '%s' len %d ptglen %d\n", str, len, ptg_length) ; */
}
if (!str) str = g_strdup("");
parse_list_push_raw (&stack, value_str (str));
parse_list_push_raw (&stack, value_new_string (str));
if (str) g_free (str);
break ;
}
......
......@@ -443,7 +443,7 @@ expr_tree_string (const char *str)
{
ExprTree *e = expr_tree_new();
e->oper = OPER_CONSTANT;
e->u.constant = value_str (str);
e->u.constant = value_new_string (str);
return e;
}
......@@ -737,9 +737,9 @@ ms_excel_parse_formula (MS_EXCEL_SHEET *sheet, guint8 *mem,
ptg_length = 24 ;
}
if ((txt = biff_name_data_get_name (sheet, extn_name_idx)))
parse_list_push_raw (&stack, value_str (txt));
parse_list_push_raw (&stack, value_new_string (txt));
else
parse_list_push_raw (&stack, value_str ("DuffName"));
parse_list_push_raw (&stack, value_new_string ("DuffName"));
break ;
}
case FORMULA_PTG_REF_3D: /* see S59E2B.HTM */
......@@ -778,7 +778,7 @@ ms_excel_parse_formula (MS_EXCEL_SHEET *sheet, guint8 *mem,
fn_col, fn_row, 0) ;
make_inter_sheet_ref (sheet->wb, extn_idx, first, last) ;
parse_list_push_raw (&stack, value_cellrange (first, last));
parse_list_push_raw (&stack, value_new_cellrange (first, last));
ptg_length = 10 ;
}
else
......@@ -810,7 +810,7 @@ ms_excel_parse_formula (MS_EXCEL_SHEET *sheet, guint8 *mem,
ptg_length = 6 ;
}
parse_list_push_raw (&stack, value_cellrange (first, last));
parse_list_push_raw (&stack, value_new_cellrange (first, last));
if (first) g_free (first) ;
if (last) g_free (last) ;
......@@ -835,7 +835,7 @@ ms_excel_parse_formula (MS_EXCEL_SHEET *sheet, guint8 *mem,
guint8 opts=BIFF_GETBYTE(data);
if (opts == 1) {
value_array_set (v, lpx, lpy,
value_float (BIFF_GETDOUBLE(data+1)));
value_new_float (BIFF_GETDOUBLE(data+1)));
data+=9;
ptg_length+=9;
} else if (opts == 2) {
......@@ -843,7 +843,7 @@ ms_excel_parse_formula (MS_EXCEL_SHEET *sheet, guint8 *mem,
char *str = biff_get_text (data+2,
BIFF_GETBYTE(data+1),
&len);
value_array_set (v, lpx, lpy, value_str(str));
value_array_set (v, lpx, lpy, value_new_string (str));
g_free (str);
data+=len+2;
ptg_length+=2+len;
......@@ -916,7 +916,7 @@ ms_excel_parse_formula (MS_EXCEL_SHEET *sheet, guint8 *mem,
ptg_length = 0 ;
break ;
case FORMULA_PTG_MISSARG: /* FIXME: Need Null Arg. type. */
parse_list_push_raw (&stack, value_str (""));
parse_list_push_raw (&stack, value_new_string (""));
ptg_length = 0 ;
break ;
case FORMULA_PTG_ATTR: /* FIXME: not fully implemented */
......@@ -939,7 +939,7 @@ ms_excel_parse_formula (MS_EXCEL_SHEET *sheet, guint8 *mem,
fn_col, fn_row, shared,
w) ;
else
tr = expr_tree_value (value_str (""));
tr = expr_tree_value (value_new_string (""));
parse_list_push (&stack, tr);
ptg_length += w ;
} else if (grbit & 0x04) { /* AttrChoose 'optimised' my foot. */
......@@ -994,27 +994,27 @@ ms_excel_parse_formula (MS_EXCEL_SHEET *sheet, guint8 *mem,
case FORMULA_PTG_ERR:
{
parse_list_push_raw (&stack,
value_str(biff_get_error_text(BIFF_GETBYTE(cur))));
value_new_string (biff_get_error_text(BIFF_GETBYTE(cur))));
ptg_length = 1 ;
break ;
}
case FORMULA_PTG_INT:
{
guint16 num = BIFF_GETWORD(cur) ;
parse_list_push_raw (&stack, value_int(num));
parse_list_push_raw (&stack, value_new_int (num));
ptg_length = 2 ;
break;
}
case FORMULA_PTG_BOOL: /* FIXME: True / False */
{
parse_list_push_raw (&stack, value_int (BIFF_GETBYTE(cur)));
parse_list_push_raw (&stack, value_new_int (BIFF_GETBYTE(cur)));
ptg_length = 1 ;
break ;
}
case FORMULA_PTG_NUM:
{
double tmp = BIFF_GETDOUBLE(cur) ;
parse_list_push_raw (&stack, value_float (tmp));
parse_list_push_raw (&stack, value_new_float (tmp));
ptg_length = 8 ;
break ;
}
......@@ -1036,7 +1036,7 @@ ms_excel_parse_formula (MS_EXCEL_SHEET *sheet, guint8 *mem,
/* printf ("<v7 PTG_STR '%s' len %d ptglen %d\n", str, len, ptg_length) ; */
}
if (!str) str = g_strdup("");
parse_list_push_raw (&stack, value_str (str));
parse_list_push_raw (&stack, value_new_string (str));
if (str) g_free (str);
break ;
}
......
......@@ -28,7 +28,7 @@ int
criteria_test_equal(Value *x, Value *y)
{
if (VALUE_IS_NUMBER(x) && VALUE_IS_NUMBER(y))
if (value_get_as_double(x) == value_get_as_double(y))
if (value_get_as_float (x) == value_get_as_float (y))
return 1;
else
return 0;
......@@ -43,7 +43,7 @@ int
criteria_test_unequal(Value *x, Value *y)
{
if (VALUE_IS_NUMBER(x) && VALUE_IS_NUMBER(y))
if (value_get_as_double(x) != value_get_as_double(y))
if (value_get_as_float (x) != value_get_as_float (y))
return 1;
else
return 0;
......@@ -58,7 +58,7 @@ int
criteria_test_less(Value *x, Value *y)
{
if (VALUE_IS_NUMBER(x) && VALUE_IS_NUMBER(y))
if (value_get_as_double(x) < value_get_as_double(y))
if (value_get_as_float (x) < value_get_as_float (y))
return 1;
else
return 0;
......@@ -70,7 +70,7 @@ int
criteria_test_greater(Value *x, Value *y)
{
if (VALUE_IS_NUMBER(x) && VALUE_IS_NUMBER(y))
if (value_get_as_double(x) > value_get_as_double(y))
if (value_get_as_float (x) > value_get_as_float (y))
return 1;
else
return 0;
......@@ -82,7 +82,7 @@ int
criteria_test_less_or_equal(Value *x, Value *y)
{
if (VALUE_IS_NUMBER(x) && VALUE_IS_NUMBER(y))
if (value_get_as_double(x) <= value_get_as_double(y))
if (value_get_as_float (x) <= value_get_as_float (y))
return 1;
else
return 0;
......@@ -94,7 +94,7 @@ int
criteria_test_greater_or_equal(Value *x, Value *y)
{
if (VALUE_IS_NUMBER(x) && VALUE_IS_NUMBER(y))
if (value_get_as_double(x) >= value_get_as_double(y))
if (value_get_as_float (x) >= value_get_as_float (y))
return 1;
else
return 0;
......@@ -124,7 +124,7 @@ find_column_of_field(Value *database, Value *field)
return -1;
sheet = (Sheet *) database->v.cell_range.cell_a.sheet;
field_name = value_string(field);
field_name = value_get_as_string (field);
column = -1;
/* find the column that is labeled with `field_name' */
......@@ -201,9 +201,9 @@ parse_criteria(char *criteria, criteria_test_fun_t *fun, Value **test_value)
tmp = strtod(criteria+len, &p);
if (p == criteria+len || *p != '\0')
*test_value = value_str(criteria+len);
*test_value = value_new_string (criteria+len);
else
*test_value = value_float(tmp);
*test_value = value_new_float (tmp);
}
......@@ -382,14 +382,14 @@ gnumeric_daverage (struct FunctionDefinition *i,
Cell *cell = current->data;
count++;
sum += value_get_as_double(cell->value);
sum += value_get_as_float (cell->value);
current = g_slist_next(current);
}
g_slist_free(cells);
free_criterias(criterias);
return value_float (sum / count);
return value_new_float (sum / count);
}
static char *help_dcount = {
......@@ -455,7 +455,7 @@ gnumeric_dcount (struct FunctionDefinition *i,
g_slist_free(cells);
free_criterias(criterias);
return value_int (count);
return value_new_int (count);
}
static char *help_dcounta = {
......@@ -518,7 +518,7 @@ gnumeric_dcounta (struct FunctionDefinition *i,
g_slist_free(cells);
free_criterias(criterias);
return value_int (count);
return value_new_int (count);
}
static char *help_dget = {
......@@ -601,7 +601,7 @@ gnumeric_dget (struct FunctionDefinition *i,
return NULL;
}
return value_float (value_get_as_double(cell->value));
return value_new_float (value_get_as_float (cell->value));
}
static char *help_dmax = {
......@@ -659,13 +659,13 @@ gnumeric_dmax (struct FunctionDefinition *i,
}
current = cells;
cell = current->data;
max = value_get_as_double (cell->value);
max = value_get_as_float (cell->value);
while (current != NULL) {
float_t v;
cell = current->data;
v = value_get_as_double (cell->value);
v = value_get_as_float (cell->value);
if (max < v)
max = v;
current = g_slist_next(current);
......@@ -674,7 +674,7 @@ gnumeric_dmax (struct FunctionDefinition *i,
g_slist_free(cells);
free_criterias(criterias);
return value_float (max);
return value_new_float (max);
}
static char *help_dmin = {
......@@ -732,13 +732,13 @@ gnumeric_dmin (struct FunctionDefinition *i,
}
current = cells;
cell = current->data;
min = value_get_as_double (cell->value);
min = value_get_as_float (cell->value);
while (current != NULL) {
float_t v;
cell = current->data;
v = value_get_as_double (cell->value);
v = value_get_as_float (cell->value);
if (min > v)
min = v;
current = g_slist_next(current);
......@@ -747,7 +747,7 @@ gnumeric_dmin (struct FunctionDefinition *i,
g_slist_free(cells);
free_criterias(criterias);
return value_float (min);
return value_new_float (min);
}
static char *help_dproduct = {
......@@ -811,7 +811,7 @@ gnumeric_dproduct (struct FunctionDefinition *i,
float_t v;
cell = current->data;
v = value_get_as_double (cell->value);
v = value_get_as_float (cell->value);
product *= v;
current = g_slist_next(current);
}
......@@ -819,7 +819,7 @@ gnumeric_dproduct (struct FunctionDefinition *i,
g_slist_free(cells);
free_criterias(criterias);
return value_float (product);
return value_new_float (product);
}
static char *help_dstdev = {
......@@ -895,7 +895,7 @@ gnumeric_dstdev (struct FunctionDefinition *i,
return NULL;
}
return value_float (sqrt(p.Q / (p.N - 1)));
return value_new_float (sqrt(p.Q / (p.N - 1)));
}
static char *help_dstdevp = {
......@@ -971,7 +971,7 @@ gnumeric_dstdevp (struct FunctionDefinition *i,
return NULL;
}
return value_float (sqrt(p.Q / p.N));
return value_new_float (sqrt(p.Q / p.N));
}
static char *help_dsum = {
......@@ -1035,7 +1035,7 @@ gnumeric_dsum (struct FunctionDefinition *i,
float_t v;
cell = current->data;
v = value_get_as_double (cell->value);
v = value_get_as_float (cell->value);
sum += v;
current = g_slist_next(current);
}
......@@ -1043,7 +1043,7 @@ gnumeric_dsum (struct FunctionDefinition *i,
g_slist_free(cells);
free_criterias(criterias);
return value_float (sum);
return value_new_float (sum);
}
static char *help_dvar = {
......@@ -1119,7 +1119,7 @@ gnumeric_dvar (struct FunctionDefinition *i,
return NULL;
}
return value_float (p.Q / (p.N - 1));
return value_new_float (p.Q / (p.N - 1));
}
static char *help_dvarp = {
......@@ -1195,7 +1195,7 @@ gnumeric_dvarp (struct FunctionDefinition *i,
return NULL;
}
return value_float (p.Q / p.N);
return value_new_float (p.Q / p.N);
}
......
......@@ -38,9 +38,9 @@ gnumeric_date (struct FunctionDefinition *fd, Value *argv [], char **error_strin
int year, month, day;
GDate date;
year = value_get_as_double (argv [0]);
month = value_get_as_double (argv [1]);
day = value_get_as_double (argv [2]);
year = value_get_as_float (argv [0]);
month = value_get_as_float (argv [1]);
day = value_get_as_float (argv [2]);
if (!g_date_valid_dmy(1, month, year))
{
......@@ -63,7 +63,7 @@ gnumeric_date (struct FunctionDefinition *fd, Value *argv [], char **error_strin
return NULL;
}
v = value_int (g_date_serial (&date));
v = value_new_int (g_date_serial (&date));
return v;
}
......@@ -101,7 +101,7 @@ gnumeric_datevalue (struct FunctionDefinition *fd,
return NULL;
}
return value_int (g_date_serial (&date));
return value_new_int (g_date_serial (&date));
}
static char *help_edate = {
......@@ -148,7 +148,7 @@ gnumeric_edate (struct FunctionDefinition *fd,
return NULL;
}
return value_int (g_date_serial (date));
return value_new_int (g_date_serial (date));
}
static char *help_today = {
......@@ -175,7 +175,7 @@ gnumeric_today (FunctionDefinition *fd, Value *argv [], char **error_string)
g_date_set_time (&date, time (NULL));
v = value_int (g_date_serial (&date));
v = value_new_int (g_date_serial (&date));
return v;
}
......@@ -213,7 +213,7 @@ gnumeric_now (FunctionDefinition *fd, Value *argv [], char **error_string)
g_date_set_time (&date, t);
v = value_float (g_date_serial(&date) +
v = value_new_float (g_date_serial(&date) +
((tm->tm_hour * 3600 + tm->tm_min * 60
+ tm->tm_sec)/(double)DAY_SECONDS));
......@@ -238,11 +238,11 @@ gnumeric_time (FunctionDefinition *fd, Value *argv [], char **error_string)
Value *v;
float_t hours, minutes, seconds;
hours = value_get_as_double (argv [0]);
minutes = value_get_as_double (argv [1]);
seconds = value_get_as_double (argv [2]);
hours = value_get_as_float (argv [0]);
minutes = value_get_as_float (argv [1]);
seconds = value_get_as_float (argv [2]);
v = value_float ((hours * 3600 + minutes * 60 + seconds) / DAY_SECONDS);
v = value_new_float ((hours * 3600 + minutes * 60 + seconds) / DAY_SECONDS);
return v;
}
......@@ -301,7 +301,7 @@ gnumeric_hour_min_sec (FunctionDefinition *fd, Value *argv [], char **error_stri
Value *v = g_new (Value, 1);
float_t serial;
serial = value_get_as_double (argv [0]);
serial = value_get_as_float (argv [0]);
serial = serial - floor (serial);
v->type = VALUE_INTEGER;
......@@ -361,7 +361,7 @@ static Value *
gnumeric_year_month_day (FunctionDefinition *fd, Value *argv [], char **error_string)
{
Value *v = g_new (Value, 1);
guint32 serial = floor (value_get_as_double (argv [0]));
guint32 serial = floor (value_get_as_float (argv [0]));
GDate* date = g_date_new_serial (serial);
v->type = VALUE_INTEGER;
......
......@@ -94,7 +94,7 @@ val_to_base (Value *value, Value *val_places,
v = -v;
if (dest_base == 10)
return (value_int(v));
return (value_new_int (v));
if (v<0){
neg = 1;
......@@ -141,7 +141,7 @@ val_to_base (Value *value, Value *val_places,
}
}
ans[max] = '\0';
return value_str(ans);
return value_new_string (ans);
}
static char *help_bin2dec = {
......@@ -422,7 +422,7 @@ gnumeric_besselj (struct FunctionDefinition *i,
*error_string = _("#NUM!");
return NULL;
}
return value_float (jn (y, value_get_as_double (argv [0])));
return value_new_float (jn (y, value_get_as_float (argv [0])));
}
static char *help_bessely = {
......@@ -459,7 +459,7 @@ gnumeric_bessely (struct FunctionDefinition *i,
*error_string = _("#NUM!");
return NULL;
}
return value_float (yn (y, value_get_as_double (argv [0])));
return value_new_float (yn (y, value_get_as_float (argv [0])));
}
......@@ -571,7 +571,7 @@ create_inumber (float_t real, float_t im, char *suffix)
static char buf[256];