projects
/
pspp-builds.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e40c90b
)
More constness/namespace policing
author
John Darrington
<john@darrington.wattle.id.au>
Sun, 22 Oct 2006 11:07:52 +0000
(11:07 +0000)
committer
John Darrington
<john@darrington.wattle.id.au>
Sun, 22 Oct 2006 11:07:52 +0000
(11:07 +0000)
19 files changed:
src/language/control/control-stack.c
patch
|
blob
|
history
src/language/control/control-stack.h
patch
|
blob
|
history
src/language/control/do-if.c
patch
|
blob
|
history
src/language/control/loop.c
patch
|
blob
|
history
src/language/data-io/matrix-data.c
patch
|
blob
|
history
src/language/stats/correlations.q
patch
|
blob
|
history
src/language/stats/crosstabs.q
patch
|
blob
|
history
src/language/stats/frequencies.q
patch
|
blob
|
history
src/language/stats/oneway.q
patch
|
blob
|
history
src/language/stats/rank.q
patch
|
blob
|
history
src/output/ascii.c
patch
|
blob
|
history
src/output/html.c
patch
|
blob
|
history
src/output/htmlP.h
patch
|
blob
|
history
src/output/manager.c
patch
|
blob
|
history
src/output/manager.h
patch
|
blob
|
history
src/output/output.c
patch
|
blob
|
history
src/output/output.h
patch
|
blob
|
history
src/output/postscript.c
patch
|
blob
|
history
src/output/table.c
patch
|
blob
|
history
diff --git
a/src/language/control/control-stack.c
b/src/language/control/control-stack.c
index 193b52b0837c3457dc5057571e6d548229ea1fd5..cac206dd1e7fafc7337293929e020185855bbf22 100644
(file)
--- a/
src/language/control/control-stack.c
+++ b/
src/language/control/control-stack.c
@@
-11,7
+11,7
@@
struct ctl_struct
{
struct ctl_struct
{
- struct ctl_class *class; /* Class of control structure. */
+
const
struct ctl_class *class; /* Class of control structure. */
struct ctl_struct *down; /* Points toward the bottom of ctl_stack. */
void *private; /* Private data. */
};
struct ctl_struct *down; /* Points toward the bottom of ctl_stack. */
void *private; /* Private data. */
};
@@
-31,7
+31,7
@@
ctl_stack_clear (void)
}
void
}
void
-ctl_stack_push (struct ctl_class *class, void *private)
+ctl_stack_push (
const
struct ctl_class *class, void *private)
{
struct ctl_struct *ctl;
{
struct ctl_struct *ctl;
@@
-44,7
+44,7
@@
ctl_stack_push (struct ctl_class *class, void *private)
}
void *
}
void *
-ctl_stack_top (struct ctl_class *class)
+ctl_stack_top (
const
struct ctl_class *class)
{
struct ctl_struct *top = ctl_stack;
if (top != NULL && top->class == class)
{
struct ctl_struct *top = ctl_stack;
if (top != NULL && top->class == class)
@@
-61,7
+61,7
@@
ctl_stack_top (struct ctl_class *class)
}
void *
}
void *
-ctl_stack_search (struct ctl_class *class)
+ctl_stack_search (
const
struct ctl_class *class)
{
struct ctl_struct *ctl;
{
struct ctl_struct *ctl;
diff --git
a/src/language/control/control-stack.h
b/src/language/control/control-stack.h
index 87ef4bee3230cca89b9ea0a728b9bd984d8e0cf4..ad373ea4cf491b0ee1fd886fe9b7074febfc2d85 100644
(file)
--- a/
src/language/control/control-stack.h
+++ b/
src/language/control/control-stack.h
@@
-30,9
+30,9
@@
struct ctl_class
};
void ctl_stack_clear (void);
};
void ctl_stack_clear (void);
-void ctl_stack_push (struct ctl_class *, void *private);
-void *ctl_stack_top (struct ctl_class *);
-void *ctl_stack_search (struct ctl_class *);
+void ctl_stack_push (
const
struct ctl_class *, void *private);
+void *ctl_stack_top (
const
struct ctl_class *);
+void *ctl_stack_search (
const
struct ctl_class *);
void ctl_stack_pop (void *);
bool ctl_stack_is_empty (void);
void ctl_stack_pop (void *);
bool ctl_stack_is_empty (void);
diff --git
a/src/language/control/do-if.c
b/src/language/control/do-if.c
index b39f67e500459b8ccd84d1b3fc0b70d45a71436b..4837366643f271fe0961f09f710fa8a468013a16 100644
(file)
--- a/
src/language/control/do-if.c
+++ b/
src/language/control/do-if.c
@@
-80,7
+80,7
@@
struct do_if_trns
int past_END_IF_index; /* Transformation just past last clause. */
};
int past_END_IF_index; /* Transformation just past last clause. */
};
-static struct ctl_class do_if_class;
+static
const
struct ctl_class do_if_class;
static int parse_clause (struct do_if_trns *);
static void add_clause (struct do_if_trns *,
static int parse_clause (struct do_if_trns *);
static void add_clause (struct do_if_trns *,
@@
-285,7
+285,7
@@
break_trns_proc (void *do_if_, struct ccase *c UNUSED, casenum_t case_num UNUSED
}
/* DO IF control structure class definition. */
}
/* DO IF control structure class definition. */
-static struct ctl_class do_if_class =
+static
const
struct ctl_class do_if_class =
{
"DO IF",
"END IF",
{
"DO IF",
"END IF",
diff --git
a/src/language/control/loop.c
b/src/language/control/loop.c
index 1bb044e6ecf4d499b17e171dbff26c108b1389f6..ce80f665ab17e397c6ef23d33149ea75f1fc9325 100644
(file)
--- a/
src/language/control/loop.c
+++ b/
src/language/control/loop.c
@@
-79,7
+79,7
@@
struct loop_trns
int past_END_LOOP_index; /* Just past END LOOP transformation. */
};
int past_END_LOOP_index; /* Just past END LOOP transformation. */
};
-static struct ctl_class loop_class;
+static
const
struct ctl_class loop_class;
static trns_finalize_func loop_trns_finalize;
static trns_proc_func loop_trns_proc, end_loop_trns_proc, break_trns_proc;
static trns_finalize_func loop_trns_finalize;
static trns_proc_func loop_trns_proc, end_loop_trns_proc, break_trns_proc;
@@
-371,7
+371,7
@@
break_trns_proc (void *loop_, struct ccase *c UNUSED, casenum_t case_num UNUSED)
}
/* LOOP control structure class definition. */
}
/* LOOP control structure class definition. */
-static struct ctl_class loop_class =
+static
const
struct ctl_class loop_class =
{
"LOOP",
"END LOOP",
{
"LOOP",
"END LOOP",
diff --git
a/src/language/data-io/matrix-data.c
b/src/language/data-io/matrix-data.c
index 99664fc6e66a2631cc6b8a60d1ad126ccf86726d..5c8e011b26d683a1bdda1d38d5400c5eff01ab81 100644
(file)
--- a/
src/language/data-io/matrix-data.c
+++ b/
src/language/data-io/matrix-data.c
@@
-115,7
+115,7
@@
static const int content_type[PROX + 1] =
};
/* Name of each content type. */
};
/* Name of each content type. */
-static const char *content_names[PROX + 1] =
+static const char *con
st con
tent_names[PROX + 1] =
{
"N", "N", "N_MATRIX", "MEAN", "STDDEV", "COUNT", "MSE",
"DFE", "MAT", "COV", "CORR", "PROX",
{
"N", "N", "N_MATRIX", "MEAN", "STDDEV", "COUNT", "MSE",
"DFE", "MAT", "COV", "CORR", "PROX",
diff --git
a/src/language/stats/correlations.q
b/src/language/stats/correlations.q
index b1126470f6a17f63d72940199d15233f1d73dafd..e3a181f0b7bba1f9f2e6c4ff9e5938725308b388 100644
(file)
--- a/
src/language/stats/correlations.q
+++ b/
src/language/stats/correlations.q
@@
-41,9
+41,9
@@
struct cor_set
size_t nv1, nv2;
};
size_t nv1, nv2;
};
-struct cor_set *cor_list, *cor_last;
+st
atic st
ruct cor_set *cor_list, *cor_last;
-struct file_handle *matrix_file;
+st
atic st
ruct file_handle *matrix_file;
static void free_correlations_state (void);
static int internal_cmd_correlations (void);
static void free_correlations_state (void);
static int internal_cmd_correlations (void);
diff --git
a/src/language/stats/crosstabs.q
b/src/language/stats/crosstabs.q
index 405460de4a4b1c5a637fe9e7eea409b30e6da514..e7466d7239e50256b0627c64af16bf1d7f1e6831 100644
(file)
--- a/
src/language/stats/crosstabs.q
+++ b/
src/language/stats/crosstabs.q
@@
-950,7
+950,7
@@
static int n_rows;
static int ns_cols, ns_rows;
/* Crosstabulation. */
static int ns_cols, ns_rows;
/* Crosstabulation. */
-static struct crosstab *x;
+static
const
struct crosstab *x;
/* Number of variables from the crosstabulation to consider. This is
either x->nvar, if pivoting is on, or 2, if pivoting is off. */
/* Number of variables from the crosstabulation to consider. This is
either x->nvar, if pivoting is on, or 2, if pivoting is off. */
diff --git
a/src/language/stats/frequencies.q
b/src/language/stats/frequencies.q
index 24ab054bed517de828ed85660801e4710792f6b1..d78f37a7459ec726fc14d2312d4d767abd82e2dd 100644
(file)
--- a/
src/language/stats/frequencies.q
+++ b/
src/language/stats/frequencies.q
@@
-118,7
+118,7
@@
struct frq_info
};
/* Table of statistics, indexed by dsc_*. */
};
/* Table of statistics, indexed by dsc_*. */
-static struct frq_info st_name[frq_n_stats + 1] =
+static
const
struct frq_info st_name[frq_n_stats + 1] =
{
{FRQ_ST_MEAN, N_("Mean")},
{FRQ_ST_SEMEAN, N_("S.E. Mean")},
{
{FRQ_ST_MEAN, N_("Mean")},
{FRQ_ST_SEMEAN, N_("S.E. Mean")},
diff --git
a/src/language/stats/oneway.q
b/src/language/stats/oneway.q
index 0b75608a761b482286eb3df470d233477e576da6..9b5a36bc415d29af40ce66778d5157c564550636 100644
(file)
--- a/
src/language/stats/oneway.q
+++ b/
src/language/stats/oneway.q
@@
-88,7
+88,7
@@
static struct hsh_table *global_group_hash ;
/* The number of distinct values of the independent variable, when all
missing values are disregarded */
/* The number of distinct values of the independent variable, when all
missing values are disregarded */
-static int ostensible_number_of_groups
=
-1;
+static int ostensible_number_of_groups
=
-1;
/* Function to use for testing for missing values */
/* Function to use for testing for missing values */
diff --git
a/src/language/stats/rank.q
b/src/language/stats/rank.q
index 9441a19bd572d082f0c6566edcc2d35aaa30f624..5f58f8c65c07af06cb5e38cb618eedef839a687c 100644
(file)
--- a/
src/language/stats/rank.q
+++ b/
src/language/stats/rank.q
@@
-117,7
+117,7
@@
static const struct fmt_spec dest_format[n_RANK_FUNCS] = {
{FMT_F, 8, 4} /* savage */
};
{FMT_F, 8, 4} /* savage */
};
-static const char *function_name[n_RANK_FUNCS] = {
+static const char *
const
function_name[n_RANK_FUNCS] = {
"RANK",
"NORMAL",
"PERCENT",
"RANK",
"NORMAL",
"PERCENT",
@@
-128,7
+128,7
@@
static const char *function_name[n_RANK_FUNCS] = {
"SAVAGE"
};
"SAVAGE"
};
-static rank_function_t rank_func[n_RANK_FUNCS] = {
+static
const
rank_function_t rank_func[n_RANK_FUNCS] = {
rank_rank,
rank_normal,
rank_percent,
rank_rank,
rank_normal,
rank_percent,
diff --git
a/src/output/ascii.c
b/src/output/ascii.c
index 3dba9775685a89adb5be924da8ea64b849f0d88d..12c58a401640c8777836e83b059c84dd41528050 100644
(file)
--- a/
src/output/ascii.c
+++ b/
src/output/ascii.c
@@
-247,7
+247,7
@@
enum
output_file_arg
};
output_file_arg
};
-static struct outp_option option_tab[] =
+static
const
struct outp_option option_tab[] =
{
{"headers", boolean_arg, 0},
{"paginate", boolean_arg, 1},
{
{"headers", boolean_arg, 0},
{"paginate", boolean_arg, 1},
@@
-734,7
+734,7
@@
ascii_chart_finalise (struct outp_driver *d UNUSED, struct chart *ch UNUSED)
}
}
-struct outp_class ascii_class =
+
const
struct outp_class ascii_class =
{
"ascii",
0,
{
"ascii",
0,
diff --git
a/src/output/html.c
b/src/output/html.c
index 72ca57d9227a5757ed18c06893f840afa72762af..a9d524b78f968898c652c40b7febc44720d1dc99 100644
(file)
--- a/
src/output/html.c
+++ b/
src/output/html.c
@@
-149,7
+149,7
@@
enum
};
/* All the options that the HTML driver supports. */
};
/* All the options that the HTML driver supports. */
-static struct outp_option option_tab[] =
+static
const
struct outp_option option_tab[] =
{
{"output-file", string_arg, 0},
{"chart-files", string_arg, 1},
{
{"output-file", string_arg, 0},
{"chart-files", string_arg, 1},
@@
-401,7
+401,7
@@
html_finalise_chart(struct outp_driver *d UNUSED, struct chart *ch)
/* HTML driver class. */
/* HTML driver class. */
-struct outp_class html_class =
+
const
struct outp_class html_class =
{
"html",
1,
{
"html",
1,
diff --git
a/src/output/htmlP.h
b/src/output/htmlP.h
index f1bf3d34bff4443bfaaf88c693160d2ca59b0bed..fa108ad238f33c5591d6bb2d77225ea85a27b194 100644
(file)
--- a/
src/output/htmlP.h
+++ b/
src/output/htmlP.h
@@
-32,7
+32,7
@@
struct html_driver_ext
size_t chart_cnt;
};
size_t chart_cnt;
};
-extern struct outp_class html_class;
+extern
const
struct outp_class html_class;
struct outp_driver;
void html_put_cell_contents (struct outp_driver *this,
struct outp_driver;
void html_put_cell_contents (struct outp_driver *this,
diff --git
a/src/output/manager.c
b/src/output/manager.c
index 468b2c23e5d93b8c1945a2e71bc5458108249c84..0d82867ae0f08b83f9448e570de3673d0933ab67 100644
(file)
--- a/
src/output/manager.c
+++ b/
src/output/manager.c
@@
-62,10
+62,10
@@
som_blank_line (void)
}
\f
/* Driver. */
}
\f
/* Driver. */
-static struct outp_driver *d
=
0;
+static struct outp_driver *d
=
0;
/* Table. */
/* Table. */
-static struct som_entity *t
=
0;
+static struct som_entity *t
=
0;
/* Flags. */
static unsigned flags;
/* Flags. */
static unsigned flags;
diff --git
a/src/output/manager.h
b/src/output/manager.h
index 1568dca30613af29ec5a198a5a3abcc55e90e835..7c0a0dc8161af674ceee4557c8ffef9ea5092312 100644
(file)
--- a/
src/output/manager.h
+++ b/
src/output/manager.h
@@
-47,7
+47,7
@@
enum som_type
/* Entity (Table or Chart) . */
struct som_entity
{
/* Entity (Table or Chart) . */
struct som_entity
{
-
struct som_table_class *class;
/* Table class. */
+
const struct som_table_class *class;
/* Table class. */
enum som_type type; /* Table or Chart */
void *ext; /* Owned by */
};
enum som_type type; /* Table or Chart */
void *ext; /* Owned by */
};
diff --git
a/src/output/output.c
b/src/output/output.c
index a63f1171a446e0a42fb5c1f691a8adada0078f68..91df8f022eb84cef6033963079dcadad3d326d3f 100644
(file)
--- a/
src/output/output.c
+++ b/
src/output/output.c
@@
-70,12
+70,12
@@
static struct outp_names *outp_configure_vec;
/* A list of driver classes. */
struct outp_driver_class_list
{
/* A list of driver classes. */
struct outp_driver_class_list
{
- struct outp_class *class;
+
const
struct outp_class *class;
struct outp_driver_class_list *next;
};
struct outp_driver_class_list *next;
};
-struct outp_driver_class_list *outp_class_list;
-struct outp_driver *outp_driver_list;
+st
atic st
ruct outp_driver_class_list *outp_class_list;
+st
atic st
ruct outp_driver *outp_driver_list;
char *outp_title;
char *outp_subtitle;
char *outp_title;
char *outp_subtitle;
@@
-91,7
+91,7
@@
static void configure_driver (const struct substring, const struct substring,
/* Add a class to the class list. */
static void
/* Add a class to the class list. */
static void
-add_class (struct outp_class *class)
+add_class (
const
struct outp_class *class)
{
struct outp_driver_class_list *new_list = xmalloc (sizeof *new_list);
{
struct outp_driver_class_list *new_list = xmalloc (sizeof *new_list);
@@
-227,7
+227,6
@@
outp_init (void)
{
extern struct outp_class ascii_class;
extern struct outp_class postscript_class;
{
extern struct outp_class ascii_class;
extern struct outp_class postscript_class;
- extern struct outp_class html_class;
char def[] = "default";
char def[] = "default";
@@
-797,7
+796,7
@@
destroy_driver (struct outp_driver *d)
code and stores subcategory in *SUBCAT on success. Returns -1
on failure. */
int
code and stores subcategory in *SUBCAT on success. Returns -1
on failure. */
int
-outp_match_keyword (const char *s, struct outp_option *tab, int *subcat)
+outp_match_keyword (const char *s,
const
struct outp_option *tab, int *subcat)
{
for (; tab->keyword != NULL; tab++)
if (!strcmp (s, tab->keyword))
{
for (; tab->keyword != NULL; tab++)
if (!strcmp (s, tab->keyword))
diff --git
a/src/output/output.h
b/src/output/output.h
index 6782a11e66fe93a552ee85b27989e4aa1f4de821..5f986aa01f8a13f0a5e9909d64ef07f4ea8578cc 100644
(file)
--- a/
src/output/output.h
+++ b/
src/output/output.h
@@
-103,7
+103,7
@@
enum
struct outp_driver
{
struct outp_driver *next, *prev; /* List of drivers. */
struct outp_driver
{
struct outp_driver *next, *prev; /* List of drivers. */
-
struct outp_class *class;
/* Driver class. */
+
const struct outp_class *class;
/* Driver class. */
char *name; /* Name of this driver. */
bool page_open; /* 1=page is open, 0=page is closed. */
int device; /* Zero or more of OUTP_DEV_*. */
char *name; /* Name of this driver. */
bool page_open; /* 1=page is open, 0=page is closed. */
int device; /* Zero or more of OUTP_DEV_*. */
@@
-128,8
+128,6
@@
struct outp_option
int subcat; /* Subcategory. */
};
int subcat; /* Subcategory. */
};
-/* List of configured output drivers. */
-extern struct outp_driver *outp_driver_list;
/* Title, subtitle. */
extern char *outp_title;
/* Title, subtitle. */
extern char *outp_title;
@@
-152,7
+150,7
@@
bool outp_parse_options (struct substring options,
bool (*) (struct outp_driver *, const char *key,
const struct string *value),
struct outp_driver *);
bool (*) (struct outp_driver *, const char *key,
const struct string *value),
struct outp_driver *);
-int outp_match_keyword (const char *, struct outp_option *, int *);
+int outp_match_keyword (const char *,
const
struct outp_option *, int *);
int outp_evaluate_dimension (char *, char **);
bool outp_get_paper_size (char *, int *h, int *v);
int outp_evaluate_dimension (char *, char **);
bool outp_get_paper_size (char *, int *h, int *v);
diff --git
a/src/output/postscript.c
b/src/output/postscript.c
index b658cdf3d2f669693a5036b96791831211dc7b91..614fb5055bc3104a70d9e289536bac1980be0197 100644
(file)
--- a/
src/output/postscript.c
+++ b/
src/output/postscript.c
@@
-270,7
+270,7
@@
enum
};
/* All the options that the PostScript driver supports. */
};
/* All the options that the PostScript driver supports. */
-static struct outp_option option_tab[] =
+static
const
struct outp_option option_tab[] =
{
{"output-file", output_file_arg,0},
{"paper-size", paper_size_arg, 0},
{
{"output-file", output_file_arg,0},
{"paper-size", paper_size_arg, 0},
@@
-1426,7
+1426,7
@@
reencode_font (struct outp_driver *this, struct font *font)
}
/* PostScript driver class. */
}
/* PostScript driver class. */
-struct outp_class postscript_class =
+
const
struct outp_class postscript_class =
{
"postscript",
0,
{
"postscript",
0,
diff --git
a/src/output/table.c
b/src/output/table.c
index 461a2d843a57312e5c0df5765ff41e0d341c99ab..be2c2136f945f0262c0295527856855147c6e613 100644
(file)
--- a/
src/output/table.c
+++ b/
src/output/table.c
@@
-38,7
+38,7
@@
#include "gettext.h"
#define _(msgid) gettext (msgid)
\f
#include "gettext.h"
#define _(msgid) gettext (msgid)
\f
-struct som_table_class tab_table_class;
+
const
struct som_table_class tab_table_class;
static char *command_name;
/* Returns the font to use for a cell with the given OPTIONS. */
static char *command_name;
/* Returns the font to use for a cell with the given OPTIONS. */
@@
-1220,7
+1220,7
@@
tabi_render (int c0, int r0, int c1, int r1)
y = render_rows (y, c0, c1, (t->nr - t->b) * 2, t->nr * 2 + 1);
}
y = render_rows (y, c0, c1, (t->nr - t->b) * 2, t->nr * 2 + 1);
}
-struct som_table_class tab_table_class =
+
const
struct som_table_class tab_table_class =
{
tabi_table,
tabi_driver,
{
tabi_table,
tabi_driver,