Commit 79c92bf5 authored by Morten Welinder's avatar Morten Welinder Committed by Morten Welinder

Fix error handling, I hope.

2002-04-15  Morten Welinder  <terra@diku.dk>

	* fn-math.c (gnumeric_subtotal): Fix error handling, I hope.

2002-04-15  Morten Welinder  <terra@diku.dk>

	* *.c: Include <gnumeric-config.h> as needed.

2002-04-15  Morten Welinder  <terra@diku.dk>

	* *.c: Include <gnumeric-config.h> as needed.
parent a9880973
......@@ -2818,28 +2818,22 @@ static const char *help_subtotal = {
static Value *
gnumeric_subtotal (FunctionEvalInfo *ei, GnmExprList *expr_node_list)
{
GnmExpr *tree;
Value *val;
int fun_nbr;
const GnmExpr *tree;
Value *val;
int fun_nbr;
if (expr_node_list == NULL)
return value_new_error (ei->pos, gnumeric_err_NUM);
tree = (GnmExpr *) expr_node_list->data;
tree = expr_node_list->data;
if (tree == NULL)
return value_new_error (ei->pos, gnumeric_err_NUM);
val = gnm_expr_eval (tree, ei->pos, GNM_EXPR_EVAL_STRICT);
if (!val) return NULL;
if (!VALUE_IS_NUMBER (val)) {
value_release (val);
return value_new_error (ei->pos, gnumeric_err_VALUE);
}
if (val->type == VALUE_ERROR)
return val;
fun_nbr = value_get_as_int (val);
value_release (val);
if (fun_nbr < 1 || fun_nbr > 11)
return value_new_error (ei->pos, gnumeric_err_NUM);
/* Skip the first node */
expr_node_list = expr_node_list->next;
......@@ -2856,9 +2850,8 @@ gnumeric_subtotal (FunctionEvalInfo *ei, GnmExprList *expr_node_list)
case 9: return gnumeric_sum (ei, expr_node_list);
case 10: return gnumeric_var (ei, expr_node_list);
case 11: return gnumeric_varp (ei, expr_node_list);
default: return value_new_error (ei->pos, gnumeric_err_NUM);
}
return NULL;
}
/***************************************************************************/
......
2002-04-15 Morten Welinder <terra@diku.dk>
* fn-math.c (gnumeric_subtotal): Fix error handling, I hope.
2002-04-04 Jody Goldberg <jody@gnome.org>
* fn-date.c (gnumeric_date2unix) : unix serials are integers.
......
......@@ -2818,28 +2818,22 @@ static const char *help_subtotal = {
static Value *
gnumeric_subtotal (FunctionEvalInfo *ei, GnmExprList *expr_node_list)
{
GnmExpr *tree;
Value *val;
int fun_nbr;
const GnmExpr *tree;
Value *val;
int fun_nbr;
if (expr_node_list == NULL)
return value_new_error (ei->pos, gnumeric_err_NUM);
tree = (GnmExpr *) expr_node_list->data;
tree = expr_node_list->data;
if (tree == NULL)
return value_new_error (ei->pos, gnumeric_err_NUM);
val = gnm_expr_eval (tree, ei->pos, GNM_EXPR_EVAL_STRICT);
if (!val) return NULL;
if (!VALUE_IS_NUMBER (val)) {
value_release (val);
return value_new_error (ei->pos, gnumeric_err_VALUE);
}
if (val->type == VALUE_ERROR)
return val;
fun_nbr = value_get_as_int (val);
value_release (val);
if (fun_nbr < 1 || fun_nbr > 11)
return value_new_error (ei->pos, gnumeric_err_NUM);
/* Skip the first node */
expr_node_list = expr_node_list->next;
......@@ -2856,9 +2850,8 @@ gnumeric_subtotal (FunctionEvalInfo *ei, GnmExprList *expr_node_list)
case 9: return gnumeric_sum (ei, expr_node_list);
case 10: return gnumeric_var (ei, expr_node_list);
case 11: return gnumeric_varp (ei, expr_node_list);
default: return value_new_error (ei->pos, gnumeric_err_NUM);
}
return NULL;
}
/***************************************************************************/
......
2002-04-15 Morten Welinder <terra@diku.dk>
* *.c: Include <gnumeric-config.h> as needed.
2002-03-29 Jukka-Pekka Iivonen <jiivonen@hutcs.cs.hut.fi>
* lpkit.h: Added #ifndef.
......
#include <gnumeric-config.h>
#include "lpkit.h"
#include "lpglob.h"
#include <stdarg.h>
......
......@@ -21,6 +21,7 @@
* 02111-1307, USA.
*/
#include <gnumeric-config.h>
#include <glib.h>
#include "lpkit.h"
#include "lpglob.h"
......
......@@ -20,6 +20,7 @@
* 02111-1307, USA.
*/
#include <gnumeric-config.h>
#include <glib.h>
#include <string.h>
#include "lpkit.h"
......
2002-04-15 Morten Welinder <terra@diku.dk>
* *.c: Include <gnumeric-config.h> as needed.
2002-04-12 Morten Welinder <terra@diku.dk>
* gnumeric-cell-renderer-text.c
......
......@@ -16,6 +16,7 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <gnumeric-config.h>
#include <gtk/gtk.h>
#include <gdk/gdkx.h>
#include "gnumeric-cell-renderer-expr-entry.h"
......
......@@ -16,6 +16,7 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <gnumeric-config.h>
#include <gtk/gtk.h>
#include <gdk/gdkx.h>
#include "gnumeric-cell-renderer-text.h"
......
......@@ -20,6 +20,7 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <gnumeric-config.h>
#include <gtk/gtk.h>
#include <gdk/gdkx.h>
#include "gnumeric-cell-renderer-toggle.h"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment