Skip to content
GitLab
Menu
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
1c5eefaa
Commit
1c5eefaa
authored
Apr 29, 1999
by
Morten Welinder
Browse files
Large batch of fixes. Improves types of gnumeric_*, fixes leaks and
crashes. Fixes parts of column/row insert/delete.
parent
6e7e4987
Changes
40
Hide whitespace changes
Inline
Side-by-side
ChangeLog-1999-07-09
View file @
1c5eefaa
1999-04-29 Morten Welinder <terra@diku.dk>
* src/expr.h (OPER_ANY_BINARY, OPER_ANY_UNARY): new convenience
macros.
(struct _Sheet): declare forward reference so we can use the right
types.
(CellRef, FunctionDefinition, expr_parse_string, expr_decode_tree,
eval_expr): use "struct _Sheet *".
* src/workbook.c (workbook_do_destroy): Carefully clean workbook
before deleting sheets. Do things in the standard way. Get rid
of clipboard leak.
(insert_cols_cmd): Fix name string.
(workbook_detach_sheet): New parameter "force". All callers
changed.
(workbook_fixup_references, workbook_invalidate_references,
workbook_sheets): New functions.
* src/sheet.c (sheet_verify_selection_simple): Mark strings for
translation.
(sheet_insert_col): Fixup references to moved cells.
(sheet_delete_col, sheet_delete_row): Invalidate references to
deleted cells.
* src/sheet-autofill.c (fill_item_new): Fix copying of cell with
error.
* src/parser.y (yylex): "const" fixes.
(gnumeric_expr_parser): New function (to fix memory corruption and
leaks).
* src/fn-stat.c (i1mach): Make static.
(gnumeric_var, gnumeric_varp, gnumeric_stdev, gnumeric_stdevp,
gnumeric_rank, gnumeric_trimmean, gnumeric_covar, gnumeric_correl,
gnumeric_mode, gnumeric_harmean, gnumeric_geomean, gnumeric_count,
gnumeric_counta, gnumeric_average, gnumeric_min, gnumeric_max,
gnumeric_skew, gnumeric_kurt, gnumeric_avedev, gnumeric_devsq,
gnumeric_pearson, gnumeric_rsq, gnumeric_median, gnumeric_large,
gnumeric_small, gnumeric_ztest): Fix type.
* src/fn-math.c (gnumeric_fact, gnumeric_combin): Mark strings for
translation.
(gnumeric_sum, gnumeric_trunc): Fix type.
* src/fn-lookup.c (gnumeric_choose, gnumeric_column,
gnumeric_row): Fix type.
* src/fn-misc.c (gnumeric_iserror): Fix type.
* src/fn-sheet.c (gnumeric_selection): Fix type.
* src/fn-string.c (gnumeric_concatenate): Fix type.
* src/fn-logical.c (gnumeric_and, gnumeric_not, gnumeric_or,
gnumeric_if): Fix type.
* src/fn-financial.c (gnumeric_npv): Fix type.
* src/expr.c (expr_parse_string): Move in part to parser.y.
Delete global variables to communicate.
(do_expr_tree_ref, do_expr_tree_unref, do_expr_decode_tree,
do_expr_tree_relocate): use OPER_ANY_BINARY and OPER_ANY_UNARY.
(function_call_with_values): Mark strings for translation.
(eval_expr, do_expr_decode_tree, expr_decode_tree): Fix type to
use "Sheet *" instead of "void *".
(do_expr_decode_tree): Free sum.
(expr_tree_invalidate_references, expr_tree_fixup_references): New
functions. Not implemented yet.
* src/cell.c (cell_set_formula): "const" fix.
(cell_copy): Ref entered_string also if it exists.
(cell_relocate): Unlink cell from workbook list of cells.
* src/about.c (dialog_about): Add myself. Update copyright.
1999-04-29 Jukka-Pekka Iivonen <iivonen@iki.fi>
* src/fn-{math,sheet,logical}.c, src/func.[ch]: Moved logical
...
...
ChangeLog-2000-02-23
View file @
1c5eefaa
1999-04-29 Morten Welinder <terra@diku.dk>
* src/expr.h (OPER_ANY_BINARY, OPER_ANY_UNARY): new convenience
macros.
(struct _Sheet): declare forward reference so we can use the right
types.
(CellRef, FunctionDefinition, expr_parse_string, expr_decode_tree,
eval_expr): use "struct _Sheet *".
* src/workbook.c (workbook_do_destroy): Carefully clean workbook
before deleting sheets. Do things in the standard way. Get rid
of clipboard leak.
(insert_cols_cmd): Fix name string.
(workbook_detach_sheet): New parameter "force". All callers
changed.
(workbook_fixup_references, workbook_invalidate_references,
workbook_sheets): New functions.
* src/sheet.c (sheet_verify_selection_simple): Mark strings for
translation.
(sheet_insert_col): Fixup references to moved cells.
(sheet_delete_col, sheet_delete_row): Invalidate references to
deleted cells.
* src/sheet-autofill.c (fill_item_new): Fix copying of cell with
error.
* src/parser.y (yylex): "const" fixes.
(gnumeric_expr_parser): New function (to fix memory corruption and
leaks).
* src/fn-stat.c (i1mach): Make static.
(gnumeric_var, gnumeric_varp, gnumeric_stdev, gnumeric_stdevp,
gnumeric_rank, gnumeric_trimmean, gnumeric_covar, gnumeric_correl,
gnumeric_mode, gnumeric_harmean, gnumeric_geomean, gnumeric_count,
gnumeric_counta, gnumeric_average, gnumeric_min, gnumeric_max,
gnumeric_skew, gnumeric_kurt, gnumeric_avedev, gnumeric_devsq,
gnumeric_pearson, gnumeric_rsq, gnumeric_median, gnumeric_large,
gnumeric_small, gnumeric_ztest): Fix type.
* src/fn-math.c (gnumeric_fact, gnumeric_combin): Mark strings for
translation.
(gnumeric_sum, gnumeric_trunc): Fix type.
* src/fn-lookup.c (gnumeric_choose, gnumeric_column,
gnumeric_row): Fix type.
* src/fn-misc.c (gnumeric_iserror): Fix type.
* src/fn-sheet.c (gnumeric_selection): Fix type.
* src/fn-string.c (gnumeric_concatenate): Fix type.
* src/fn-logical.c (gnumeric_and, gnumeric_not, gnumeric_or,
gnumeric_if): Fix type.
* src/fn-financial.c (gnumeric_npv): Fix type.
* src/expr.c (expr_parse_string): Move in part to parser.y.
Delete global variables to communicate.
(do_expr_tree_ref, do_expr_tree_unref, do_expr_decode_tree,
do_expr_tree_relocate): use OPER_ANY_BINARY and OPER_ANY_UNARY.
(function_call_with_values): Mark strings for translation.
(eval_expr, do_expr_decode_tree, expr_decode_tree): Fix type to
use "Sheet *" instead of "void *".
(do_expr_decode_tree): Free sum.
(expr_tree_invalidate_references, expr_tree_fixup_references): New
functions. Not implemented yet.
* src/cell.c (cell_set_formula): "const" fix.
(cell_copy): Ref entered_string also if it exists.
(cell_relocate): Unlink cell from workbook list of cells.
* src/about.c (dialog_about): Add myself. Update copyright.
1999-04-29 Jukka-Pekka Iivonen <iivonen@iki.fi>
* src/fn-{math,sheet,logical}.c, src/func.[ch]: Moved logical
...
...
OChangeLog-1999-07-09
View file @
1c5eefaa
1999-04-29 Morten Welinder <terra@diku.dk>
* src/expr.h (OPER_ANY_BINARY, OPER_ANY_UNARY): new convenience
macros.
(struct _Sheet): declare forward reference so we can use the right
types.
(CellRef, FunctionDefinition, expr_parse_string, expr_decode_tree,
eval_expr): use "struct _Sheet *".
* src/workbook.c (workbook_do_destroy): Carefully clean workbook
before deleting sheets. Do things in the standard way. Get rid
of clipboard leak.
(insert_cols_cmd): Fix name string.
(workbook_detach_sheet): New parameter "force". All callers
changed.
(workbook_fixup_references, workbook_invalidate_references,
workbook_sheets): New functions.
* src/sheet.c (sheet_verify_selection_simple): Mark strings for
translation.
(sheet_insert_col): Fixup references to moved cells.
(sheet_delete_col, sheet_delete_row): Invalidate references to
deleted cells.
* src/sheet-autofill.c (fill_item_new): Fix copying of cell with
error.
* src/parser.y (yylex): "const" fixes.
(gnumeric_expr_parser): New function (to fix memory corruption and
leaks).
* src/fn-stat.c (i1mach): Make static.
(gnumeric_var, gnumeric_varp, gnumeric_stdev, gnumeric_stdevp,
gnumeric_rank, gnumeric_trimmean, gnumeric_covar, gnumeric_correl,
gnumeric_mode, gnumeric_harmean, gnumeric_geomean, gnumeric_count,
gnumeric_counta, gnumeric_average, gnumeric_min, gnumeric_max,
gnumeric_skew, gnumeric_kurt, gnumeric_avedev, gnumeric_devsq,
gnumeric_pearson, gnumeric_rsq, gnumeric_median, gnumeric_large,
gnumeric_small, gnumeric_ztest): Fix type.
* src/fn-math.c (gnumeric_fact, gnumeric_combin): Mark strings for
translation.
(gnumeric_sum, gnumeric_trunc): Fix type.
* src/fn-lookup.c (gnumeric_choose, gnumeric_column,
gnumeric_row): Fix type.
* src/fn-misc.c (gnumeric_iserror): Fix type.
* src/fn-sheet.c (gnumeric_selection): Fix type.
* src/fn-string.c (gnumeric_concatenate): Fix type.
* src/fn-logical.c (gnumeric_and, gnumeric_not, gnumeric_or,
gnumeric_if): Fix type.
* src/fn-financial.c (gnumeric_npv): Fix type.
* src/expr.c (expr_parse_string): Move in part to parser.y.
Delete global variables to communicate.
(do_expr_tree_ref, do_expr_tree_unref, do_expr_decode_tree,
do_expr_tree_relocate): use OPER_ANY_BINARY and OPER_ANY_UNARY.
(function_call_with_values): Mark strings for translation.
(eval_expr, do_expr_decode_tree, expr_decode_tree): Fix type to
use "Sheet *" instead of "void *".
(do_expr_decode_tree): Free sum.
(expr_tree_invalidate_references, expr_tree_fixup_references): New
functions. Not implemented yet.
* src/cell.c (cell_set_formula): "const" fix.
(cell_copy): Ref entered_string also if it exists.
(cell_relocate): Unlink cell from workbook list of cells.
* src/about.c (dialog_about): Add myself. Update copyright.
1999-04-29 Jukka-Pekka Iivonen <iivonen@iki.fi>
* src/fn-{math,sheet,logical}.c, src/func.[ch]: Moved logical
...
...
OChangeLog-2000-02-23
View file @
1c5eefaa
1999-04-29 Morten Welinder <terra@diku.dk>
* src/expr.h (OPER_ANY_BINARY, OPER_ANY_UNARY): new convenience
macros.
(struct _Sheet): declare forward reference so we can use the right
types.
(CellRef, FunctionDefinition, expr_parse_string, expr_decode_tree,
eval_expr): use "struct _Sheet *".
* src/workbook.c (workbook_do_destroy): Carefully clean workbook
before deleting sheets. Do things in the standard way. Get rid
of clipboard leak.
(insert_cols_cmd): Fix name string.
(workbook_detach_sheet): New parameter "force". All callers
changed.
(workbook_fixup_references, workbook_invalidate_references,
workbook_sheets): New functions.
* src/sheet.c (sheet_verify_selection_simple): Mark strings for
translation.
(sheet_insert_col): Fixup references to moved cells.
(sheet_delete_col, sheet_delete_row): Invalidate references to
deleted cells.
* src/sheet-autofill.c (fill_item_new): Fix copying of cell with
error.
* src/parser.y (yylex): "const" fixes.
(gnumeric_expr_parser): New function (to fix memory corruption and
leaks).
* src/fn-stat.c (i1mach): Make static.
(gnumeric_var, gnumeric_varp, gnumeric_stdev, gnumeric_stdevp,
gnumeric_rank, gnumeric_trimmean, gnumeric_covar, gnumeric_correl,
gnumeric_mode, gnumeric_harmean, gnumeric_geomean, gnumeric_count,
gnumeric_counta, gnumeric_average, gnumeric_min, gnumeric_max,
gnumeric_skew, gnumeric_kurt, gnumeric_avedev, gnumeric_devsq,
gnumeric_pearson, gnumeric_rsq, gnumeric_median, gnumeric_large,
gnumeric_small, gnumeric_ztest): Fix type.
* src/fn-math.c (gnumeric_fact, gnumeric_combin): Mark strings for
translation.
(gnumeric_sum, gnumeric_trunc): Fix type.
* src/fn-lookup.c (gnumeric_choose, gnumeric_column,
gnumeric_row): Fix type.
* src/fn-misc.c (gnumeric_iserror): Fix type.
* src/fn-sheet.c (gnumeric_selection): Fix type.
* src/fn-string.c (gnumeric_concatenate): Fix type.
* src/fn-logical.c (gnumeric_and, gnumeric_not, gnumeric_or,
gnumeric_if): Fix type.
* src/fn-financial.c (gnumeric_npv): Fix type.
* src/expr.c (expr_parse_string): Move in part to parser.y.
Delete global variables to communicate.
(do_expr_tree_ref, do_expr_tree_unref, do_expr_decode_tree,
do_expr_tree_relocate): use OPER_ANY_BINARY and OPER_ANY_UNARY.
(function_call_with_values): Mark strings for translation.
(eval_expr, do_expr_decode_tree, expr_decode_tree): Fix type to
use "Sheet *" instead of "void *".
(do_expr_decode_tree): Free sum.
(expr_tree_invalidate_references, expr_tree_fixup_references): New
functions. Not implemented yet.
* src/cell.c (cell_set_formula): "const" fix.
(cell_copy): Ref entered_string also if it exists.
(cell_relocate): Unlink cell from workbook list of cells.
* src/about.c (dialog_about): Add myself. Update copyright.
1999-04-29 Jukka-Pekka Iivonen <iivonen@iki.fi>
* src/fn-{math,sheet,logical}.c, src/func.[ch]: Moved logical
...
...
plugins/fn-financial/functions.c
View file @
1c5eefaa
...
...
@@ -426,10 +426,9 @@ callback_function_npv (Sheet *sheet, Value *value, char **error_string, void *cl
}
static
Value
*
gnumeric_npv
(
void
*
t
sheet
,
GList
*
expr_node_list
,
int
eval_col
,
int
eval_row
,
char
**
error_string
)
gnumeric_npv
(
Sheet
*
sheet
,
GList
*
expr_node_list
,
int
eval_col
,
int
eval_row
,
char
**
error_string
)
{
financial_npv_t
p
;
Sheet
*
sheet
=
(
Sheet
*
)
tsheet
;
p
.
first
=
TRUE
;
p
.
sum
=
0
.
0
;
...
...
plugins/fn-logical/functions.c
View file @
1c5eefaa
...
...
@@ -64,11 +64,10 @@ callback_function_and (Sheet *sheet, Value *value,
}
static
Value
*
gnumeric_and
(
void
*
t
sheet
,
GList
*
expr_node_list
,
gnumeric_and
(
Sheet
*
sheet
,
GList
*
expr_node_list
,
int
eval_col
,
int
eval_row
,
char
**
error_string
)
{
Value
*
result
;
Sheet
*
sheet
=
(
Sheet
*
)
tsheet
;
result
=
g_new
(
Value
,
1
);
result
->
type
=
VALUE_INTEGER
;
...
...
@@ -158,11 +157,10 @@ callback_function_or (Sheet *sheet, Value *value,
}
static
Value
*
gnumeric_or
(
void
*
t
sheet
,
GList
*
expr_node_list
,
gnumeric_or
(
Sheet
*
sheet
,
GList
*
expr_node_list
,
int
eval_col
,
int
eval_row
,
char
**
error_string
)
{
Value
*
result
;
Sheet
*
sheet
=
(
Sheet
*
)
tsheet
;
result
=
g_new
(
Value
,
1
);
result
->
type
=
VALUE_INTEGER
;
...
...
@@ -196,7 +194,7 @@ static char *help_if = {
};
static
Value
*
gnumeric_if
(
void
*
t
sheet
,
GList
*
expr_node_list
,
gnumeric_if
(
Sheet
*
sheet
,
GList
*
expr_node_list
,
int
eval_col
,
int
eval_row
,
char
**
error_string
)
{
ExprTree
*
expr
;
...
...
@@ -211,7 +209,7 @@ gnumeric_if (void *tsheet, GList *expr_node_list,
}
/* Compute the if part */
value
=
eval_expr
(
t
sheet
,
(
ExprTree
*
)
expr_node_list
->
data
,
value
=
eval_expr
(
sheet
,
(
ExprTree
*
)
expr_node_list
->
data
,
eval_col
,
eval_row
,
error_string
);
if
(
value
==
NULL
)
return
NULL
;
...
...
@@ -236,7 +234,7 @@ gnumeric_if (void *tsheet, GList *expr_node_list,
}
/* Return the result */
return
eval_expr
(
t
sheet
,
(
ExprTree
*
)
expr
,
eval_col
,
return
eval_expr
(
sheet
,
(
ExprTree
*
)
expr
,
eval_col
,
eval_row
,
error_string
);
}
...
...
plugins/fn-lookup/functions.c
View file @
1c5eefaa
...
...
@@ -28,7 +28,7 @@ static char *help_choose = {
};
static
Value
*
gnumeric_choose
(
void
*
t
sheet
,
GList
*
expr_node_list
,
int
eval_col
,
int
eval_row
,
char
**
error_string
)
gnumeric_choose
(
Sheet
*
sheet
,
GList
*
expr_node_list
,
int
eval_col
,
int
eval_row
,
char
**
error_string
)
{
int
index
;
int
argc
;
...
...
@@ -42,7 +42,7 @@ gnumeric_choose (void *tsheet, GList *expr_node_list, int eval_col, int eval_row
*
error_string
=
_
(
"#ARG!"
);
return
NULL
;
}
v
=
eval_expr
(
t
sheet
,
l
->
data
,
eval_col
,
eval_row
,
error_string
);
v
=
eval_expr
(
sheet
,
l
->
data
,
eval_col
,
eval_row
,
error_string
);
if
(
!
v
)
return
NULL
;
if
(
v
->
type
!=
VALUE_INTEGER
&&
v
->
type
!=
VALUE_FLOAT
)
{
...
...
@@ -55,7 +55,7 @@ gnumeric_choose (void *tsheet, GList *expr_node_list, int eval_col, int eval_row
while
(
l
)
{
index
--
;
if
(
!
index
)
return
eval_expr
(
t
sheet
,
l
->
data
,
eval_col
,
eval_row
,
error_string
);
return
eval_expr
(
sheet
,
l
->
data
,
eval_col
,
eval_row
,
error_string
);
l
=
g_list_next
(
l
);
}
*
error_string
=
_
(
"#VALUE!"
);
...
...
@@ -306,23 +306,23 @@ static char *help_column = {
/* FIXME: Needs Array support to be enven slightly meaningful */
static
Value
*
gnumeric_column
(
void
*
t
sheet
,
GList
*
expr_node_list
,
int
eval_col
,
int
eval_row
,
char
**
error_string
)
gnumeric_column
(
Sheet
*
sheet
,
GList
*
expr_node_list
,
int
eval_col
,
int
eval_row
,
char
**
error_string
)
{
Value
*
v
;
if
(
!
expr_node_list
||
!
expr_node_list
->
data
)
return
value_int
(
eval_col
+
1
);
v
=
eval_expr
(
t
sheet
,
expr_node_list
->
data
,
eval_col
,
eval_row
,
error_string
);
v
=
eval_expr
(
sheet
,
expr_node_list
->
data
,
eval_col
,
eval_row
,
error_string
);
if
(
!
v
)
return
NULL
;
switch
(
v
->
type
){
case
VALUE_CELLRANGE
:
*
error_string
=
"Arrays not yet supported"
;
*
error_string
=
_
(
"Arrays not yet supported"
)
;
return
NULL
;
case
VALUE_ARRAY
:
*
error_string
=
_
(
"Unimplemented
\n
"
);
*
error_string
=
_
(
"Unimplemented"
);
return
NULL
;
default:
*
error_string
=
_
(
"#VALUE!"
);
...
...
@@ -405,23 +405,23 @@ static char *help_row = {
/* FIXME: Needs Array support to be enven slightly meaningful */
static
Value
*
gnumeric_row
(
void
*
t
sheet
,
GList
*
expr_node_list
,
int
eval_col
,
int
eval_row
,
char
**
error_string
)
gnumeric_row
(
Sheet
*
sheet
,
GList
*
expr_node_list
,
int
eval_col
,
int
eval_row
,
char
**
error_string
)
{
Value
*
v
;
if
(
!
expr_node_list
||
!
expr_node_list
->
data
)
return
value_int
(
eval_row
+
1
);
v
=
eval_expr
(
t
sheet
,
expr_node_list
->
data
,
eval_col
,
eval_row
,
error_string
);
v
=
eval_expr
(
sheet
,
expr_node_list
->
data
,
eval_col
,
eval_row
,
error_string
);
if
(
!
v
)
return
NULL
;
switch
(
v
->
type
){
case
VALUE_CELLRANGE
:
*
error_string
=
"Arrays not yet supported"
;
*
error_string
=
_
(
"Arrays not yet supported"
)
;
return
NULL
;
case
VALUE_ARRAY
:
*
error_string
=
_
(
"Unimplemented
\n
"
);
*
error_string
=
_
(
"Unimplemented"
);
return
NULL
;
default:
*
error_string
=
_
(
"#VALUE!"
);
...
...
@@ -459,7 +459,3 @@ FunctionDefinition lookup_functions [] = {
{
"vlookup"
,
"?Af|b"
,
"val,range,col_idx,approx"
,
&
help_vlookup
,
NULL
,
gnumeric_vlookup
},
{
NULL
,
NULL
}
};
plugins/fn-math/functions.c
View file @
1c5eefaa
...
...
@@ -13,7 +13,6 @@
#include "utils.h"
#include "func.h"
#if 0
/* help template */
static char *help_ = {
...
...
@@ -446,12 +445,12 @@ gnumeric_fact (struct FunctionDefinition *id,
i
=
argv
[
0
]
->
v
.
v_int
;
break
;
default:
*
error_string
=
"#NUM!"
;
*
error_string
=
_
(
"#NUM!"
)
;
return
NULL
;
}
if
(
i
<
0
){
*
error_string
=
"#NUM!"
;
*
error_string
=
_
(
"#NUM!"
)
;
return
NULL
;
}
...
...
@@ -499,7 +498,7 @@ gnumeric_combin (struct FunctionDefinition *id,
n
=
argv
[
0
]
->
v
.
v_int
;
k
=
argv
[
1
]
->
v
.
v_int
;
}
else
{
*
error_string
=
"#NUM!"
;
*
error_string
=
_
(
"#NUM!"
)
;
return
NULL
;
}
...
...
@@ -882,11 +881,10 @@ callback_function_sum (Sheet *sheet, Value *value,
}
Value
*
gnumeric_sum
(
void
*
t
sheet
,
GList
*
expr_node_list
,
gnumeric_sum
(
Sheet
*
sheet
,
GList
*
expr_node_list
,
int
eval_col
,
int
eval_row
,
char
**
error_string
)
{
Value
*
result
;
Sheet
*
sheet
=
(
Sheet
*
)
tsheet
;
result
=
g_new
(
Value
,
1
);
result
->
type
=
VALUE_INTEGER
;
...
...
@@ -1141,7 +1139,7 @@ static char *help_trunc = {
"@SEEALSO="
)
};
static
Value
*
gnumeric_trunc
(
void
*
t
sheet
,
GList
*
expr_node_list
,
gnumeric_trunc
(
Sheet
*
sheet
,
GList
*
expr_node_list
,
int
eval_col
,
int
eval_row
,
char
**
error_string
)
{
Value
*
number
;
...
...
@@ -1154,7 +1152,7 @@ gnumeric_trunc (void *tsheet, GList *expr_node_list,
return
NULL
;
}
number
=
eval_expr
(
t
sheet
,
(
ExprTree
*
)
expr_node_list
->
data
,
number
=
eval_expr
(
sheet
,
(
ExprTree
*
)
expr_node_list
->
data
,
eval_col
,
eval_row
,
error_string
);
if
(
!
number
)
return
NULL
;
...
...
@@ -1165,7 +1163,7 @@ gnumeric_trunc (void *tsheet, GList *expr_node_list,
if
(
args
==
2
){
Value
*
value
;
value
=
eval_expr
(
t
sheet
,
value
=
eval_expr
(
sheet
,
(
ExprTree
*
)
expr_node_list
->
next
->
data
,
eval_col
,
eval_row
,
error_string
);
if
(
!
value
){
...
...
plugins/fn-stat/functions.c
View file @
1c5eefaa
...
...
@@ -176,7 +176,8 @@ pgamma(double x, double p, double scale)
* (src/nmath/i1match.c) written and copyrighted (1998) by Ross Ihaka.
* Modified for Gnumeric by Jukka-Pekka Iivonen
*/
int
i1mach
(
int
i
)
static
int
i1mach
(
int
i
)
{
switch
(
i
)
{
case
1
:
...
...
@@ -650,11 +651,10 @@ static char *help_varp = {
};
static
Value
*
gnumeric_varp
(
void
*
t
sheet
,
GList
*
expr_node_list
,
int
eval_col
,
gnumeric_varp
(
Sheet
*
sheet
,
GList
*
expr_node_list
,
int
eval_col
,
int
eval_row
,
char
**
error_string
)
{
stat_closure_t
cl
;
Sheet
*
sheet
=
(
Sheet
*
)
tsheet
;
float_t
ans
,
num
;
setup_stat_closure
(
&
cl
);
...
...
@@ -685,11 +685,10 @@ static char *help_var = {
};
static
Value
*
gnumeric_var
(
void
*
t
sheet
,
GList
*
expr_node_list
,
int
eval_col
,
gnumeric_var
(
Sheet
*
sheet
,
GList
*
expr_node_list
,
int
eval_col
,
int
eval_row
,
char
**
error_string
)
{
stat_closure_t
cl
;
Sheet
*
sheet
=
(
Sheet
*
)
tsheet
;
float_t
ans
,
num
;
setup_stat_closure
(
&
cl
);
...
...
@@ -716,10 +715,10 @@ static char *help_stdev = {
};
static
Value
*
gnumeric_stdev
(
void
*
t
sheet
,
GList
*
expr_node_list
,
int
eval_col
,
gnumeric_stdev
(
Sheet
*
sheet
,
GList
*
expr_node_list
,
int
eval_col
,
int
eval_row
,
char
**
error_string
)
{
Value
*
ans
=
gnumeric_var
(
t
sheet
,
expr_node_list
,
eval_col
,
eval_row
,
error_string
);
Value
*
ans
=
gnumeric_var
(
sheet
,
expr_node_list
,
eval_col
,
eval_row
,
error_string
);
if
(
ans
&&
(
ans
->
type
==
VALUE_FLOAT
))
ans
->
v
.
v_float
=
sqrt
(
ans
->
v
.
v_float
);
...
...
@@ -740,10 +739,10 @@ static char *help_stdevp = {
};
static
Value
*
gnumeric_stdevp
(
void
*
t
sheet
,
GList
*
expr_node_list
,
int
eval_col
,
gnumeric_stdevp
(
Sheet
*
sheet
,
GList
*
expr_node_list
,
int
eval_col
,
int
eval_row
,
char
**
error_string
)
{
Value
*
ans
=
gnumeric_varp
(
t
sheet
,
expr_node_list
,
eval_col
,
eval_row
,
error_string
);
Value
*
ans
=
gnumeric_varp
(
sheet
,
expr_node_list
,
eval_col
,
eval_row
,
error_string
);
if
(
ans
&&
(
ans
->
type
==
VALUE_FLOAT
))
ans
->
v
.
v_float
=
sqrt
(
ans
->
v
.
v_float
);
...
...
@@ -867,11 +866,10 @@ callback_function_rank (Sheet *sheet, Value *value,
}
static
Value
*
gnumeric_rank
(
void
*
t
sheet
,
GList
*
expr_node_list
,
gnumeric_rank
(
Sheet
*
sheet
,
GList
*
expr_node_list
,
int
eval_col
,
int
eval_row
,
char
**
error_string
)
{
stat_rank_t
p
;
Sheet
*
sheet
=
(
Sheet
*
)
tsheet
;
GSList
*
list
;
int
order
,
rank
;
...
...
@@ -966,11 +964,10 @@ callback_function_trimmean (Sheet *sheet, Value *value,
}
static
Value
*
gnumeric_trimmean
(
void
*
t
sheet
,
GList
*
expr_node_list
,
gnumeric_trimmean
(
Sheet
*
sheet
,
GList
*
expr_node_list
,
int
eval_col
,
int
eval_row
,
char
**
error_string
)
{
stat_trimmean_t
p
;
Sheet
*
sheet
=
(
Sheet
*
)
tsheet
;
GSList
*
list
;
int
trim_count
,
n
,
count
;
float_t
sum
;
...
...
@@ -1085,18 +1082,17 @@ callback_function_covar (Sheet *sheet, Value *value,
}
static
Value
*
gnumeric_covar
(
void
*
t
sheet
,
GList
*
expr_node_list
,
gnumeric_covar
(
Sheet
*
sheet
,
GList
*
expr_node_list
,
int
eval_col
,
int
eval_row
,
char
**
error_string
)
{