Commit b87566ff authored by Morten Welinder's avatar Morten Welinder

Constification.

parent b102ecce
2002-02-21 Morten Welinder <terra@diku.dk>
* src/solver-lp.c (callback): Fix formats.
* src/plugin-loader-module.h (ModulePluginFunctionInfo): Constify.
* src/plugin-loader-module.c (gnumeric_plugin_loader_module_func_get_full_function_info): Constify.
* src/func.c (function_def_get_full_info_if_needed): Constify.
2002-02-20 Jody Goldberg <jody@gnome.org>
* src/workbook.h : some house cleaning.
......
2002-02-21 Morten Welinder <terra@diku.dk>
* src/solver-lp.c (callback): Fix formats.
* src/plugin-loader-module.h (ModulePluginFunctionInfo): Constify.
* src/plugin-loader-module.c (gnumeric_plugin_loader_module_func_get_full_function_info): Constify.
* src/func.c (function_def_get_full_info_if_needed): Constify.
2002-02-20 Jody Goldberg <jody@gnome.org>
* src/workbook.h : some house cleaning.
......
2002-02-21 Morten Welinder <terra@diku.dk>
* src/solver-lp.c (callback): Fix formats.
* src/plugin-loader-module.h (ModulePluginFunctionInfo): Constify.
* src/plugin-loader-module.c (gnumeric_plugin_loader_module_func_get_full_function_info): Constify.
* src/func.c (function_def_get_full_info_if_needed): Constify.
2002-02-20 Jody Goldberg <jody@gnome.org>
* src/workbook.h : some house cleaning.
......
2002-02-21 Morten Welinder <terra@diku.dk>
* applix-read.c (applix_parse_style): Constify.
2002-02-18 Jody Goldberg <jody@gnome.org>
* Release 1.1.0
......
......@@ -367,13 +367,12 @@ applix_parse_style (ApplixReadState *state, char **buffer)
sep += 2;
break;
} else {
char *format = NULL;
gboolean needs_free = FALSE;
const char *format = NULL;
switch (*sep) {
case 'D' : {
int id = 0;
char *end;
static char * const date_formats[] = {
static const char * const date_formats[] = {
/* 1 */ "mmmm d, yyyy",
/* 2 */ "mmm d, yyyy",
/* 3 */ "d mmm yy",
......@@ -404,7 +403,7 @@ applix_parse_style (ApplixReadState *state, char **buffer)
id < 1 || id > 16)
(void) applix_parse_error (state, "Unknown format %d", id);
format = date_formats[id-1];
format = date_formats[id - 1];
sep = end;
break;
}
......@@ -490,8 +489,6 @@ applix_parse_style (ApplixReadState *state, char **buffer)
};
if (format)
mstyle_set_format_text (style, format);
if (needs_free)
g_free (format);
}
}
......
......@@ -1149,7 +1149,7 @@ fonts_get_index (ExcelWorkbook *wb, const ExcelFont *f)
* font is added. Free resources when it was already there.
**/
static void
after_put_font (ExcelFont *f, gboolean was_added, gint index, gpointer dummy)
after_put_font (ExcelFont *f, gboolean was_added, gint index, gconstpointer dummy)
{
if (was_added) {
d (1, printf ("Found unique font %d - %s\n",
......@@ -1584,7 +1584,7 @@ xf_free (ExcelWorkbook *wb)
* style is added. Add a reference when putting a style into the table.
**/
static void
after_put_mstyle (MStyle *st, gboolean was_added, gint index, gpointer dummy)
after_put_mstyle (MStyle *st, gboolean was_added, gint index, gconstpointer dummy)
{
if (was_added) {
d (1, {
......
2002-02-21 Morten Welinder <terra@diku.dk>
* font.c (font_is_monospaced): Constify.
(font_is_helvetica): Constify.
(font_is_sansserif): Constify.
2002-02-18 Jody Goldberg <jody@gnome.org>
* Release 1.1.0
......
......@@ -26,7 +26,7 @@
#include "style.h"
static int
font_match (MStyle *mstyle, char **names)
font_match (MStyle *mstyle, const char **names)
{
int i;
const char *font_name;
......@@ -50,7 +50,7 @@ font_match (MStyle *mstyle, char **names)
int
font_is_monospaced (MStyle *mstyle)
{
char *names[] = { "Courier", "fixed", NULL };
const char *names[] = { "Courier", "fixed", NULL };
return font_match (mstyle, names);
}
......@@ -60,7 +60,7 @@ font_is_monospaced (MStyle *mstyle)
int
font_is_helvetica (MStyle *mstyle)
{
char *names [] = { "Helvetica", NULL };
const char *names [] = { "Helvetica", NULL };
return font_match (mstyle, names);
}
......@@ -70,9 +70,9 @@ font_is_helvetica (MStyle *mstyle)
int
font_is_sansserif (MStyle *mstyle)
{
char *names [] = { "helvetica", "avantgarde",
"neep", "blippo", "capri",
"clean", "fixed", NULL };
const char *names [] = { "helvetica", "avantgarde",
"neep", "blippo", "capri",
"clean", "fixed", NULL };
return font_match (mstyle, names);
}
......
2002-02-21 Morten Welinder <terra@diku.dk>
* lotus-formula.c (make_function): Constify.
2002-02-20 Morten Welinder <terra@diku.dk>
* lotus.c (lotus_special_formats): Constify and make static.
......
......@@ -239,7 +239,7 @@ static gint32
make_function (ExprList **stack, guint16 idx, guint8 *data)
{
gint32 ans, numargs;
func_struct_t *f = &functions[idx];
const func_struct_t *f = &functions[idx];
if (f->args < 0) {
numargs = *(data + 1);
......
2002-02-21 Morten Welinder <terra@diku.dk>
* numtheory.c (help_*): Constify.
2002-02-18 Jody Goldberg <jody@gnome.org>
* Release 1.1.0
......
......@@ -194,7 +194,7 @@ isprime (int n)
/* ------------------------------------------------------------------------- */
static char *help_phi = {
static const char *help_phi = {
N_("@FUNCTION=NT_PHI\n"
"@SYNTAX=NT_PHI(n)\n"
"@DESCRIPTION="
......@@ -229,7 +229,7 @@ gnumeric_phi (FunctionEvalInfo *ei, Value **args)
/* ------------------------------------------------------------------------- */
static char *help_nt_mu = {
static const char *help_nt_mu = {
N_("@FUNCTION=NT_MU\n"
"@SYNTAX=NT_MU(n)\n"
"@DESCRIPTION="
......@@ -268,7 +268,7 @@ gnumeric_nt_mu (FunctionEvalInfo *ei, Value **args)
/* ------------------------------------------------------------------------- */
static char *help_d = {
static const char *help_d = {
N_("@FUNCTION=NT_D\n"
"@SYNTAX=NT_D(n)\n"
"@DESCRIPTION="
......@@ -302,7 +302,7 @@ gnumeric_d (FunctionEvalInfo *ei, Value **args)
/* ------------------------------------------------------------------------- */
static char *help_sigma = {
static const char *help_sigma = {
N_("@FUNCTION=NT_SIGMA\n"
"@SYNTAX=NT_SIGMA(n)\n"
"@DESCRIPTION="
......@@ -337,7 +337,7 @@ gnumeric_sigma (FunctionEvalInfo *ei, Value **args)
/* ------------------------------------------------------------------------- */
static char *help_ithprime = {
static const char *help_ithprime = {
N_("@FUNCTION=ITHPRIME\n"
"@SYNTAX=ITHPRIME(i)\n"
"@DESCRIPTION="
......@@ -365,7 +365,7 @@ gnumeric_ithprime (FunctionEvalInfo *ei, Value **args)
/* ------------------------------------------------------------------------- */
static char *help_isprime = {
static const char *help_isprime = {
N_("@FUNCTION=ISPRIME\n"
"@SYNTAX=ISPRIME(i)\n"
"@DESCRIPTION="
......@@ -391,7 +391,7 @@ gnumeric_isprime (FunctionEvalInfo *ei, Value **args)
/* ------------------------------------------------------------------------- */
static char *help_nt_pi = {
static const char *help_nt_pi = {
N_("@FUNCTION=NT_PI\n"
"@SYNTAX=NT_PI(n)\n"
"@DESCRIPTION="
......@@ -418,7 +418,7 @@ gnumeric_nt_pi (FunctionEvalInfo *ei, Value **args)
/* ------------------------------------------------------------------------- */
static char *help_bitor = {
static const char *help_bitor = {
N_("@FUNCTION=BITOR\n"
"@SYNTAX=BITOR(a,b)\n"
"@DESCRIPTION="
......@@ -437,7 +437,7 @@ func_bitor (FunctionEvalInfo *ei, Value *argv [])
/* ------------------------------------------------------------------------- */
static char *help_bitxor = {
static const char *help_bitxor = {
N_("@FUNCTION=BITXOR\n"
"@SYNTAX=BITXOR(a,b)\n"
"@DESCRIPTION="
......@@ -456,7 +456,7 @@ func_bitxor (FunctionEvalInfo *ei, Value *argv [])
/* ------------------------------------------------------------------------- */
static char *help_bitand = {
static const char *help_bitand = {
N_("@FUNCTION=BITAND\n"
"@SYNTAX=BITAND(a,b)\n"
"@DESCRIPTION="
......@@ -476,7 +476,7 @@ func_bitand (FunctionEvalInfo *ei, Value *argv [])
/* ------------------------------------------------------------------------- */
static char *help_bitlshift = {
static const char *help_bitlshift = {
N_("@FUNCTION=BITLSHIFT\n"
"@SYNTAX=BITLSHIFT(x,n)\n"
"@DESCRIPTION="
......@@ -503,7 +503,7 @@ func_bitlshift (FunctionEvalInfo *ei, Value *argv [])
/* ------------------------------------------------------------------------- */
static char *help_bitrshift = {
static const char *help_bitrshift = {
N_("@FUNCTION=BITRSHIFT\n"
"@SYNTAX=BITRSHIFT(x,n)\n"
"@DESCRIPTION="
......
......@@ -260,7 +260,7 @@ oleo_deal_with_cell (char *str, Sheet *sheet, MStyle *style, int *ccol, int *cro
g_warning ("oleo: Don't know how to deal with C; '%c'\n",
*ptr);
#endif
ptr = ""; /* I wish C had multilevel break */
ptr = (char *)""; /* I wish C had multilevel break */
break;
}
......
......@@ -288,7 +288,9 @@ static void
function_def_get_full_info_if_needed (FunctionDefinition *fn_def)
{
if (fn_def->fn_type == FUNCTION_NAMEONLY) {
gchar *args, *arg_names, **help;
const gchar *args;
const gchar *arg_names;
const gchar **help;
FunctionArgs *fn_args;
FunctionNodes *fn_nodes;
gboolean success;
......
......@@ -67,9 +67,9 @@ void func_unref (FunctionDefinition *fn_def);
gint func_get_ref_count (FunctionDefinition *fn_def);
typedef gboolean (*FunctionGetFullInfoCallback) (FunctionDefinition *fn_def,
gchar **args_ptr,
gchar **arg_names_ptr,
gchar ***help_ptr,
const gchar **args_ptr,
const gchar **arg_names_ptr,
const gchar ***help_ptr,
FunctionArgs **fn_args_ptr,
FunctionNodes **fn_nodes_ptr);
......
......@@ -526,10 +526,10 @@ typedef struct {
static gboolean
gnumeric_plugin_loader_module_func_get_full_function_info (PluginService *service,
gchar const *fn_name,
gchar **args_ptr,
gchar **arg_names_ptr,
gchar ***help_ptr,
const gchar *fn_name,
const gchar **args_ptr,
const gchar **arg_names_ptr,
const gchar ***help_ptr,
FunctionArgs **fn_args_ptr,
FunctionNodes **fn_nodes_ptr)
{
......
......@@ -30,10 +30,10 @@ typedef struct {
#define GNUMERIC_MODULE_PLUGIN_FILE_STRUCT_INITIALIZER {GNUMERIC_MODULE_PLUGIN_MAGIC_NUMBER, GNUMERIC_VERSION}
typedef struct {
gchar const *fn_name;
gchar *args;
gchar *arg_names;
gchar **help;
const gchar *fn_name;
const gchar *args;
const gchar *arg_names;
const gchar **help;
FunctionArgs *fn_args;
FunctionNodes *fn_nodes;
} ModulePluginFunctionInfo;
......
......@@ -903,9 +903,9 @@ plugin_service_function_group_free (PluginService *service)
static gboolean
plugin_service_function_group_get_full_info_callback (FunctionDefinition *fn_def,
gchar **args_ptr,
gchar **arg_names_ptr,
gchar ***help_ptr,
const gchar **args_ptr,
const gchar **arg_names_ptr,
const gchar ***help_ptr,
FunctionArgs **fn_args_ptr,
FunctionNodes **fn_nodes_ptr)
{
......@@ -919,8 +919,9 @@ plugin_service_function_group_get_full_info_callback (FunctionDefinition *fn_def
service_function_group = &service->t.function_group;
plugin_service_load (service, &error);
if (error == NULL) {
gchar *args, *arg_names;
gchar **help;
const gchar *args;
const gchar *arg_names;
const gchar **help;
FunctionArgs *fn_args;
FunctionNodes *fn_nodes;
......
......@@ -72,9 +72,10 @@ struct _PluginServiceFunctionGroup {
FunctionCategory *category;
/* fields available after loading */
gboolean (*plugin_func_get_full_function_info) (PluginService *service,
gchar const *fn_name, gchar **args_ptr,
gchar **arg_names_ptr,
gchar ***help_ptr,
const gchar *fn_name,
const gchar **args_ptr,
const gchar **arg_names_ptr,
const gchar ***help_ptr,
FunctionArgs **fn_args_ptr,
FunctionNodes **fn_nodes_ptr);
};
......
......@@ -575,7 +575,7 @@ render_time (GString *target, HFRenderInfo *info, const char *args)
}
static const struct {
char *name;
const char *name;
void (*render)(GString *target, HFRenderInfo *info, const char *args);
} render_ops [] = {
{ N_("tab"), render_tab },
......
......@@ -377,9 +377,10 @@ callback (int iter, gnum_float *x, gnum_float bv, gnum_float cx, int n, void *da
int i;
printf ("Iteration=%3d ", iter + 1);
printf ("bv=%9.4f cx=%9.4f gap=%9.4f\n", bv, cx, fabs (bv-cx));
printf ("bv=%9.4" GNUM_FORMAT_f " cx=%9.4" GNUM_FORMAT_f " gap=%9.4" GNUM_FORMAT_f "\n",
bv, cx, fabs (bv - cx));
for (i = 0; i < n; i++)
printf ("%8.4f ", x[i]);
printf ("%8.4" GNUM_FORMAT_f " ", x[i]);
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