Commit af8d771a authored by Morten Welinder's avatar Morten Welinder

Warning killers.

parent 4a9bcf11
2002-02-20 Morten Welinder <terra@diku.dk>
* src/mathfunc.c (display): Fix format.
* src/analysis-tools.c (confidence_level): Ditto.
(regression_tool): Ditto.
* src/format.c (fmt_general_int): Ditto.
* configure.in (set_mode_warnings): Add -Wformat also.
2002-02-20 Morten Welinder <terra@diku.dk>
* src/func.c (fn_def_new, function_add_args, function_add_nodes):
......
2002-02-20 Morten Welinder <terra@diku.dk>
* src/mathfunc.c (display): Fix format.
* src/analysis-tools.c (confidence_level): Ditto.
(regression_tool): Ditto.
* src/format.c (fmt_general_int): Ditto.
* configure.in (set_mode_warnings): Add -Wformat also.
2002-02-20 Morten Welinder <terra@diku.dk>
* src/func.c (fn_def_new, function_add_args, function_add_nodes):
......
2002-02-20 Morten Welinder <terra@diku.dk>
* src/mathfunc.c (display): Fix format.
* src/analysis-tools.c (confidence_level): Ditto.
(regression_tool): Ditto.
* src/format.c (fmt_general_int): Ditto.
* configure.in (set_mode_warnings): Add -Wformat also.
2002-02-20 Morten Welinder <terra@diku.dk>
* src/func.c (fn_def_new, function_add_args, function_add_nodes):
......
......@@ -46,7 +46,7 @@ AC_PATH_PROG(GDK_PIXBUF_CSOURCE, gdk-pixbuf-csource)
GNOME_COMPILE_WARNINGS
set_mode_warnings=yes
if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
for option in -Wsign-promo -Wsign-compare -Wpointer-arith -Wnested-externs -Wchar-subscripts -Wwrite-strings; do
for option in -Wsign-promo -Wsign-compare -Wpointer-arith -Wnested-externs -Wchar-subscripts -Wwrite-strings -Wformat; do
SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $option"
AC_MSG_CHECKING([whether gcc understands $option])
......
2002-02-20 Morten Welinder <terra@diku.dk>
* ms-excel-write.c (write_value): Fix format.
* ms-excel-read.c (ms_excel_read_name): Constify.
* ms-formula-read.c (formula_func_data): Constify.
* ms-excel-util.c (two_way_table_put): Constify.
2002-02-19 Jon K Hellan <hellan@acm.org>
* ms-excel-read.c (ms_excel_palette_get): Update documentation.
......
......@@ -52,12 +52,12 @@ extern char const *excel_builtin_formats[];
typedef struct
{
char *prefix ;
const char *prefix ;
int num_args ; /* -1 for multi-arg */
/* -2 for unknown args */
} FormulaFuncData;
extern FormulaFuncData formula_func_data[];
extern const FormulaFuncData formula_func_data[];
#define FORMULA_FUNC_DATA_LEN 368
#define ROW_BLOCK_MAX_LEN 32
......
......@@ -2625,23 +2625,24 @@ Opcode 0x 18 : NAME, length 0x1a (=26)
/* FIXME FIXME FIXME: Disable for now */
if (0 && name_len == 1 && *ptr <= 0x0c) {
const char *cname;
switch (*ptr) {
case 0x00: name = "Consolidate_Area"; break;
case 0x01: name = "Auto_Open"; break;
case 0x02: name = "Auto_Close"; break;
case 0x03: name = "Extract"; break;
case 0x04: name = "Database"; break;
case 0x05: name = "Criteria"; break;
case 0x06: name = "Print_Area"; break;
case 0x07: name = "Print_Titles"; break;
case 0x08: name = "Recorder"; break;
case 0x09: name = "Data_Form"; break;
case 0x0a: name = "Auto_Activate"; break;
case 0x0b: name = "Auto_Deactivate"; break;
case 0x0c: name = "Sheet_Title"; break;
default: name = "ERROR ERROR ERROR. This is impossible";
case 0x00: cname = "Consolidate_Area"; break;
case 0x01: cname = "Auto_Open"; break;
case 0x02: cname = "Auto_Close"; break;
case 0x03: cname = "Extract"; break;
case 0x04: cname = "Database"; break;
case 0x05: cname = "Criteria"; break;
case 0x06: cname = "Print_Area"; break;
case 0x07: cname = "Print_Titles"; break;
case 0x08: cname = "Recorder"; break;
case 0x09: cname = "Data_Form"; break;
case 0x0a: cname = "Auto_Activate"; break;
case 0x0b: cname = "Auto_Deactivate"; break;
case 0x0c: cname = "Sheet_Title"; break;
default: cname = "ERROR ERROR ERROR. This is impossible";
}
name = g_strdup (name);
name = g_strdup (cname);
} else
name = biff_get_text (ptr, name_len, NULL);
ptr += name_len + name_def_len;
......
......@@ -106,7 +106,7 @@ two_way_table_free (TwoWayTable *table)
*/
gint
two_way_table_put (const TwoWayTable *table, gpointer key,
gboolean unique, AfterPutFunc apf, gpointer closure)
gboolean unique, AfterPutFunc apf, gconstpointer closure)
{
gint index = two_way_table_key_to_idx (table, key);
gboolean found = (index >= 0);
......
......@@ -36,7 +36,7 @@ two_way_table_free (TwoWayTable *table);
gint
two_way_table_put (const TwoWayTable *table, gpointer key,
gboolean unique, AfterPutFunc apf, gpointer closure);
gboolean unique, AfterPutFunc apf, gconstpointer closure);
gpointer
two_way_table_replace (const TwoWayTable *table, gint idx, gpointer key);
......
......@@ -2480,8 +2480,10 @@ write_value (BiffPut *bp, Value *v, MsBiffVersion ver,
(((((int)val)<<2)>>2) == ((int)val));
d (3, printf ("Writing %g is (%g %g) is int ? %d\n",
val, 1.0*(int)val,
1.0*(val - (int)val), is_int););
(double)val,
(double)(1.0 * (int)val),
(double)(1.0 * (val - (int)val)),
is_int););
/* FIXME : Add test for double with 2 digits of fraction
* and represent it as a mode 3 RK (val*100) construct */
......
......@@ -44,7 +44,7 @@
* macrofun.hlp has info on them but supporting Excel4 macro sheets is not
* top priority.
**/
FormulaFuncData formula_func_data[FORMULA_FUNC_DATA_LEN] =
const FormulaFuncData formula_func_data[FORMULA_FUNC_DATA_LEN] =
{
/* 0 */ { "COUNT", -1 },
/* 1 */ { "IF", -1 },
......
2002-02-20 Morten Welinder <terra@diku.dk>
* lotus.c (lotus_special_formats): Constify and make static.
* lotus-formula.c (functions): Constify.
2002-02-18 Jody Goldberg <jody@gnome.org>
* Release 1.1.0
......
......@@ -21,12 +21,12 @@
typedef struct {
gint args; /* -1 for multiple arguments */
guint16 idx;
gchar *name;
const gchar *name;
enum { NORMAL, UNARY, BINOP } special;
guint32 data;
} func_struct_t;
func_struct_t functions[] = {
const func_struct_t functions[] = {
{ 1, 0x08, "-", UNARY, OPER_UNARY_NEG },
{ 2, 0x09, "+", BINOP, OPER_ADD },
{ 2, 0x0A, "-", BINOP, OPER_SUB },
......
......@@ -28,7 +28,8 @@
#define LOTUS_DEBUG 0
char *lotus_special_formats[16] = {
static const char *
lotus_special_formats[16] = {
"",
"",
"d-mmm-yy",
......
......@@ -1075,12 +1075,15 @@ confidence_level (WorkbookControl *wbc, GPtrArray *data, gnum_float c_level,
gnum_float x;
guint col;
char *buffer;
char *format;
desc_stats_t info;
data_set_t *the_col;
prepare_output (wbc, dao, _("Confidence Interval for the Mean"));
buffer = g_strdup_printf (_("/%g%% CI for the Mean from"
"/to"), c_level * 100);
format = g_strdup_printf (_("/%%%s%%%% CI for the Mean from"
"/to"), GNUM_FORMAT_g);
buffer = g_strdup_printf (format, c_level * 100);
g_free (format);
set_cell_text_col (dao, 0, 1, buffer);
g_free (buffer);
......@@ -2262,6 +2265,7 @@ regression_tool (WorkbookControl *wbc, Sheet *sheet,
data_set_t *y_data = NULL;
GArray *cleaned = NULL;
char *text = NULL;
char *format;
regression_stat_t *regression_stat = NULL;
gnum_float r;
gnum_float *res, **xss;
......@@ -2374,13 +2378,18 @@ regression_tool (WorkbookControl *wbc, Sheet *sheet,
"/Significance of F"));
set_italic (dao, 1, 10, 5, 10);
text = g_strdup_printf (_("/Coefficients"
"/Standard Error"
"/t Stat"
"/P-value"
"/Lower %0.0f%%"
"/Upper %0.0f%%"),
((1.0 - alpha) * 100),((1.0 - alpha) * 100));
format = g_strdup_printf (_("/Coefficients"
"/Standard Error"
"/t Stat"
"/P-value"
"/Lower %%0.0%s%%%%"
"/Upper %%0.0%s%%%%"),
GNUM_FORMAT_f,
GNUM_FORMAT_f);
text = g_strdup_printf (format,
(1.0 - alpha) * 100,
(1.0 - alpha) * 100);
g_free (format);
set_cell_text_row (dao, 1, 15, text);
set_italic (dao, 1, 15, 6, 15);
g_free (text);
......
......@@ -1490,7 +1490,7 @@ fmt_general_int (int val, int col_width)
if (log_val > col_width)
/* FIXME : glib bug. it does not handle G, use g */
/* Decrease available width by 5 to account for .+E00 */
return g_strdup_printf ("%.*" GNUM_FORMAT_g, col_width - 5, (double)val);
return g_strdup_printf ("%.*g", col_width - 5, (double)val);
}
return g_strdup_printf ("%d", val);
}
......
......@@ -4047,14 +4047,14 @@ vect_sqr_mdiag (gnum_float *v, int n, gnum_float *M)
#include <stdio.h>
static void
display (gnum_float *M, int cols, int rows, char *s)
display (gnum_float *M, int cols, int rows, const char *s)
{
int i, j;
printf ("\n%s:\n", s);
for (i = 0; i < rows; i++) {
for (j = 0; j < cols; j++)
printf ("%8.4f ", M[i + j * rows]);
printf ("%8.4" GNUM_FORMAT_f " ", M[i + j * rows]);
printf ("\n");
}
printf ("\n");
......
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