Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
GNOME
gnumeric
Commits
c0531c9a
Commit
c0531c9a
authored
May 13, 1999
by
Michael Meeks
Browse files
Renamed several functions.
parent
88d90f6e
Changes
55
Expand all
Hide whitespace changes
Inline
Side-by-side
ChangeLog-1999-07-09
View file @
c0531c9a
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
...
...
ChangeLog-2000-02-23
View file @
c0531c9a
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
...
...
OChangeLog-1999-07-09
View file @
c0531c9a
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
...
...
OChangeLog-2000-02-23
View file @
c0531c9a
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
...
...
plugins/excel/ms-excel-read.c
View file @
c0531c9a
...
...
@@ -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
;
...
...
plugins/excel/ms-excel.c
View file @
c0531c9a
...
...
@@ -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
;
...
...
plugins/excel/ms-formula-read.c
View file @
c0531c9a
...
...
@@ -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
;
}
...
...
plugins/excel/ms-formula.c
View file @
c0531c9a
...
...
@@ -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
;
}
...
...
plugins/fn-database/functions.c
View file @
c0531c9a
...
...
@@ -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
);
}
...
...
plugins/fn-date/functions.c
View file @
c0531c9a
...
...
@@ -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
;
}