Commit ed56edbd authored by Jody Goldberg's avatar Jody Goldberg

Fix some includes and warnings

parent 92755827
......@@ -151,9 +151,9 @@ excel_save (IOContext *context, WorkbookView *wb_view, const char *filename,
if (disable_safety == NULL) {
gnumeric_io_error_save (context,
_("Saving over old Excel files disabled for safety.\n\n"
"(You can turn this safety feature off by setting the\n"
"enviromental variable GNUMERIC_ENABLE_XL_OVERWRITE.)"));
_("Saving over old Excel files disabled for safety.\n\n"
"(You can turn this safety feature off by setting the\n"
"enviromental variable GNUMERIC_ENABLE_XL_OVERWRITE.)"));
return;
}
}
......
......@@ -5,16 +5,17 @@
* Jukka-Pekka Iivonen (iivonen@iki.fi)
*/
#include <config.h>
#include <math.h>
#include <glib.h>
#include "parse-util.h"
#include "func-util.h"
#include "func.h"
#include "func-util.h"
#include "parse-util.h"
#include "str.h"
#include "cell.h"
#include "sheet.h"
#include "number-match.h"
#include <math.h>
#include <string.h>
/* Type definitions */
typedef struct {
......
......@@ -6,15 +6,15 @@
* Jukka-Pekka Iivonen (iivonen@iki.fi)
*/
#include <config.h>
#include <math.h>
#include "gnumeric.h"
#include "func.h"
#include "parse-util.h"
#include "str.h"
#include "cell.h"
#include "func.h"
#include "datetime.h"
#include "auto-format.h"
#include <math.h>
#define DAY_SECONDS (3600*24)
/***************************************************************************/
......
......@@ -6,17 +6,19 @@
* Jukka-Pekka Iivonen <iivonen@iki.fi>
*/
#include <config.h>
#include <gnome.h>
#include <ctype.h>
#include <math.h>
#include <limits.h>
#include "complex.h"
#include "gnumeric.h"
#include "parse-util.h"
#include "func.h"
#include "parse-util.h"
#include "complex.h"
#include "str.h"
#include "mathfunc.h"
#include <ctype.h>
#include <math.h>
#include <limits.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#if 0
/* help template */
static char *help_ = {
......
......@@ -8,18 +8,19 @@
*/
#include <config.h>
#include <math.h>
#include <limits.h>
#include "gnumeric.h"
#include "func.h"
#include "parse-util.h"
#include "cell.h"
#include "func.h"
#include "goal-seek.h"
#include "collect.h"
#include "auto-format.h"
#include "datetime.h"
#include "str.h"
#include <math.h>
#include <limits.h>
#include <string.h>
/*
Below are some of the functions that are used quite often in
......
......@@ -8,9 +8,8 @@
* Almer S. Tigelaar (almer@gnome.org)
*/
#include <config.h>
#include "gnumeric.h"
#include "parse-util.h"
#include "func.h"
#include "parse-util.h"
#include "cell.h"
#include "str.h"
#include "sheet.h"
......@@ -20,6 +19,7 @@
#include "style.h"
#include "sheet-style.h"
#include "number-match.h"
#include <sys/utsname.h>
#include <math.h>
......
......@@ -7,13 +7,11 @@
*/
#include <config.h>
#include "gnumeric.h"
#include "func.h"
#include "parse-util.h"
#include "cell.h"
#include "func.h"
#include "auto-format.h"
/***************************************************************************/
static char *help_and = {
......
......@@ -8,17 +8,16 @@
*/
#include <config.h>
#include <glib.h>
#include "numbers.h"
#include "parse-util.h"
#include "func.h"
#include "parse-util.h"
#include "eval.h"
#include "cell.h"
#include "str.h"
#include "sheet.h"
/* Useful routines for multiple functions */
#include <string.h>
/* Useful routines for multiple functions */
static gboolean
find_type_valid (const Value *find)
{
......
......@@ -6,11 +6,9 @@
* Jukka-Pekka Iivonen (iivonen@iki.fi)
*/
#include <config.h>
#include <math.h>
#include "gnumeric.h"
#include "parse-util.h"
#include "func-util.h"
#include "func.h"
#include "func-util.h"
#include "parse-util.h"
#include "cell.h"
#include "sheet.h"
#include "str.h"
......@@ -18,6 +16,9 @@
#include "collect.h"
#include "auto-format.h"
#include <math.h>
#include <string.h>
typedef struct {
GSList *list;
int num;
......
......@@ -7,18 +7,19 @@
* Morten Welinder <terra@diku.dk>
*/
#include <config.h>
#include <math.h>
#include "func.h"
#include "func-util.h"
#include "parse-util.h"
#include "mathfunc.h"
#include "regression.h"
#include "numbers.h"
#include "parse-util.h"
#include "func-util.h"
#include "func.h"
#include "sheet.h"
#include "cell.h"
#include "collect.h"
#include "auto-format.h"
#include <math.h>
#include <stdlib.h>
static guint
float_hash (const gnum_float *d)
{
......
......@@ -7,19 +7,19 @@
* Jukka-Pekka Iivonen (iivonen@iki.fi)
*/
#include <config.h>
#include <ctype.h>
#include <math.h>
#include <limits.h>
#include "gnumeric.h"
#include "parse-util.h"
#include "func.h"
#include "parse-util.h"
#include "cell.h"
#include "format.h"
#include "str.h"
#include "sheet.h"
#include "position.h"
#include "number-match.h"
#include <ctype.h>
#include <math.h>
#include <limits.h>
#include <string.h>
/***************************************************************************/
static char *help_char = {
......@@ -1037,13 +1037,13 @@ gnumeric_dollar (FunctionEvalInfo *ei, Value **argv)
barfed = 1;
}
if (argv[1] != NULL) {
x = 0.5;
x = 0.5;
n = value_get_as_int (argv[1]);
for (i = 0; i < n; i++)
x /= 10;
x /= 10;
ag[0] = value_new_float (value_get_as_float (argv[0]) + x);
} else
ag[0] = value_duplicate (argv[0]);
ag[0] = value_duplicate (argv[0]);
ag[1] = argv[1];
ag[2] = NULL;
......@@ -1117,12 +1117,12 @@ wildcards_and_question_marks (const gchar *find_str, int *qmarks, int *wildcard)
*wildcard = 0;
for (pos = 0; find_str[pos]; pos++)
if (find_str[pos] == '?')
++skip;
else if (find_str[pos] == '*')
*wildcard = 1;
else
break;
if (find_str[pos] == '?')
++skip;
else if (find_str[pos] == '*')
*wildcard = 1;
else
break;
*qmarks = skip;
return pos;
......@@ -1149,11 +1149,11 @@ parse_search_string (const gchar *find_str)
find_str += pos;
while (*find_str) {
if (*find_str == '~') {
buf[i++] = *(++find_str);
if (*find_str == '~') {
buf[i++] = *(++find_str);
find_str++;
} else if (*find_str == '?' || *find_str == '*') {
buf[i] = '\0';
buf[i] = '\0';
search_cond = g_new (string_search_t, 1);
search_cond->str = g_strdup (buf);
search_cond->min_skip = qmarks;
......@@ -1164,7 +1164,7 @@ parse_search_string (const gchar *find_str)
&wildcard);
find_str += pos;
} else
buf[i++] = *find_str++;
buf[i++] = *find_str++;
}
buf[i] = '\0';
search_cond = g_new (string_search_t, 1);
......@@ -1192,7 +1192,7 @@ match_string (const gchar *str, string_search_t *cond, gchar **match_start,
return 0;
if (*cond->str == '\0') {
*match_start = (char *)str;
*match_start = (char *)str;
*match_end = (char *)str + 1;
return 1;
}
......@@ -1221,8 +1221,8 @@ free_all_after_search (GSList *conditions, gchar *text, gchar *within)
current = conditions;
while (current != NULL) {
current_cond = current->data;
g_free (current_cond->str);
current_cond = current->data;
g_free (current_cond->str);
g_free (current_cond);
current = current->next;
}
......@@ -1241,9 +1241,9 @@ gnumeric_search (FunctionEvalInfo *ei, Value **argv)
gchar *p_start, *p_end;
if (argv[2] == NULL)
start_num = 0;
start_num = 0;
else
start_num = value_get_as_int (argv[2]) - 1;
start_num = value_get_as_int (argv[2]) - 1;
text = value_get_as_string (argv[0]);
within = value_get_as_string (argv[1]);
......@@ -1253,14 +1253,14 @@ gnumeric_search (FunctionEvalInfo *ei, Value **argv)
within_len = strlen (within);
if (within_len <= start_num) {
g_free (text);
g_free (text);
g_free (within);
return value_new_error (ei->pos, gnumeric_err_VALUE);
}
conditions = parse_search_string (text);
if (conditions == NULL) {
g_free (text);
g_free (text);
g_free (within);
return value_new_error (ei->pos, gnumeric_err_VALUE);
}
......@@ -1272,7 +1272,7 @@ match_again:
current_cond = current->data;
ret = match_string (match_str, current_cond, &p_start, &p_end);
if (ret) {
current = current->next;
current = current->next;
if (current == NULL) {
free_all_after_search (conditions, text, within);
return value_new_int (p_start - within + 1);
......@@ -1281,7 +1281,7 @@ match_again:
match_str = p_start;
match_str_next = p_end;
while (match_string (p_end, current_cond, &p_start, &p_end)) {
current = current->next;
current = current->next;
if (current == NULL) {
free_all_after_search (conditions,
text, within);
......@@ -1330,7 +1330,7 @@ string_functions_init (void)
&help_lower, gnumeric_lower);
function_add_args (cat, "proper", "s", "text",
&help_proper, gnumeric_proper);
function_add_args (cat, "mid", "sff", "text,pos,num",
function_add_args (cat, "mid", "sff", "text,pos,num",
&help_mid, gnumeric_mid);
function_add_args (cat, "replace", "sffs", "old,start,num,new",
&help_replace, gnumeric_replace);
......
......@@ -7,7 +7,6 @@
* Miguel de Icaza 1998, 1999 (miguel@kernel.org)
*/
#include "config.h"
#include "gnumeric.h"
#include "cell.h"
#include "workbook.h"
#include "sheet.h"
......
......@@ -10,9 +10,8 @@
#include <locale.h>
#include <string.h>
#include <ctype.h>
#include "gnumeric.h"
#include "gnumeric-util.h"
#include "clipboard.h"
#include "gnumeric-util.h"
#include "sheet.h"
#include "sheet-style.h"
#include "sheet-merge.h"
......
......@@ -23,10 +23,9 @@
* USA
*/
#include <config.h>
#include "gnumeric.h"
#include "eval.h"
#include "parse-util.h"
#include "ranges.h"
#include "eval.h"
#include "value.h"
#include "main.h"
#include "workbook-control.h"
......@@ -1115,7 +1114,7 @@ workbook_deps_destroy (Workbook *wb)
void
workbook_queue_all_recalc (Workbook *wb)
{
#warning what about dependents in other workbooks
/* FIXME : warning what about dependents in other workbooks */
dependent_queue_recalc_list (wb->dependents, FALSE);
}
......
......@@ -23,10 +23,9 @@
* USA
*/
#include <config.h>
#include "gnumeric.h"
#include "eval.h"
#include "parse-util.h"
#include "ranges.h"
#include "eval.h"
#include "value.h"
#include "main.h"
#include "workbook-control.h"
......@@ -1115,7 +1114,7 @@ workbook_deps_destroy (Workbook *wb)
void
workbook_queue_all_recalc (Workbook *wb)
{
#warning what about dependents in other workbooks
/* FIXME : warning what about dependents in other workbooks */
dependent_queue_recalc_list (wb->dependents, FALSE);
}
......
......@@ -9,11 +9,10 @@
#include <config.h>
#include <gnome.h>
#include <gdk/gdkkeysyms.h>
#include "gnumeric.h"
#include "expr-name.h"
#include "eval.h"
#include "value.h"
#include "workbook.h"
#include "expr-name.h"
#include "expr.h"
#include "str.h"
#include "sheet.h"
......
......@@ -9,7 +9,6 @@
#include <gnome.h>
#include <math.h>
#include <string.h>
#include "gnumeric.h"
#include "expr.h"
#include "expr-name.h"
#include "eval.h"
......
......@@ -9,6 +9,7 @@
#include <string.h>
#include <libgnome/libgnome.h>
#include <gal/util/e-util.h>
#include "file.h"
#include "io-context.h"
#include "command-context.h"
#include "gnumeric.h"
......@@ -18,7 +19,6 @@
#include "workbook-view.h"
#include "workbook.h"
#include "gutils.h"
#include "file.h"
#include "file-priv.h"
/*
......
......@@ -10,9 +10,8 @@
#include <config.h>
#include <gnome.h>
#include <math.h>
#include "gnumeric.h"
#include "parse-util.h"
#include "func.h"
#include "parse-util.h"
#include "eval.h"
#include "cell.h"
#include "str.h"
......
#ifndef GNUMERIC_FUNC_H
#define GNUMERIC_FUNC_H
#include <gnome.h>
#include "gnumeric.h"
#include "value.h"
#include "expr.h"
#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
/* Setup of the symbol table */
void functions_init (void);
/* Used to build manual */
......
......@@ -5,16 +5,17 @@
* Jukka-Pekka Iivonen (iivonen@iki.fi)
*/
#include <config.h>
#include <math.h>
#include <glib.h>
#include "parse-util.h"
#include "func-util.h"
#include "func.h"
#include "func-util.h"
#include "parse-util.h"
#include "str.h"
#include "cell.h"
#include "sheet.h"
#include "number-match.h"
#include <math.h>
#include <string.h>
/* Type definitions */
typedef struct {
......
......@@ -6,15 +6,15 @@
* Jukka-Pekka Iivonen (iivonen@iki.fi)
*/
#include <config.h>
#include <math.h>
#include "gnumeric.h"
#include "func.h"
#include "parse-util.h"
#include "str.h"
#include "cell.h"
#include "func.h"
#include "datetime.h"
#include "auto-format.h"
#include <math.h>
#define DAY_SECONDS (3600*24)
/***************************************************************************/
......
......@@ -6,17 +6,19 @@
* Jukka-Pekka Iivonen <iivonen@iki.fi>
*/
#include <config.h>
#include <gnome.h>
#include <ctype.h>
#include <math.h>
#include <limits.h>
#include "complex.h"
#include "gnumeric.h"
#include "parse-util.h"
#include "func.h"
#include "parse-util.h"
#include "complex.h"
#include "str.h"
#include "mathfunc.h"
#include <ctype.h>
#include <math.h>
#include <limits.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#if 0
/* help template */
static char *help_ = {
......
......@@ -8,18 +8,19 @@
*/
#include <config.h>
#include <math.h>
#include <limits.h>
#include "gnumeric.h"
#include "func.h"
#include "parse-util.h"
#include "cell.h"
#include "func.h"
#include "goal-seek.h"
#include "collect.h"
#include "auto-format.h"
#include "datetime.h"
#include "str.h"
#include <math.h>
#include <limits.h>
#include <string.h>
/*
Below are some of the functions that are used quite often in
......
......@@ -8,9 +8,8 @@
* Almer S. Tigelaar (almer@gnome.org)
*/
#include <config.h>
#include "gnumeric.h"
#include "parse-util.h"
#include "func.h"
#include "parse-util.h"
#include "cell.h"
#include "str.h"
#include "sheet.h"
......@@ -20,6 +19,7 @@
#include "style.h"
#include "sheet-style.h"
#include "number-match.h"
#include <sys/utsname.h>
#include <math.h>
......
......@@ -7,13 +7,11 @@
*/
#include <config.h>
#include "gnumeric.h"
#include "func.h"
#include "parse-util.h"
#include "cell.h"
#include "func.h"
#include "auto-format.h"
/***************************************************************************/
static char *help_and = {
......
......@@ -8,17 +8,16 @@
*/
#include <config.h>
#include <glib.h>
#include "numbers.h"
#include "parse-util.h"
#include "func.h"
#include "parse-util.h"
#include "eval.h"
#include "cell.h"
#include "str.h"
#include "sheet.h"
/* Useful routines for multiple functions */
#include <string.h>
/* Useful routines for multiple functions */
static gboolean
find_type_valid (const Value *find)
{
......
......@@ -6,11 +6,9 @@
* Jukka-Pekka Iivonen (iivonen@iki.fi)
*/
#include <config.h>
#include <math.h>
#include "gnumeric.h"
#include "parse-util.h"
#include "func-util.h"
#include "func.h"
#include "func-util.h"
#include "parse-util.h"
#include "cell.h"
#include "sheet.h"
#include "str.h"
......@@ -18,6 +16,9 @@
#include "collect.h"
#include "auto-format.h"
#include <math.h>
#include <string.h>
typedef struct {
GSList *list;
int num;
......
......@@ -6,12 +6,13 @@
*
*/
#include <config.h>
#include "gnumeric.h"
#include "parse-util.h"
#include "func.h"
#include "parse-util.h"
#include "cell.h"
#include "selection.h"
#include <stdlib.h>
/***************************************************************************/
static char *help_selection = {
......
......@@ -7,18 +7,19 @@
* Morten Welinder <terra@diku.dk>
*/
#include <config.h>
#include <math.h>
#include "func.h"
#include "func-util.h"
#include "parse-util.h"
#include "mathfunc.h"
#include "regression.h"
#include "numbers.h"
#include "parse-util.h"
#include "func-util.h"
#include "func.h"
#include "sheet.h"
#include "cell.h"
#include "collect.h"
#include "auto-format.h"
#include <math.h>
#include <stdlib.h>
static guint
float_hash (const gnum_float *d)
{
......
......@@ -7,19 +7,19 @@
* Jukka-Pekka Iivonen (iivonen@iki.fi)
*/
#include <config.h>
#include <ctype.h>
#include <math.h>
#include <limits.h>
#include "gnumeric.h"
#include "parse-util.h"
#include "func.h"
#include "parse-util.h"
#include "cell.h"
#include "format.h"
#include "str.h"
#include "sheet.h"
#include "position.h"
#include "number-match.h"
#include <ctype.h>
#include <math.h>
#include <limits.h>
#include <string.h>
/***************************************************************************/
static char *help_char = {
......@@ -1037,13 +1037,13 @@ gnumeric_dollar (FunctionEvalInfo *ei, Value **argv)
barfed = 1;
}
if (argv[1] != NULL) {
x = 0.5;
x = 0.5;
n = value_get_as_int (argv[1]);
for (i = 0; i < n; i++)
x /= 10;
x /= 10;
ag[0] = value_new_float (value_get_as_float (argv[0]) + x);