Commit 2469741e authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg
Browse files

More warning suppression.

2001-05-07  Jody Goldberg <jgoldberg@home.com>

	* ms-escher.c (ms_escher_get_data) : suppress warnings.
	(ms_escher_read_ClientTextbox) : no side effects in precondition.

	* ms-excel-read.c (ms_excel_formula_shared) : ditto.

2001-05-07  Jody Goldberg <jgoldberg@home.com>

	* src/item-cursor.c (item_cursor_event) : ignore events while editing.

	* src/functions/fn-string.c (gnumeric_value) : s/free/g_free/
	* src/parse-util.c (parse_cell_name_list) : ditto.

	* src/parser.y (gnumeric_expr_parser) : reorganize slightly to improve
	  readability.

	* src/sheet.c (sheet_range_contains_region) : doh!.  forgot to invert
	  logic when I renamed the function.
parent 243e02d3
......@@ -8,32 +8,30 @@ release, and longer term bugs.
Release Critical
----------------
- Calls to free in parse_cell_name_list -- correct?
- Call to free in gnumeric_value.
- Why does ms-biff.c include <malloc.h>?
- Side effects in g_return.*_fail in ms_escher_read_ClientTextbox, line 1732.
There are several similar problems in the Excel plugin.
- defining file patterns in plugin spec overrides 'has_probe' flag silently.
- smarter support for unicode characters that do not convert to the
current encoding during XL import.
- outline mode
: finish implementing optionally putting markers above/left
: implement group/ungroup menu items (with undo)
: connect the hide/show menu items
Long term breakage
------------------
- Fix XL named expr import for sheet local names
- externsheet for biff7 type=3
- test for unicode
- outline mode
: finish implementing optionally putting markers above/left
: implement group/ungroup menu items (with undo)
: connect the hide/show menu items
- defining file patterns in plugin spec overrides 'has_probe' flag silently.
Names :
: Fix XL named expr import for sheet local names
* externsheet for biff7 type=3
* test for unicode
: Changing an expression name that is in use does not recalc, or regen
depends correctly.
: references in names do not get changed with cut/paste or ins/del row/col.
* range selection support for merged cells.
- When using the new range-selector for dialogs with only one range, it
should not be necessary to select the range field before selecting the
range. As long as the selector is in a modal dialog.
......@@ -81,11 +79,6 @@ Long term breakage
- hour month and year format strings need to be internationalized.
eg tt:ss instead of hh:ss for other locales.
- Changing an expression name that is in use does not recalc, or regen depends
correctly.
- references in names do not get changed with cut/paste or ins/del row/col.
- We do not format fractional seconds correctly.
- Auto resize needs to handle empty cells.
......
2001-05-07 Jody Goldberg <jgoldberg@home.com>
* src/item-cursor.c (item_cursor_event) : ignore events while editing.
* src/functions/fn-string.c (gnumeric_value) : s/free/g_free/
* src/parse-util.c (parse_cell_name_list) : ditto.
* src/parser.y (gnumeric_expr_parser) : reorganize slightly to improve
readability.
* src/sheet.c (sheet_range_contains_region) : doh!. forgot to invert
logic when I renamed the function.
2001-05-07 Jon K Hellan <hellan@acm.org>
* src/sheet-control-gui.c (scg_select_all): Handle select button
......
2001-05-07 Jody Goldberg <jgoldberg@home.com>
* src/item-cursor.c (item_cursor_event) : ignore events while editing.
* src/functions/fn-string.c (gnumeric_value) : s/free/g_free/
* src/parse-util.c (parse_cell_name_list) : ditto.
* src/parser.y (gnumeric_expr_parser) : reorganize slightly to improve
readability.
* src/sheet.c (sheet_range_contains_region) : doh!. forgot to invert
logic when I renamed the function.
2001-05-07 Jon K Hellan <hellan@acm.org>
* src/sheet-control-gui.c (scg_select_all): Handle select button
......
2001-05-07 Jody Goldberg <jgoldberg@home.com>
* src/item-cursor.c (item_cursor_event) : ignore events while editing.
* src/functions/fn-string.c (gnumeric_value) : s/free/g_free/
* src/parse-util.c (parse_cell_name_list) : ditto.
* src/parser.y (gnumeric_expr_parser) : reorganize slightly to improve
readability.
* src/sheet.c (sheet_range_contains_region) : doh!. forgot to invert
logic when I renamed the function.
2001-05-07 Jon K Hellan <hellan@acm.org>
* src/sheet-control-gui.c (scg_select_all): Handle select button
......
2001-05-07 Jody Goldberg <jgoldberg@home.com>
* src/item-cursor.c (item_cursor_event) : ignore events while editing.
* src/functions/fn-string.c (gnumeric_value) : s/free/g_free/
* src/parse-util.c (parse_cell_name_list) : ditto.
* src/parser.y (gnumeric_expr_parser) : reorganize slightly to improve
readability.
* src/sheet.c (sheet_range_contains_region) : doh!. forgot to invert
logic when I renamed the function.
2001-05-07 Jon K Hellan <hellan@acm.org>
* src/sheet-control-gui.c (scg_select_all): Handle select button
......
2001-05-07 Jody Goldberg <jgoldberg@home.com>
* src/item-cursor.c (item_cursor_event) : ignore events while editing.
* src/functions/fn-string.c (gnumeric_value) : s/free/g_free/
* src/parse-util.c (parse_cell_name_list) : ditto.
* src/parser.y (gnumeric_expr_parser) : reorganize slightly to improve
readability.
* src/sheet.c (sheet_range_contains_region) : doh!. forgot to invert
logic when I renamed the function.
2001-05-07 Jon K Hellan <hellan@acm.org>
* src/sheet-control-gui.c (scg_select_all): Handle select button
......
2001-05-07 Jody Goldberg <jgoldberg@home.com>
* ms-escher.c (ms_escher_get_data) : suppress warnings.
(ms_escher_read_ClientTextbox) : no side effects in precondition.
* ms-excel-read.c (ms_excel_formula_shared) : ditto.
2001-05-06 Jody Goldberg <jgoldberg@home.com>
* ms-excel-read.c (biff_boundsheet_data_new) : merge in the last of
......
......@@ -13,8 +13,6 @@
#include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>
#include <malloc.h>
#include <assert.h>
#include <ctype.h>
#include <config.h>
......
......@@ -1990,7 +1990,7 @@ BC(register_handlers)(void)
static void
BC(register_handler)(ExcelChartHandler const *const handle)
{
int const num_handler = sizeof(chart_biff_handler) /
unsigned const num_handler = sizeof(chart_biff_handler) /
sizeof(ExcelChartHandler *);
guint32 num = handle->opcode & 0xff;
......
......@@ -73,7 +73,7 @@ ms_container_get_blip (MSContainer *container, int blip_id)
return ms_container_get_blip (container->parent_container,
blip_id);
g_return_val_if_fail (blip_id < container->blips->len, NULL);
g_return_val_if_fail (blip_id < (int)container->blips->len, NULL);
return g_ptr_array_index (container->blips, blip_id);
}
......
......@@ -36,8 +36,8 @@ typedef struct
guint32 segment_len; /* number of bytes in current segment */
/* Offsets from the logical 1st byte in the stream */
guint32 start_offset; /* 1st byte in current segment */
guint32 end_offset; /* 1st byte past end of current segment */
gint32 start_offset; /* 1st byte in current segment */
gint32 end_offset; /* 1st byte past end of current segment */
} MSEscherState;
typedef struct _MSEscherHeader
......@@ -46,9 +46,9 @@ typedef struct _MSEscherHeader
guint ver;
guint instance;
guint16 fbt;
guint32 len; /* Including the common header */
gint32 len; /* Including the common header */
guint32 offset;
gint32 offset;
struct _MSEscherHeader *container;
/* TODO : decide were to put these cause they dont belong here */
......@@ -102,8 +102,8 @@ ms_escher_blip_destroy (MSEscherBlip *blip)
static guint8 const *
ms_escher_get_data (MSEscherState * state,
gint offset, /* bytes from logical start of the stream */
guint num_bytes, /* how many bytes we want, incl prefix */
guint prefix, /* number of bytes of header to skip */
gint num_bytes, /* how many bytes we want, incl prefix */
gint prefix, /* number of bytes of header to skip */
gboolean * needs_free)
{
BiffQuery *q = state->q;
......@@ -1722,14 +1722,17 @@ static gboolean
ms_escher_read_ClientTextbox (MSEscherState *state, MSEscherHeader *h)
{
guint16 opcode;
int has_next_record;
g_return_val_if_fail (h->len == common_header_len, TRUE);
g_return_val_if_fail (h->offset + h->len == state->end_offset, TRUE);
/* Read the TXO, be VERY careful until we are sure of the state */
g_return_val_if_fail (ms_biff_query_peek_next (state->q, &opcode), TRUE);
has_next_record = ms_biff_query_peek_next (state->q, &opcode);
g_return_val_if_fail (has_next_record, TRUE);
g_return_val_if_fail (opcode == BIFF_TXO, TRUE);
g_return_val_if_fail (ms_biff_query_next (state->q), TRUE);
has_next_record = ms_biff_query_next (state->q);
g_return_val_if_fail (has_next_record, TRUE);
/* FIXME : Leaking memory. Get an object management framework into place
* so that there is somewhere to put the comment text.
......@@ -1743,14 +1746,17 @@ ms_escher_read_ClientData (MSEscherState *state, MSEscherHeader *h)
{
guint16 opcode;
MSObj *obj;
int has_next_record;
g_return_val_if_fail (h->len == common_header_len, TRUE);
g_return_val_if_fail (h->offset + h->len == state->end_offset, TRUE);
/* Read the OBJ, be VERY careful until we are sure of the state */
g_return_val_if_fail (ms_biff_query_peek_next (state->q, &opcode), TRUE);
has_next_record = ms_biff_query_peek_next (state->q, &opcode);
g_return_val_if_fail (has_next_record, TRUE);
g_return_val_if_fail (opcode == BIFF_OBJ, TRUE);
g_return_val_if_fail (ms_biff_query_next (state->q), TRUE);
has_next_record = ms_biff_query_next (state->q);
g_return_val_if_fail (has_next_record, TRUE);
obj = ms_read_OBJ (state->q, state->container);
......
......@@ -172,7 +172,7 @@ get_chars (const char *ptr, guint length, gboolean high_byte)
if (high_byte) {
wchar_t* wc = g_new (wchar_t, length + 2);
int retlength;
size_t retlength;
ans = g_new (char, (length+2)*8);
for (lp = 0; lp < length; lp++) {
......@@ -384,7 +384,7 @@ static void
read_sst (ExcelWorkbook *wb, BiffQuery *q, MsBiffVersion ver)
{
guint32 offset;
int k;
unsigned k;
#ifndef NO_DEBUG_EXCEL
if (ms_excel_read_debug>4) {
......@@ -819,7 +819,7 @@ biff_name_data_get_name (ExcelSheet *sheet, int idx)
a = sheet->wb->name_data;
if (a == NULL || idx < 0 || a->len <= idx ||
if (a == NULL || idx < 0 || (int)a->len <= idx ||
(bnd = g_ptr_array_index (a, idx)) == NULL) {
g_warning ("EXCEL : %x (of %x) UNKNOWN name\n", idx, a->len);
return expr_tree_new_constant (value_new_string ("Unknown name"));
......@@ -1107,13 +1107,13 @@ ms_excel_get_font (ExcelSheet *sheet, guint16 font_idx)
}
static BiffXFData const *
ms_excel_get_xf (ExcelSheet *sheet, int const xfidx)
ms_excel_get_xf (ExcelSheet *sheet, int xfidx)
{
BiffXFData *xf;
GPtrArray const * const p = sheet->wb->XF_cell_records;
g_return_val_if_fail (p != NULL, NULL);
if (0 > xfidx || xfidx >= p->len) {
if (0 > xfidx || xfidx >= (int)p->len) {
g_warning ("XL : Xf index 0x%x is not in the range [0..0x%x)", xfidx, p->len);
return NULL;
}
......@@ -1463,7 +1463,7 @@ excel_map_pattern_index_from_excel (int const i)
/* Default to Solid if out of range */
g_return_val_if_fail (i >= 0 &&
i < (sizeof (map_from_excel)/sizeof (int)), 0);
i < (int)(sizeof (map_from_excel)/sizeof (int)), 0);
return map_from_excel[i];
}
......@@ -1801,7 +1801,9 @@ biff_shared_formula_destroy (gpointer key, BiffSharedFormula *sf,
static ExprTree *
ms_excel_formula_shared (BiffQuery *q, ExcelSheet *sheet, Cell *cell)
{
g_return_val_if_fail (ms_biff_query_next (q), NULL);
int has_next_record = ms_biff_query_next (q);
g_return_val_if_fail (has_next_record, NULL);
if (q->ls_op == BIFF_SHRFMLA || q->ls_op == BIFF_ARRAY) {
gboolean const is_array = (q->ls_op == BIFF_ARRAY);
......@@ -1905,7 +1907,7 @@ ms_excel_read_formula (BiffQuery *q, ExcelSheet *sheet)
cell_set_value (cell, value_new_error (NULL, "Formula Error"), NULL);
return;
}
if (q->length < (22 + MS_OLE_GET_GUINT16 (q->data+20))) {
if (q->length < (unsigned)(22 + MS_OLE_GET_GUINT16 (q->data+20))) {
printf ("FIXME: serious formula error: "
"supposed length 0x%x, real len 0x%x\n",
MS_OLE_GET_GUINT16 (q->data+20), q->length);
......@@ -2494,7 +2496,7 @@ ms_excel_workbook_attach (ExcelWorkbook *wb, ExcelSheet *ans)
static gboolean
ms_excel_workbook_detach (ExcelWorkbook *wb, ExcelSheet *ans)
{
int idx = 0;
unsigned idx = 0;
if (ans->gnum_sheet) {
if (!workbook_sheet_detach (wb->gnum_wb, ans->gnum_sheet))
......@@ -2523,7 +2525,7 @@ ms_excel_workbook_get_sheet (ExcelWorkbook *wb, guint idx)
static void
ms_excel_workbook_destroy (ExcelWorkbook *wb)
{
gint lp;
unsigned lp;
g_hash_table_foreach_remove (wb->boundsheet_data_by_stream,
(GHRFunc)biff_boundsheet_data_destroy,
......@@ -2562,7 +2564,7 @@ ms_excel_workbook_destroy (ExcelWorkbook *wb)
g_free (wb->extern_sheets);
if (wb->global_strings) {
int i;
unsigned i;
for (i = 0; i < wb->global_string_max; i++)
g_free (wb->global_strings[i]);
g_free (wb->global_strings);
......@@ -3207,7 +3209,7 @@ ms_excel_read_cell (BiffQuery *q, ExcelSheet *sheet)
ms_excel_sheet_insert_val (sheet, EX_GETXF (q), EX_GETCOL (q), EX_GETROW (q),
value_new_string (str));
} else
printf ("string index 0x%x >= 0x%x\n",
printf ("string index 0x%u >= 0x%x\n",
idx, sheet->wb->global_string_max);
break;
}
......@@ -3396,7 +3398,7 @@ ms_excel_read_mergecells (BiffQuery *q, ExcelSheet *sheet)
/* Do an anal sanity check. Just in case we've
* mis-interpreted the format.
*/
g_return_if_fail (q->length == 2+8*num_merged);
g_return_if_fail (q->length == (unsigned )(2+8*num_merged));
for (i = 0 ; i < num_merged ; ++i, ptr += 8) {
Range r;
......
......@@ -99,7 +99,7 @@ typedef struct _ExcelWorkbook
guint16 num_extern_sheets;
ExcelPalette *palette;
char **global_strings;
int global_string_max;
guint32 global_string_max;
/* Indexed in the order they are read */
GPtrArray *charts;
......
......@@ -172,7 +172,7 @@ two_way_table_idx_to_key (const TwoWayTable *table, gint idx)
{
g_return_val_if_fail (idx - table->base >= 0, NULL);
g_return_val_if_fail (idx - table->base < table->idx_to_key->len,
g_return_val_if_fail (idx - table->base < (int)table->idx_to_key->len,
NULL);
return g_ptr_array_index (table->idx_to_key, idx - table->base);
......
......@@ -97,7 +97,7 @@ ms_read_TXO (BiffQuery *q)
/*
* FIXME: Use biff_get_text or something ?
*/
if (q->length < increment * text_len) {
if ((int)q->length < increment * text_len) {
g_free (text);
text = g_strdup ("Broken continue");
} else {
......@@ -467,7 +467,7 @@ ms_read_OBJ (BiffQuery *q, MSContainer *container)
}
obj->excel_type_name = NULL;
if (obj->excel_type < sizeof(object_type_names)/sizeof(char*))
if (obj->excel_type < (int)(sizeof(object_type_names)/sizeof(char*)))
obj->excel_type_name = object_type_names [obj->excel_type];
if (obj->excel_type_name == NULL)
obj->excel_type_name = "Unknown";
......
......@@ -26,7 +26,7 @@ struct _MSObj
/* Type specific parameters */
GtkObject *gnum_obj;
unsigned excel_type;
int excel_type;
char const *excel_type_name;
};
......
......@@ -103,7 +103,7 @@ excel_to_gnumeric (guint32 type)
static int
sum_name_to_excel (const gchar *name, MsOleSummaryPID *pid, MsOlePropertySetID psid)
{
gint i, j;
unsigned i, j;
/*
* First find the name in the summary_item_name array.
......@@ -229,7 +229,7 @@ ms_summary_read (MsOle *f, SummaryInfo *sin)
static void
set_summary_item (SummaryItem *s_item, MsOleSummary *ms_sum)
{
gint sect;
unsigned sect;
MsOleSummaryPID pid;
for (sect = 0; sect < ms_sum->sections->len; sect++) {
......
......@@ -880,7 +880,7 @@ gnumeric_value (FunctionEvalInfo *ei, Value **argv)
;
v = format_match (p, NULL, NULL);
free (arg);
g_free (arg);
if (v)
return v;
......
......@@ -67,7 +67,7 @@ record_seek (XBrecord *record, int whence, glong row)
g_warning("record_seek: invalid whence (%d)", whence);
return FALSE;
}
if (offset < 1 || offset > record->file->records)
if (offset < 1 || offset > (int)record->file->records)
return FALSE;
record->row = offset;
offset = (offset-1) * record->file->fieldlen + record->file->offset;
......@@ -249,7 +249,7 @@ xbase_open (const char *filename, ErrorInfo **ret_error)
void
xbase_close (XBfile *x)
{
int i;
unsigned i;
fprintf (stderr, "Closing Xbase file\n");
fclose (x->f);
......
......@@ -880,7 +880,7 @@ gnumeric_value (FunctionEvalInfo *ei, Value **argv)
;
v = format_match (p, NULL, NULL);
free (arg);
g_free (arg);
if (v)
return v;
......
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