Commit 2f45c412 authored by Morten Welinder's avatar Morten Welinder

cvs bombed. retry.

parent 077928ec
2002-12-16 Morten Welinder <terra@diku.dk>
* functions.c (gnumeric_error_type): Base on value_error_classify.
2002-11-15 Jody Goldberg <jody@gnome.org>
* Release 1.1.12
......
......@@ -287,7 +287,7 @@ gnumeric_cell (FunctionEvalInfo *ei, Value **argv)
* no need for them but included to make 123 conversion easier
Case "datatype", "formulatype", "type"
t = Left(prop, 1)
rv = IIf( t = "f" And rng.HasFormula, "f", "" )
If rng.formula = "" Then
......@@ -368,18 +368,18 @@ Function ExtCell( _
ExtCell = CVErr(xlErrRef)
Exit Function
End If
prop = LCase(prop)
m = rng.rows.Count
n = rng.Columns.Count
rv = rng.Value
Set ws = rng.Worksheet
Set wb = ws.Parent
Select Case prop
Case "across" /* from later 123 versions - limited usefulness! */
If rar Then
For i = 1 To m
......@@ -396,7 +396,7 @@ Function ExtCell( _
xlHAlignCenterAcrossSelection _
)
End If
Case "backgroundcolor" /* from later 123 versions - USEFUL! */
If rar Then
For i = 1 To m
......@@ -407,7 +407,7 @@ Function ExtCell( _
Else
rv = rng.Interior.ColorIndex
End If
Case "bold" /* from later 123 versions - USEFUL! */
If rar Then
For i = 1 To m
......@@ -418,8 +418,8 @@ Function ExtCell( _
Else
rv = CLng(rng.Font.Bold)
End If
Case "bottomborder" /* from later 123 versions - USEFUL! */
/* Note: many possible return values! wrap inside SIGN to test T/F */
If rar Then
......@@ -433,7 +433,7 @@ Function ExtCell( _
Else
rv = rng.Borders(xlEdgeBottom).LineStyle - xlLineStyleNone
End If
Case "bottombordercolor" /* from later 123 versions - USEFUL! */
If rar Then
For i = 1 To m
......@@ -1016,7 +1016,7 @@ Function ExtCell( _
Case "usedrange" /* NOTE: returns Range addresses! */
t = ws.UsedRange.Address /* invariant */
If rar Then
For i = 1 To m
For j = 1 To n
......@@ -1128,7 +1128,7 @@ Function ExtCell( _
Case Else /* invalid property/characteristic */
t = CVErr(xlErrValue) /* invariant */
If rar Then
For i = 1 To m
For j = 1 To n
......@@ -1366,8 +1366,7 @@ static const char *help_isna = {
static Value *
gnumeric_isna (FunctionEvalInfo *ei, Value **argv)
{
return value_new_bool (argv[0]->type == VALUE_ERROR &&
!strcmp (gnumeric_err_NA, argv[0]->v_err.mesg->str));
return value_new_bool (value_error_classify (argv[0]) == GNM_ERROR_NA);
}
/***************************************************************************/
......@@ -1390,7 +1389,7 @@ static Value *
gnumeric_iserr (FunctionEvalInfo *ei, Value **argv)
{
return value_new_bool (argv[0]->type == VALUE_ERROR &&
strcmp (gnumeric_err_NA, argv[0]->v_err.mesg->str));
value_error_classify (argv[0]) != GNM_ERROR_NA);
}
/***************************************************************************/
......@@ -1419,30 +1418,17 @@ static const char *help_error_type = {
static Value *
gnumeric_error_type (FunctionEvalInfo *ei, Value **argv)
{
int retval = -1;
char const * mesg;
if (argv[0]->type != VALUE_ERROR)
return value_new_error_NA (ei->pos);
mesg = argv[0]->v_err.mesg->str;
if (!strcmp (gnumeric_err_NULL, mesg))
retval = 1;
else if (!strcmp (gnumeric_err_DIV0, mesg))
retval = 2;
else if (!strcmp (gnumeric_err_VALUE, mesg))
retval = 3;
else if (!strcmp (gnumeric_err_REF, mesg))
retval = 4;
else if (!strcmp (gnumeric_err_NAME, mesg))
retval = 5;
else if (!strcmp (gnumeric_err_NUM, mesg))
retval = 6;
else if (!strcmp (gnumeric_err_NA, mesg))
retval = 7;
else
switch (value_error_classify (argv[0])) {
case GNM_ERROR_NULL: return value_new_int (1);
case GNM_ERROR_DIV0: return value_new_int (2);
case GNM_ERROR_VALUE: return value_new_int (3);
case GNM_ERROR_REF: return value_new_int (4);
case GNM_ERROR_NAME: return value_new_int (5);
case GNM_ERROR_NUM: return value_new_int (6);
case GNM_ERROR_NA: return value_new_int (7);
default:
return value_new_error_NA (ei->pos);
return value_new_int (retval);
}
}
/***************************************************************************/
......
2002-12-16 Morten Welinder <terra@diku.dk>
* functions.c (validate_range_numeric_matrix): Return errors as
GnmStdError. All callers changed.
2002-11-15 Jody Goldberg <jody@gnome.org>
* Release 1.1.12
......
......@@ -182,7 +182,7 @@ gnumeric_gcd (FunctionEvalInfo *ei, GnmExprList *nodes)
COLLECT_IGNORE_STRINGS |
COLLECT_IGNORE_BOOLS |
COLLECT_IGNORE_BLANKS,
gnumeric_err_NUM);
GNM_ERROR_NUM);
}
/***************************************************************************/
......@@ -238,7 +238,7 @@ gnumeric_lcm (FunctionEvalInfo *ei, GnmExprList *nodes)
COLLECT_IGNORE_STRINGS |
COLLECT_IGNORE_BOOLS |
COLLECT_IGNORE_BLANKS,
gnumeric_err_NUM);
GNM_ERROR_NUM);
}
......@@ -1385,7 +1385,7 @@ gnumeric_suma (FunctionEvalInfo *ei, GnmExprList *nodes)
COLLECT_ZERO_STRINGS |
COLLECT_ZEROONE_BOOLS |
COLLECT_IGNORE_BLANKS,
gnumeric_err_VALUE);
GNM_ERROR_VALUE);
}
/***************************************************************************/
......@@ -1416,7 +1416,7 @@ gnumeric_sumsq (FunctionEvalInfo *ei, GnmExprList *nodes)
COLLECT_IGNORE_STRINGS |
COLLECT_IGNORE_BOOLS |
COLLECT_IGNORE_BLANKS,
gnumeric_err_VALUE);
GNM_ERROR_VALUE);
}
/***************************************************************************/
......@@ -1445,7 +1445,7 @@ gnumeric_multinomial (FunctionEvalInfo *ei, GnmExprList *nodes)
COLLECT_IGNORE_STRINGS |
COLLECT_IGNORE_BOOLS |
COLLECT_IGNORE_BLANKS,
gnumeric_err_NUM);
GNM_ERROR_NUM);
}
/***************************************************************************/
......@@ -1473,7 +1473,7 @@ gnumeric_g_product (FunctionEvalInfo *ei, GnmExprList *nodes)
COLLECT_IGNORE_STRINGS |
COLLECT_IGNORE_BOOLS |
COLLECT_IGNORE_BLANKS,
gnumeric_err_VALUE);
GNM_ERROR_VALUE);
}
/***************************************************************************/
......@@ -2681,7 +2681,7 @@ gnumeric_seriessum (FunctionEvalInfo *ei, GnmExprList *nodes)
COLLECT_IGNORE_STRINGS |
COLLECT_IGNORE_BOOLS |
COLLECT_IGNORE_BLANKS,
gnumeric_err_NUM);
GNM_ERROR_NUM);
}
/***************************************************************************/
......@@ -2722,7 +2722,7 @@ callback_function_mmult_validate (Sheet *sheet, int col, int row,
static int
validate_range_numeric_matrix (const EvalPos *ep, Value * matrix,
int *rows, int *cols,
char const **error_string)
GnmStdError *err)
{
Value *res;
int cell_count = 0;
......@@ -2736,7 +2736,7 @@ validate_range_numeric_matrix (const EvalPos *ep, Value * matrix,
if (matrix->v_range.cell.a.sheet !=
matrix->v_range.cell.b.sheet) {
*error_string = _("#3D MULT?");
*err = GNM_ERROR_UNKNOWN; /*XXXX_("#3D MULT?"); */
return TRUE;
}
......@@ -2752,7 +2752,7 @@ validate_range_numeric_matrix (const EvalPos *ep, Value * matrix,
if (res != NULL || cell_count != (*rows * *cols)) {
/* As specified in the Excel Docs */
*error_string = gnumeric_err_VALUE;
*err = GNM_ERROR_VALUE;
return TRUE;
}
......@@ -2769,12 +2769,10 @@ gnumeric_minverse (FunctionEvalInfo *ei, Value **argv)
Value *res;
Value *values = argv[0];
gnm_float *matrix, *inverse;
GnmStdError err;
char const *error_string = NULL;
if (validate_range_numeric_matrix (ep, values, &rows, &cols,
&error_string)) {
return value_new_error (ei->pos, error_string);
if (validate_range_numeric_matrix (ep, values, &rows, &cols, &err)) {
return value_new_error_std (ei->pos, err);
}
/* Guarantee shape and non-zero size */
......@@ -2841,13 +2839,13 @@ gnumeric_mmult (FunctionEvalInfo *ei, Value **argv)
Value *values_a = argv[0];
Value *values_b = argv[1];
gnm_float *A, *B, *product;
char const *error_string = NULL;
GnmStdError err;
if (validate_range_numeric_matrix (ep, values_a, &rows_a, &cols_a,
&error_string) ||
&err) ||
validate_range_numeric_matrix (ep, values_b, &rows_b, &cols_b,
&error_string)) {
return value_new_error (ei->pos, error_string);
&err)) {
return value_new_error_std (ei->pos, err);
}
/* Guarantee shape and non-zero size */
......@@ -2921,12 +2919,11 @@ gnumeric_mdeterm (FunctionEvalInfo *ei, Value **argv)
gnm_float res;
Value *values = argv[0];
gnm_float *matrix;
char const *error_string = NULL;
GnmStdError err;
if (validate_range_numeric_matrix (ep, values, &rows, &cols,
&error_string)) {
return value_new_error (ei->pos, error_string);
&err)) {
return value_new_error_std (ei->pos, err);
}
/* Guarantee shape and non-zero size */
......
......@@ -212,7 +212,7 @@ gnumeric_varp (FunctionEvalInfo *ei, GnmExprList *expr_node_list)
COLLECT_IGNORE_STRINGS |
COLLECT_IGNORE_BOOLS |
COLLECT_IGNORE_BLANKS,
gnumeric_err_DIV0);
GNM_ERROR_DIV0);
}
/***************************************************************************/
......@@ -246,7 +246,7 @@ gnumeric_var (FunctionEvalInfo *ei, GnmExprList *expr_node_list)
COLLECT_IGNORE_STRINGS |
COLLECT_IGNORE_BOOLS |
COLLECT_IGNORE_BLANKS,
gnumeric_err_DIV0);
GNM_ERROR_DIV0);
}
/***************************************************************************/
......@@ -276,7 +276,7 @@ gnumeric_stdev (FunctionEvalInfo *ei, GnmExprList *expr_node_list)
COLLECT_IGNORE_STRINGS |
COLLECT_IGNORE_BOOLS |
COLLECT_IGNORE_BLANKS,
gnumeric_err_DIV0);
GNM_ERROR_DIV0);
}
/***************************************************************************/
......@@ -306,7 +306,7 @@ gnumeric_stdevp (FunctionEvalInfo *ei, GnmExprList *expr_node_list)
COLLECT_IGNORE_STRINGS |
COLLECT_IGNORE_BOOLS |
COLLECT_IGNORE_BLANKS,
gnumeric_err_DIV0);
GNM_ERROR_DIV0);
}
/***************************************************************************/
......@@ -460,7 +460,7 @@ gnumeric_trimmean (FunctionEvalInfo *ei, GnmExprList *expr_node_list)
COLLECT_IGNORE_STRINGS |
COLLECT_IGNORE_BOOLS |
COLLECT_IGNORE_BLANKS,
gnumeric_err_VALUE);
GNM_ERROR_VALUE);
}
/***************************************************************************/
......@@ -492,7 +492,7 @@ gnumeric_covar (FunctionEvalInfo *ei, Value **argv)
range_covar,
COLLECT_IGNORE_STRINGS |
COLLECT_IGNORE_BOOLS,
gnumeric_err_VALUE);
GNM_ERROR_VALUE);
}
/***************************************************************************/
......@@ -524,7 +524,7 @@ gnumeric_correl (FunctionEvalInfo *ei, Value **argv)
range_correl_pop,
COLLECT_IGNORE_STRINGS |
COLLECT_IGNORE_BOOLS,
gnumeric_err_VALUE);
GNM_ERROR_VALUE);
}
/***************************************************************************/
......@@ -763,7 +763,7 @@ gnumeric_mode (FunctionEvalInfo *ei, GnmExprList *expr_node_list)
COLLECT_IGNORE_STRINGS |
COLLECT_IGNORE_BOOLS |
COLLECT_IGNORE_BLANKS,
gnumeric_err_NA);
GNM_ERROR_NA);
}
/***************************************************************************/
......@@ -795,7 +795,7 @@ gnumeric_harmean (FunctionEvalInfo *ei, GnmExprList *expr_node_list)
COLLECT_IGNORE_STRINGS |
COLLECT_IGNORE_BOOLS |
COLLECT_IGNORE_BLANKS,
gnumeric_err_VALUE);
GNM_ERROR_VALUE);
}
/***************************************************************************/
......@@ -826,7 +826,7 @@ gnumeric_geomean (FunctionEvalInfo *ei, GnmExprList *expr_node_list)
COLLECT_IGNORE_STRINGS |
COLLECT_IGNORE_BOOLS |
COLLECT_IGNORE_BLANKS,
gnumeric_err_VALUE);
GNM_ERROR_VALUE);
}
/***************************************************************************/
......@@ -943,7 +943,7 @@ gnumeric_average (FunctionEvalInfo *ei, GnmExprList *expr_node_list)
COLLECT_IGNORE_STRINGS |
COLLECT_IGNORE_BOOLS |
COLLECT_IGNORE_BLANKS,
gnumeric_err_DIV0);
GNM_ERROR_DIV0);
}
/***************************************************************************/
......@@ -985,7 +985,7 @@ gnumeric_min (FunctionEvalInfo *ei, GnmExprList *expr_node_list)
COLLECT_IGNORE_STRINGS |
COLLECT_IGNORE_BOOLS |
COLLECT_IGNORE_BLANKS,
gnumeric_err_VALUE);
GNM_ERROR_VALUE);
}
/***************************************************************************/
......@@ -1027,7 +1027,7 @@ gnumeric_max (FunctionEvalInfo *ei, GnmExprList *expr_node_list)
COLLECT_IGNORE_STRINGS |
COLLECT_IGNORE_BOOLS |
COLLECT_IGNORE_BLANKS,
gnumeric_err_VALUE);
GNM_ERROR_VALUE);
}
/***************************************************************************/
......@@ -1065,7 +1065,7 @@ gnumeric_skew (FunctionEvalInfo *ei, GnmExprList *expr_node_list)
COLLECT_IGNORE_STRINGS |
COLLECT_IGNORE_BOOLS |
COLLECT_IGNORE_BLANKS,
gnumeric_err_DIV0);
GNM_ERROR_DIV0);
}
/***************************************************************************/
......@@ -1098,7 +1098,7 @@ gnumeric_skewp (FunctionEvalInfo *ei, GnmExprList *expr_node_list)
COLLECT_IGNORE_STRINGS |
COLLECT_IGNORE_BOOLS |
COLLECT_IGNORE_BLANKS,
gnumeric_err_DIV0);
GNM_ERROR_DIV0);
}
/***************************************************************************/
......@@ -2319,7 +2319,7 @@ gnumeric_kurt (FunctionEvalInfo *ei, GnmExprList *expr_node_list)
COLLECT_IGNORE_STRINGS |
COLLECT_IGNORE_BOOLS |
COLLECT_IGNORE_BLANKS,
gnumeric_err_DIV0);
GNM_ERROR_DIV0);
}
/***************************************************************************/
......@@ -2352,7 +2352,7 @@ gnumeric_kurtp (FunctionEvalInfo *ei, GnmExprList *expr_node_list)
COLLECT_IGNORE_STRINGS |
COLLECT_IGNORE_BOOLS |
COLLECT_IGNORE_BLANKS,
gnumeric_err_DIV0);
GNM_ERROR_DIV0);
}
/***************************************************************************/
......@@ -2383,7 +2383,7 @@ gnumeric_avedev (FunctionEvalInfo *ei, GnmExprList *expr_node_list)
COLLECT_IGNORE_STRINGS |
COLLECT_IGNORE_BOOLS |
COLLECT_IGNORE_BLANKS,
gnumeric_err_NUM);
GNM_ERROR_NUM);
}
/***************************************************************************/
......@@ -2416,7 +2416,7 @@ gnumeric_devsq (FunctionEvalInfo *ei, GnmExprList *expr_node_list)
COLLECT_IGNORE_STRINGS |
COLLECT_IGNORE_BOOLS |
COLLECT_IGNORE_BLANKS,
gnumeric_err_VALUE);
GNM_ERROR_VALUE);
}
/***************************************************************************/
......@@ -2549,7 +2549,7 @@ gnumeric_rsq (FunctionEvalInfo *ei, Value **argv)
range_rsq_pop,
COLLECT_IGNORE_STRINGS |
COLLECT_IGNORE_BOOLS,
gnumeric_err_VALUE);
GNM_ERROR_VALUE);
}
/***************************************************************************/
......@@ -2583,7 +2583,7 @@ gnumeric_median (FunctionEvalInfo *ei, GnmExprList *expr_node_list)
COLLECT_IGNORE_STRINGS |
COLLECT_IGNORE_BOOLS |
COLLECT_IGNORE_BLANKS,
gnumeric_err_NUM);
GNM_ERROR_NUM);
}
/***************************************************************************/
......@@ -2630,7 +2630,7 @@ gnumeric_large (FunctionEvalInfo *ei, GnmExprList *expr_node_list)
COLLECT_IGNORE_STRINGS |
COLLECT_IGNORE_BOOLS |
COLLECT_IGNORE_BLANKS,
gnumeric_err_NUM);
GNM_ERROR_NUM);
}
/***************************************************************************/
......@@ -2677,7 +2677,7 @@ gnumeric_small (FunctionEvalInfo *ei, GnmExprList *expr_node_list)
COLLECT_IGNORE_STRINGS |
COLLECT_IGNORE_BOOLS |
COLLECT_IGNORE_BLANKS,
gnumeric_err_NUM);
GNM_ERROR_NUM);
}
typedef struct {
......@@ -3065,7 +3065,7 @@ gnumeric_averagea (FunctionEvalInfo *ei, GnmExprList *expr_node_list)
COLLECT_ZERO_STRINGS |
COLLECT_ZEROONE_BOOLS |
COLLECT_IGNORE_BLANKS,
gnumeric_err_DIV0);
GNM_ERROR_DIV0);
}
/***************************************************************************/
......@@ -3101,7 +3101,7 @@ gnumeric_maxa (FunctionEvalInfo *ei, GnmExprList *expr_node_list)
COLLECT_ZERO_STRINGS |
COLLECT_ZEROONE_BOOLS |
COLLECT_IGNORE_BLANKS,
gnumeric_err_VALUE);
GNM_ERROR_VALUE);
}
/***************************************************************************/
......@@ -3137,7 +3137,7 @@ gnumeric_mina (FunctionEvalInfo *ei, GnmExprList *expr_node_list)
COLLECT_ZERO_STRINGS |
COLLECT_ZEROONE_BOOLS |
COLLECT_IGNORE_BLANKS,
gnumeric_err_VALUE);
GNM_ERROR_VALUE);
}
/***************************************************************************/
......@@ -3173,7 +3173,7 @@ gnumeric_vara (FunctionEvalInfo *ei, GnmExprList *expr_node_list)
COLLECT_ZERO_STRINGS |
COLLECT_ZEROONE_BOOLS |
COLLECT_IGNORE_BLANKS,
gnumeric_err_VALUE);
GNM_ERROR_VALUE);
}
/***************************************************************************/
......@@ -3209,7 +3209,7 @@ gnumeric_varpa (FunctionEvalInfo *ei, GnmExprList *expr_node_list)
COLLECT_ZERO_STRINGS |
COLLECT_ZEROONE_BOOLS |
COLLECT_IGNORE_BLANKS,
gnumeric_err_VALUE);
GNM_ERROR_VALUE);
}
/***************************************************************************/
......@@ -3245,7 +3245,7 @@ gnumeric_stdeva (FunctionEvalInfo *ei, GnmExprList *expr_node_list)
COLLECT_ZERO_STRINGS |
COLLECT_ZEROONE_BOOLS |
COLLECT_IGNORE_BLANKS,
gnumeric_err_VALUE);
GNM_ERROR_VALUE);
}
/***************************************************************************/
......@@ -3281,7 +3281,7 @@ gnumeric_stdevpa (FunctionEvalInfo *ei, GnmExprList *expr_node_list)
COLLECT_ZERO_STRINGS |
COLLECT_ZEROONE_BOOLS |
COLLECT_IGNORE_BLANKS,
gnumeric_err_VALUE);
GNM_ERROR_VALUE);
}
/***************************************************************************/
......@@ -5034,7 +5034,7 @@ gnumeric_intercept (FunctionEvalInfo *ei, Value **argv)
range_intercept,
COLLECT_IGNORE_STRINGS |
COLLECT_IGNORE_BOOLS,
gnumeric_err_VALUE);
GNM_ERROR_VALUE);
}
/***************************************************************************/
......@@ -5078,7 +5078,7 @@ gnumeric_slope (FunctionEvalInfo *ei, Value **argv)
range_slope,
COLLECT_IGNORE_STRINGS |
COLLECT_IGNORE_BOOLS,
gnumeric_err_VALUE);
GNM_ERROR_VALUE);
}
/***************************************************************************/
......@@ -5124,7 +5124,7 @@ gnumeric_subtotal (FunctionEvalInfo *ei, GnmExprList *expr_node_list)
Value *val;
int fun_nbr;
float_range_function_t func;
char const *err = gnumeric_err_DIV0;
GnmStdError err = GNM_ERROR_DIV0;
if (expr_node_list == NULL)
return value_new_error_NUM (ei->pos);
......@@ -5158,15 +5158,15 @@ gnumeric_subtotal (FunctionEvalInfo *ei, GnmExprList *expr_node_list)
return val;
case 1: func = range_average; break;
case 4: err = gnumeric_err_VALUE;
case 4: err = GNM_ERROR_VALUE;
func = range_max0; break;
case 5: err = gnumeric_err_VALUE;
case 5: err = GNM_ERROR_VALUE;
func = range_min0; break;
case 6: err = gnumeric_err_VALUE;
case 6: err = GNM_ERROR_VALUE;
func = range_product; break;
case 7: func = range_stddev_est; break;
case 8: func = range_stddev_pop; break;
case 9: err = gnumeric_err_VALUE;
case 9: err = GNM_ERROR_VALUE;
func = range_sum; break;
case 10: func = range_var_est; break;
case 11: func = range_var_pop; break;
......@@ -5261,7 +5261,7 @@ gnumeric_cronbach (FunctionEvalInfo *ei, GnmExprList *expr_node_list)
short_list = gnm_expr_list_prepend (NULL, list->data);
fl_val = float_range_function (short_list, ei,
range_var_pop, 0,
gnumeric_err_VALUE);
GNM_ERROR_VALUE);
gnm_expr_list_free (short_list);
if (!VALUE_IS_NUMBER (fl_val))
return fl_val;
......@@ -5295,7 +5295,7 @@ gnumeric_cronbach (FunctionEvalInfo *ei, GnmExprList *expr_node_list)
fl_val = float_range_function2 (values[i], values[j],
ei,
range_covar, 0,
gnumeric_err_VALUE);
GNM_ERROR_VALUE);
if (!VALUE_IS_NUMBER (fl_val)) {
free_values (values, k);
return fl_val;
......
......@@ -379,7 +379,7 @@ gnumeric_concatenate (FunctionEvalInfo *ei, GnmExprList *nodes)
return string_range_function (nodes, ei,
range_concatenate,
COLLECT_IGNORE_BLANKS,
gnumeric_err_VALUE);
GNM_ERROR_VALUE);
}
/***************************************************************************/
......
......@@ -2022,6 +2022,18 @@ static PyMethodDef GnumericMethods[] = {
{ NULL, NULL },
};
static void
init_err (PyObject *module_dict, const char *name, GnmStdError e)
{
Value *v = value_new_error_std (NULL, e);
PyDict_SetItemString
(module_dict, (char *)name,
PyString_FromString (v->v_err.mesg->str));
value_release (v);
}
void
py_initgnumeric (GnmPyInterpreter *interpreter)
......@@ -2041,30 +2053,15 @@ py_initgnumeric (GnmPyInterpreter *interpreter)
(module_dict, (char *) "GnumericError",
PyErr_NewException ((char *) "Gnumeric.GnumericError",
NULL, NULL));
(void) PyDict_SetItemString
(module_dict, (char *) "GnumericErrorNULL",
PyString_FromString (gnumeric_err_NULL));
(void) PyDict_SetItemString
(module_dict, (char *) "GnumericErrorDIV0",
PyString_FromString (gnumeric_err_DIV0));
(void) PyDict_SetItemString (module_dict,
(char *) "GnumericErrorVALUE",
PyString_FromString (gnumeric_err_VALUE));
(void) PyDict_SetItemString
(module_dict, (char *) "GnumericErrorREF",
PyString_FromString (gnumeric_err_REF));
(void) PyDict_SetItemString
(module_dict, (char *) "GnumericErrorNAME",
PyString_FromString (gnumeric_err_NAME));
(void) PyDict_SetItemString
(module_dict, (char *) "GnumericErrorNUM",
PyString_FromString (gnumeric_err_NUM));
(void) PyDict_SetItemString
(module_dict, (char *) "GnumericErrorNA",
PyString_FromString (gnumeric_err_NA));
(void) PyDict_SetItemString
(module_dict, (char *) "GnumericErrorRECALC",
PyString_FromString (gnumeric_err_RECALC));
init_err (module_dict, "GnumericErrorNULL", GNM_ERROR_NULL);
init_err (module_dict, "GnumericErrorDIV0", GNM_ERROR_DIV0);
init_err (module_dict, "GnumericErrorVALUEL", GNM_ERROR_VALUE);
init_err (module_dict, "GnumericErrorREF", GNM_ERROR_REF);
init_err (module_dict, "GnumericErrorNAME", GNM_ERROR_NAME);
init_err (module_dict, "GnumericErrorNUM", GNM_ERROR_NUM);
init_err (module_dict, "GnumericErrorNA", GNM_ERROR_NA);
init_err (module_dict, "GnumericErrorRECALC", GNM_ERROR_RECALC);
(void) PyDict_SetItemString
(module_dict, (char *) "functions",
......
......@@ -227,7 +227,7 @@ Value *
float_range_function (GnmExprList *exprlist, FunctionEvalInfo *ei,
float_range_function_t func,
CollectFlags flags,
char const *func_error)
GnmStdError func_error)
{
Value *error = NULL;
gnm_float *vals, res;
......@@ -241,7 +241,7 @@ float_range_function (GnmExprList *exprlist, FunctionEvalInfo *ei,
g_free (vals);
if (err)
return value_new_error (ei->pos, func_error);
return value_new_error_std (ei->pos, func_error);
else
return value_new_float (res);
}
......@@ -352,7 +352,7 @@ Value *
float_range_function2 (Value *val0, Value *val1, FunctionEvalInfo *ei,
float_range_function2_t func,
CollectFlags flags,
char const *func_error)
GnmStdError func_error)
{
gnm_float *vals0, *vals1;
int n0, n1;
......@@ -378,7 +378,7 @@ float_range_function2 (Value *val0, Value *val1, FunctionEvalInfo *ei,
}
if (n0 != n1 || n0 == 0)
res = value_new_error (ei->pos, func_error);
res = value_new_error_std (ei->pos, func_error);
else {
gnm_float fres;
......@@ -407,7 +407,7 @@ float_range_function2 (Value *val0, Value *val1, FunctionEvalInfo *ei,
if (func (vals0, vals1, n0, &fres))
res = value_new_error (ei->pos, func_error);
res = value_new_error_std (ei->pos, func_error);
else
res = value_new_float (fres);
}
......@@ -509,7 +509,7 @@ Value *
string_range_function (GnmExprList *exprlist, FunctionEvalInfo *ei,
string_range_function_t func,
CollectFlags flags,
char const *func_error)
GnmStdError func_error)
{
Value *error = NULL;
GSList *vals;
......@@ -527,7 +527,7 @@ string_range_function (GnmExprList *exprlist, FunctionEvalInfo *ei,
if (err) {
if (res)
g_free (res);
return value_new_error (ei->pos, func_error);
return value_new_error_std (ei->pos, func_error);
} else {
return value_new_string_nocopy (res);
}
......
......@@ -34,15 +34,15 @@ gnm_float *collect_floats_value (const Value *val, const EvalPos *ep,
Value *float_range_function (GnmExprList *exprlist, FunctionEvalInfo *ei,
float_range_function_t func,
CollectFlags flags,
char const *func_error);
GnmStdError func_error);
Value *float_range_function2 (Value *val0, Value *val1, FunctionEvalInfo *ei,
float_range_function2_t func,
CollectFlags flags,
char const *func_error);
GnmStdError func_error);