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
de741043
Commit
de741043
authored
May 04, 1999
by
Morten Welinder
Browse files
Cleanup and severe eval queue fix.
parent
940ac911
Changes
17
Hide whitespace changes
Inline
Side-by-side
ChangeLog-1999-07-09
View file @
de741043
1999-05-04 Morten Welinder <terra@diku.dk>
* src/eval.c (dependency_remove_cell): Remove unused assignment.
(cell_queue_recalc_list): Mark queued cells as being so.
* src/fn-math.c (gnumeric_combin): Clean up.
(combin): Handle large numbers carefully.
* src/utils.c (january_1900): Fix argument list.
* src/fn-stat.c (gnumeric_var): Remove unused variable.
(gnumeric_varp): Ditto.
1999-05-04 Jukka-Pekka Iivonen <iivonen@iki.fi>
* src/fn-math: Added ROUND().
...
...
ChangeLog-2000-02-23
View file @
de741043
1999-05-04 Morten Welinder <terra@diku.dk>
* src/eval.c (dependency_remove_cell): Remove unused assignment.
(cell_queue_recalc_list): Mark queued cells as being so.
* src/fn-math.c (gnumeric_combin): Clean up.
(combin): Handle large numbers carefully.
* src/utils.c (january_1900): Fix argument list.
* src/fn-stat.c (gnumeric_var): Remove unused variable.
(gnumeric_varp): Ditto.
1999-05-04 Jukka-Pekka Iivonen <iivonen@iki.fi>
* src/fn-math: Added ROUND().
...
...
OChangeLog-1999-07-09
View file @
de741043
1999-05-04 Morten Welinder <terra@diku.dk>
* src/eval.c (dependency_remove_cell): Remove unused assignment.
(cell_queue_recalc_list): Mark queued cells as being so.
* src/fn-math.c (gnumeric_combin): Clean up.
(combin): Handle large numbers carefully.
* src/utils.c (january_1900): Fix argument list.
* src/fn-stat.c (gnumeric_var): Remove unused variable.
(gnumeric_varp): Ditto.
1999-05-04 Jukka-Pekka Iivonen <iivonen@iki.fi>
* src/fn-math: Added ROUND().
...
...
OChangeLog-2000-02-23
View file @
de741043
1999-05-04 Morten Welinder <terra@diku.dk>
* src/eval.c (dependency_remove_cell): Remove unused assignment.
(cell_queue_recalc_list): Mark queued cells as being so.
* src/fn-math.c (gnumeric_combin): Clean up.
(combin): Handle large numbers carefully.
* src/utils.c (january_1900): Fix argument list.
* src/fn-stat.c (gnumeric_var): Remove unused variable.
(gnumeric_varp): Ditto.
1999-05-04 Jukka-Pekka Iivonen <iivonen@iki.fi>
* src/fn-math: Added ROUND().
...
...
plugins/excel/ChangeLog
View file @
de741043
1999-05-04 Morten Welinder <terra@diku.dk>
* ms-excel.c (ms_excel_workbook_new): Fix argument list.
1999-05-02 Michael Meeks <michael@imaginator.com>
* ms-excel.c (biff_get_externsheet_name): Converted to return
...
...
plugins/excel/ms-excel-read.c
View file @
de741043
...
...
@@ -1297,7 +1297,7 @@ ms_excel_sheet_destroy (MS_EXCEL_SHEET * sheet)
}
static
MS_EXCEL_WORKBOOK
*
ms_excel_workbook_new
()
ms_excel_workbook_new
(
void
)
{
MS_EXCEL_WORKBOOK
*
ans
=
(
MS_EXCEL_WORKBOOK
*
)
g_malloc
(
sizeof
(
MS_EXCEL_WORKBOOK
));
...
...
plugins/excel/ms-excel.c
View file @
de741043
...
...
@@ -1297,7 +1297,7 @@ ms_excel_sheet_destroy (MS_EXCEL_SHEET * sheet)
}
static
MS_EXCEL_WORKBOOK
*
ms_excel_workbook_new
()
ms_excel_workbook_new
(
void
)
{
MS_EXCEL_WORKBOOK
*
ans
=
(
MS_EXCEL_WORKBOOK
*
)
g_malloc
(
sizeof
(
MS_EXCEL_WORKBOOK
));
...
...
plugins/fn-math/functions.c
View file @
de741043
...
...
@@ -482,30 +482,33 @@ static char *help_combin = {
float_t
combin
(
int
n
,
int
k
)
{
return
fact
(
n
)
/
(
fact
(
k
)
*
fact
(
n
-
k
));
if
(
n
>=
15
)
{
float_t
res
;
res
=
exp
(
lgamma
(
n
+
1
)
-
lgamma
(
k
+
1
)
-
lgamma
(
n
-
k
+
1
));
return
floor
(
res
+
0
.
5
);
/* Round, just in case. */
}
else
{
float_t
res
;
res
=
fact
(
n
)
/
fact
(
k
)
/
fact
(
n
-
k
);
return
res
;
}
}
static
Value
*
gnumeric_combin
(
struct
FunctionDefinition
*
id
,
Value
*
argv
[],
char
**
error_string
)
{
Value
*
res
;
float_t
n
,
k
;
int
n
,
k
;
if
(
argv
[
0
]
->
type
==
VALUE_INTEGER
&&
argv
[
1
]
->
type
==
VALUE_INTEGER
&&
argv
[
0
]
->
v
.
v_int
>=
argv
[
1
]
->
v
.
v_int
){
n
=
argv
[
0
]
->
v
.
v_int
;
k
=
argv
[
1
]
->
v
.
v_int
;
}
else
{
*
error_string
=
_
(
"#NUM!"
);
return
NULL
;
}
res
=
g_new
(
Value
,
1
);
res
->
type
=
VALUE_INTEGER
;
res
->
v
.
v_int
=
combin
((
int
)
n
,
(
int
)
k
);
return
res
;
n
=
value_get_as_int
(
argv
[
0
]);
k
=
value_get_as_int
(
argv
[
1
]);
if
(
k
>=
0
&&
n
>=
k
)
return
value_float
(
combin
(
n
,
k
));
*
error_string
=
_
(
"#NUM!"
);
return
NULL
;
}
static
char
*
help_floor
=
{
...
...
@@ -671,7 +674,7 @@ gnumeric_mod (struct FunctionDefinition *i,
Value
*
argv
[],
char
**
error_string
)
{
int
a
,
b
;
a
=
value_get_as_int
(
argv
[
0
])
;
b
=
value_get_as_int
(
argv
[
1
])
;
/* Obscure handling of C's mod function */
...
...
plugins/fn-stat/functions.c
View file @
de741043
...
...
@@ -650,7 +650,6 @@ gnumeric_varp (Sheet *sheet, GList *expr_node_list, int eval_col,
int
eval_row
,
char
**
error_string
)
{
stat_closure_t
cl
;
float_t
ans
,
num
;
setup_stat_closure
(
&
cl
);
...
...
@@ -688,7 +687,6 @@ gnumeric_var (Sheet *sheet, GList *expr_node_list, int eval_col,
int
eval_row
,
char
**
error_string
)
{
stat_closure_t
cl
;
float_t
ans
,
num
;
setup_stat_closure
(
&
cl
);
...
...
src/dependent.c
View file @
de741043
...
...
@@ -239,7 +239,7 @@ static void
dependency_remove_cell
(
gpointer
key
,
gpointer
value
,
gpointer
the_cell
)
{
DependencyRange
*
range
=
value
;
GList
*
list
=
range
->
cell_list
;
GList
*
list
;
list
=
g_list_find
(
range
->
cell_list
,
the_cell
);
if
(
!
list
)
...
...
@@ -413,6 +413,12 @@ cell_queue_recalc_list (GList *list)
wb
=
((
Sheet
*
)(
first_cell
->
sheet
))
->
workbook
;
wb
->
eval_queue
=
g_list_concat
(
wb
->
eval_queue
,
list
);
while
(
list
)
{
Cell
*
cell
=
list
->
data
;
cell
->
flags
|=
CELL_QUEUED_FOR_RECALC
;
list
=
list
->
next
;
}
}
static
Cell
*
...
...
src/eval.c
View file @
de741043
...
...
@@ -239,7 +239,7 @@ static void
dependency_remove_cell
(
gpointer
key
,
gpointer
value
,
gpointer
the_cell
)
{
DependencyRange
*
range
=
value
;
GList
*
list
=
range
->
cell_list
;
GList
*
list
;
list
=
g_list_find
(
range
->
cell_list
,
the_cell
);
if
(
!
list
)
...
...
@@ -413,6 +413,12 @@ cell_queue_recalc_list (GList *list)
wb
=
((
Sheet
*
)(
first_cell
->
sheet
))
->
workbook
;
wb
->
eval_queue
=
g_list_concat
(
wb
->
eval_queue
,
list
);
while
(
list
)
{
Cell
*
cell
=
list
->
data
;
cell
->
flags
|=
CELL_QUEUED_FOR_RECALC
;
list
=
list
->
next
;
}
}
static
Cell
*
...
...
src/fn-math.c
View file @
de741043
...
...
@@ -482,30 +482,33 @@ static char *help_combin = {
float_t
combin
(
int
n
,
int
k
)
{
return
fact
(
n
)
/
(
fact
(
k
)
*
fact
(
n
-
k
));
if
(
n
>=
15
)
{
float_t
res
;
res
=
exp
(
lgamma
(
n
+
1
)
-
lgamma
(
k
+
1
)
-
lgamma
(
n
-
k
+
1
));
return
floor
(
res
+
0
.
5
);
/* Round, just in case. */
}
else
{
float_t
res
;
res
=
fact
(
n
)
/
fact
(
k
)
/
fact
(
n
-
k
);
return
res
;
}
}
static
Value
*
gnumeric_combin
(
struct
FunctionDefinition
*
id
,
Value
*
argv
[],
char
**
error_string
)
{
Value
*
res
;
float_t
n
,
k
;
int
n
,
k
;
if
(
argv
[
0
]
->
type
==
VALUE_INTEGER
&&
argv
[
1
]
->
type
==
VALUE_INTEGER
&&
argv
[
0
]
->
v
.
v_int
>=
argv
[
1
]
->
v
.
v_int
){
n
=
argv
[
0
]
->
v
.
v_int
;
k
=
argv
[
1
]
->
v
.
v_int
;
}
else
{
*
error_string
=
_
(
"#NUM!"
);
return
NULL
;
}
res
=
g_new
(
Value
,
1
);
res
->
type
=
VALUE_INTEGER
;
res
->
v
.
v_int
=
combin
((
int
)
n
,
(
int
)
k
);
return
res
;
n
=
value_get_as_int
(
argv
[
0
]);
k
=
value_get_as_int
(
argv
[
1
]);
if
(
k
>=
0
&&
n
>=
k
)
return
value_float
(
combin
(
n
,
k
));
*
error_string
=
_
(
"#NUM!"
);
return
NULL
;
}
static
char
*
help_floor
=
{
...
...
@@ -671,7 +674,7 @@ gnumeric_mod (struct FunctionDefinition *i,
Value
*
argv
[],
char
**
error_string
)
{
int
a
,
b
;
a
=
value_get_as_int
(
argv
[
0
])
;
b
=
value_get_as_int
(
argv
[
1
])
;
/* Obscure handling of C's mod function */
...
...
src/fn-stat.c
View file @
de741043
...
...
@@ -650,7 +650,6 @@ gnumeric_varp (Sheet *sheet, GList *expr_node_list, int eval_col,
int
eval_row
,
char
**
error_string
)
{
stat_closure_t
cl
;
float_t
ans
,
num
;
setup_stat_closure
(
&
cl
);
...
...
@@ -688,7 +687,6 @@ gnumeric_var (Sheet *sheet, GList *expr_node_list, int eval_col,
int
eval_row
,
char
**
error_string
)
{
stat_closure_t
cl
;
float_t
ans
,
num
;
setup_stat_closure
(
&
cl
);
...
...
src/functions/fn-math.c
View file @
de741043
...
...
@@ -482,30 +482,33 @@ static char *help_combin = {
float_t
combin
(
int
n
,
int
k
)
{
return
fact
(
n
)
/
(
fact
(
k
)
*
fact
(
n
-
k
));
if
(
n
>=
15
)
{
float_t
res
;
res
=
exp
(
lgamma
(
n
+
1
)
-
lgamma
(
k
+
1
)
-
lgamma
(
n
-
k
+
1
));
return
floor
(
res
+
0
.
5
);
/* Round, just in case. */
}
else
{
float_t
res
;
res
=
fact
(
n
)
/
fact
(
k
)
/
fact
(
n
-
k
);
return
res
;
}
}
static
Value
*
gnumeric_combin
(
struct
FunctionDefinition
*
id
,
Value
*
argv
[],
char
**
error_string
)
{
Value
*
res
;
float_t
n
,
k
;
int
n
,
k
;
if
(
argv
[
0
]
->
type
==
VALUE_INTEGER
&&
argv
[
1
]
->
type
==
VALUE_INTEGER
&&
argv
[
0
]
->
v
.
v_int
>=
argv
[
1
]
->
v
.
v_int
){
n
=
argv
[
0
]
->
v
.
v_int
;
k
=
argv
[
1
]
->
v
.
v_int
;
}
else
{
*
error_string
=
_
(
"#NUM!"
);
return
NULL
;
}
res
=
g_new
(
Value
,
1
);
res
->
type
=
VALUE_INTEGER
;
res
->
v
.
v_int
=
combin
((
int
)
n
,
(
int
)
k
);
return
res
;
n
=
value_get_as_int
(
argv
[
0
]);
k
=
value_get_as_int
(
argv
[
1
]);
if
(
k
>=
0
&&
n
>=
k
)
return
value_float
(
combin
(
n
,
k
));
*
error_string
=
_
(
"#NUM!"
);
return
NULL
;
}
static
char
*
help_floor
=
{
...
...
@@ -671,7 +674,7 @@ gnumeric_mod (struct FunctionDefinition *i,
Value
*
argv
[],
char
**
error_string
)
{
int
a
,
b
;
a
=
value_get_as_int
(
argv
[
0
])
;
b
=
value_get_as_int
(
argv
[
1
])
;
/* Obscure handling of C's mod function */
...
...
src/functions/fn-stat.c
View file @
de741043
...
...
@@ -650,7 +650,6 @@ gnumeric_varp (Sheet *sheet, GList *expr_node_list, int eval_col,
int
eval_row
,
char
**
error_string
)
{
stat_closure_t
cl
;
float_t
ans
,
num
;
setup_stat_closure
(
&
cl
);
...
...
@@ -688,7 +687,6 @@ gnumeric_var (Sheet *sheet, GList *expr_node_list, int eval_col,
int
eval_row
,
char
**
error_string
)
{
stat_closure_t
cl
;
float_t
ans
,
num
;
setup_stat_closure
(
&
cl
);
...
...
src/gutils.c
View file @
de741043
...
...
@@ -197,7 +197,7 @@ gnumeric_strcase_hash (gconstpointer v)
}
static
guint32
january_1900
(
)
january_1900
(
void
)
{
static
guint32
julian
=
0
;
...
...
src/utils.c
View file @
de741043
...
...
@@ -197,7 +197,7 @@ gnumeric_strcase_hash (gconstpointer v)
}
static
guint32
january_1900
(
)
january_1900
(
void
)
{
static
guint32
julian
=
0
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment