Commit 6fe6f599 authored by Jody Goldberg's avatar Jody Goldberg

some gcc-3.1 cleanup

parent 8605cc63
......@@ -550,6 +550,7 @@ html_file_save (GnumFileSaver const *fs, IOContext *io_context,
"</HEAD>\n<BODY>\n", fp);
break;
default:
break;
}
sheets = workbook_sheets (wb);
......
......@@ -34,6 +34,7 @@
#include <libgnome/gnome-i18n.h>
#include <errno.h>
#include <string.h>
/*
* escape special characters .. needs work
......
......@@ -21,6 +21,7 @@
#include <gdk/gdk.h>
#include <ctype.h>
#include <string.h>
static inline void
draw_text (GdkDrawable *drawable, GdkFont *font, GdkGC *gc,
......
......@@ -35,6 +35,8 @@
#include "ranges.h"
#include "gutils.h"
#include <string.h>
#define BUCKET_SIZE 128
static GPtrArray *dep_classes = NULL;
......
......@@ -674,7 +674,7 @@ static void
solver_reporting (SolverState *state, SolverResults *res, gchar *errmsg)
{
SolverOptions *opt = &res->param->options;
gchar *err;
gchar *err = NULL;
switch (res->status) {
case SolverOptimal :
......
......@@ -28,6 +28,7 @@
#include <math.h>
#include <string.h>
#include <stdlib.h>
#include <libgnome/gnome-i18n.h>
/*
......
......@@ -20,6 +20,7 @@
#ifdef WITH_BONOBO
#include <bonobo.h>
#endif
#include <string.h>
/* Command callback called on activation of a file history menu item. */
#ifndef WITH_BONOBO
......
......@@ -39,6 +39,7 @@
#include <stdio.h>
#include <ctype.h>
#include <glib.h>
#include <string.h>
/* Can remove sheet since local references have NULL sheet */
char *
......
......@@ -45,12 +45,14 @@ typedef enum {
PERR_MISSING_CLOSING_QUOTE,
PERR_INVALID_EXPRESSION,
PERR_INVALID_ARRAY_SEPARATOR,
PERR_UNKNOWN_WORKBOOK,
PERR_UNKNOWN_SHEET,
PERR_UNKNOWN_EXPRESSION,
PERR_UNKNOWN_NAME,
PERR_UNEXPECTED_TOKEN,
PERR_OUT_OF_RANGE,
PERR_SHEET_IS_REQUIRED,
PERR_SINGLE_RANGE,
PERR_3D_NAME,
PERR_MULTIPLE_EXPRESSIONS
} ParseErrorID;
......
......@@ -414,7 +414,10 @@ int yyparse (void);
Value *value;
CellRef *cell;
GnmExprList *list;
Sheet *sheet;
struct {
Sheet *first;
Sheet *last;
} sheet;
}
%type <list> opt_exp arg_list array_row, array_cols
%type <expr> exp array_exp string_opt_quote cellref
......@@ -507,24 +510,33 @@ exp: CONSTANT { $$ = $1; }
}
}
| sheetref string_opt_quote {
GnmNamedExpr *expr_name;
char *name = $2->constant.value->v_str.val->str;
GnmNamedExpr *expr_name = NULL;
char const *name = $2->constant.value->v_str.val->str;
ParsePos pos = *state->pos;
pos.sheet = $1;
expr_name = expr_name_lookup (&pos, name);
if (expr_name == NULL) {
int retval = gnumeric_parse_error (
state, PERR_UNKNOWN_EXPRESSION,
g_strdup_printf (_("Name '%s' does not exist in sheet '%s'"),
name, $1->name_quoted),
pos.sheet = $1.first;
if ($1.last != NULL)
gnumeric_parse_error (
state, PERR_3D_NAME,
g_strdup_printf (_("What is a 3D name %s:%s!%s ?"),
$1.first->name_quoted,
$1.last->name_quoted,
name),
state->expr_text - state->expr_backup + 1, strlen (name));
else {
expr_name = expr_name_lookup (&pos, name);
if (expr_name == NULL)
gnumeric_parse_error (
state, PERR_UNKNOWN_NAME,
g_strdup_printf (_("Name '%s' does not exist in sheet '%s'"),
name, pos.sheet->name_quoted),
state->expr_text - state->expr_backup + 1, strlen (name));
}
unregister_allocation ($2); gnm_expr_unref ($2);
return retval;
} else
unregister_allocation ($2); gnm_expr_unref ($2);
$$ = register_expr_allocation (gnm_expr_new_name (expr_name, $1, NULL));
unregister_allocation ($2); gnm_expr_unref ($2);
if (expr_name == NULL)
return ERROR;
$$ = register_expr_allocation (gnm_expr_new_name (expr_name, $1.first, NULL));
}
| '[' string_opt_quote ']' string_opt_quote {
GnmNamedExpr *expr_name;
......@@ -537,7 +549,7 @@ exp: CONSTANT { $$ = $1; }
if (pos.wb == NULL) {
int retval = gnumeric_parse_error (
state, PERR_UNKNOWN_EXPRESSION,
state, PERR_UNKNOWN_WORKBOOK,
g_strdup_printf (_("Unknown workbook '%s'"), wb_name),
state->expr_text - state->expr_backup + 1, strlen (name));
......@@ -549,7 +561,7 @@ exp: CONSTANT { $$ = $1; }
expr_name = expr_name_lookup (&pos, name);
if (expr_name == NULL) {
int retval = gnumeric_parse_error (
state, PERR_UNKNOWN_EXPRESSION,
state, PERR_UNKNOWN_NAME,
g_strdup_printf (_("Name '%s' does not exist in workbook '%s'"),
name, wb_name),
state->expr_text - state->expr_backup + 1, strlen (name));
......@@ -574,7 +586,8 @@ sheetref: string_opt_quote SHEET_SEP {
unregister_allocation ($1); gnm_expr_unref ($1);
if (sheet == NULL)
return ERROR;
$$ = sheet;
$$.first = sheet;
$$.last = NULL;
}
| '[' string_opt_quote ']' string_opt_quote SHEET_SEP {
......@@ -587,12 +600,13 @@ sheetref: string_opt_quote SHEET_SEP {
if (sheet == NULL)
return ERROR;
$$ = sheet;
$$.first = sheet;
$$.last = NULL;
}
;
opt_sheetref: sheetref
| { $$ = NULL; }
| { $$.first = $$.last = NULL; }
;
cellref: CELLREF {
......@@ -606,8 +620,17 @@ cellref: CELLREF {
}
| sheetref CELLREF {
$2->cellref.ref.sheet = $1;
$$ = $2;
$2->cellref.ref.sheet = $1.first;
if (state->use_excel_reference_conventions && $1.last != NULL) {
CellRef tmp = $2->cellref.ref;
$$ = register_expr_allocation
(gnm_expr_new_constant
(value_new_cellrange (&($2->cellref.ref), &tmp,
state->pos->eval.col, state->pos->eval.row)));
unregister_allocation ($2);
gnm_expr_unref ($2);
} else
$$ = $2;
}
| CELLREF RANGE_SEP CELLREF {
......@@ -633,8 +656,12 @@ cellref: CELLREF {
| sheetref CELLREF RANGE_SEP opt_sheetref CELLREF {
unregister_allocation ($5);
unregister_allocation ($2);
$2->cellref.ref.sheet = $1;
$5->cellref.ref.sheet = $4 ? $4 : $1;
$2->cellref.ref.sheet = $1.first;
if (state->use_excel_reference_conventions) {
$5->cellref.ref.sheet = $1.last ? $1.last : $1.first;
} else {
$5->cellref.ref.sheet = $4.first ? $4.first : $1.first;
}
$$ = register_expr_allocation
(gnm_expr_new_constant
(value_new_cellrange (&($2->cellref.ref), &($5->cellref.ref),
......
......@@ -27,6 +27,7 @@
#include "str.h"
#include <ctype.h>
#include <string.h>
#include <locale.h>
/*
......
......@@ -19,6 +19,7 @@
#include <libgnomecanvas/gnome-canvas-rect-ellipse.h>
#include <math.h>
#include <string.h>
struct _SheetObjectImage {
SheetObject sheet_object;
......
......@@ -32,6 +32,8 @@
#include <gtk/gtkstock.h>
#include <gal/util/e-util.h>
#include <string.h>
/* Returns the class for a SheetObject */
#define SO_CLASS(so) SHEET_OBJECT_CLASS(G_OBJECT_GET_CLASS(so))
......
......@@ -580,7 +580,7 @@ solver_performance_report (WorkbookControl *wbc,
SolverResults *res)
{
data_analysis_output_t dao;
int mat_size, zeros, i;
int mat_size, i;
struct utsname unamedata;
Value *v;
gchar model_name [256], cpu_mhz [256];
......
......@@ -31,6 +31,8 @@
#include <gdk/gdkkeysyms.h>
#include <gal/util/e-util.h>
#include <string.h>
#define EDITABLE_LABEL_CLASS(k) (G_TYPE_CHECK_CLASS_CAST (k), EDITABLE_LABEL_TYPE)
struct _EditableLabel {
GtkEntry entry;
......
......@@ -50,6 +50,7 @@
#include <libgnome/gnome-util.h>
#include <gal/util/e-util.h>
#include <locale.h>
#include <string.h>
/* WorkbookView signals */
enum {
......
......@@ -39,14 +39,11 @@
#include <libgnome/gnome-util.h>
#include <gal/util/e-xml-utils.h>
#include <unistd.h>
#include <string.h>
#define CATEGORY_FILE_NAME ".category"
#define ERR_READ_FT_MEMBER "xml_read_format_template_member: : No %s section in template member!"
/**
* gnumeric_xml_read_format_template_category :
* Open an XML file and read a FormatTemplateCategory
......
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