projects
/
pspp-builds.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
9685c58
)
Constness and global namespace patrol.
author
John Darrington
<john@darrington.wattle.id.au>
Fri, 20 Oct 2006 11:32:56 +0000
(11:32 +0000)
committer
John Darrington
<john@darrington.wattle.id.au>
Fri, 20 Oct 2006 11:32:56 +0000
(11:32 +0000)
18 files changed:
po/de.po
patch
|
blob
|
history
po/pspp.pot
patch
|
blob
|
history
src/data/data-in.c
patch
|
blob
|
history
src/data/data-out.c
patch
|
blob
|
history
src/data/format.c
patch
|
blob
|
history
src/data/format.h
patch
|
blob
|
history
src/data/identifier.h
patch
|
blob
|
history
src/language/control/control-stack.c
patch
|
blob
|
history
src/language/data-io/print-space.c
patch
|
blob
|
history
src/language/expressions/optimize.c
patch
|
blob
|
history
src/language/expressions/parse.c
patch
|
blob
|
history
src/language/expressions/private.h
patch
|
blob
|
history
src/language/lexer/lexer.c
patch
|
blob
|
history
src/language/stats/frequencies.q
patch
|
blob
|
history
src/language/stats/means.q
patch
|
blob
|
history
src/language/stats/regression.q
patch
|
blob
|
history
src/output/postscript.c
patch
|
blob
|
history
src/output/table.c
patch
|
blob
|
history
diff --git
a/po/de.po
b/po/de.po
index aecf07eb511de631acd4c3403de18dc6942fce4a..df48c959027d30303059ad140bdc7f2564837658 100644
(file)
--- a/
po/de.po
+++ b/
po/de.po
@@
-10,7
+10,7
@@
msgid ""
msgstr ""
"Project-Id-Version: PSPP 0.4.2\n"
"Report-Msgid-Bugs-To: pspp-dev@gnu.org\n"
msgstr ""
"Project-Id-Version: PSPP 0.4.2\n"
"Report-Msgid-Bugs-To: pspp-dev@gnu.org\n"
-"POT-Creation-Date: 2006-10-
19 16:3
1+0800\n"
+"POT-Creation-Date: 2006-10-
20 10:2
1+0800\n"
"PO-Revision-Date: 2006-05-26 17:49+0800\n"
"Last-Translator: John Darrington <john@darrington.wattle.id.au>\n"
"Language-Team: German <pspp-dev@gnu.org>\n"
"PO-Revision-Date: 2006-05-26 17:49+0800\n"
"Last-Translator: John Darrington <john@darrington.wattle.id.au>\n"
"Language-Team: German <pspp-dev@gnu.org>\n"
diff --git
a/po/pspp.pot
b/po/pspp.pot
index ebefd7c0ca314d4c36e40512c30c793dea7b6aeb..039670c62f7439e494b1852017a7c71ae158c595 100644
(file)
--- a/
po/pspp.pot
+++ b/
po/pspp.pot
@@
-8,7
+8,7
@@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: pspp-dev@gnu.org\n"
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: pspp-dev@gnu.org\n"
-"POT-Creation-Date: 2006-10-
19 16:3
1+0800\n"
+"POT-Creation-Date: 2006-10-
20 10:2
1+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
diff --git
a/src/data/data-in.c
b/src/data/data-in.c
index 4ee0a4f2d216d76a9192fb5b2400d237f9860e04..8a62d8fc76a0bfec26e283e76a09d43dca2d9a03 100644
(file)
--- a/
src/data/data-in.c
+++ b/
src/data/data-in.c
@@
-1394,7
+1394,8
@@
data_in (struct data_in *i)
}
{
}
{
- static bool (*const handlers[FMT_NUMBER_OF_FORMATS])(struct data_in *) =
+ typedef bool (*handler_t) (struct data_in *);
+ static const handler_t handlers[FMT_NUMBER_OF_FORMATS] =
{
parse_numeric, parse_N, parse_numeric, parse_numeric,
parse_numeric, parse_numeric, parse_numeric,
{
parse_numeric, parse_N, parse_numeric, parse_numeric,
parse_numeric, parse_numeric, parse_numeric,
@@
-1407,7
+1408,7
@@
data_in (struct data_in *i)
parse_WKDAY, parse_MONTH,
};
parse_WKDAY, parse_MONTH,
};
-
bool (*handler)(struct data_in *)
;
+
handler_t handler
;
bool success;
handler = handlers[i->format.type];
bool success;
handler = handlers[i->format.type];
diff --git
a/src/data/data-out.c
b/src/data/data-out.c
index 0585dc2bb24e98d4f68eeccc15c83cbc650e5fca..6106fc3011f420f7080252db49c2c14f4c03ad0f 100644
(file)
--- a/
src/data/data-out.c
+++ b/
src/data/data-out.c
@@
-348,7
+348,7
@@
convert_F_plus (char *dst, const struct fmt_spec *fp, double number)
static int
convert_Z (char *dst, const struct fmt_spec *fp, double number)
{
static int
convert_Z (char *dst, const struct fmt_spec *fp, double number)
{
- static
int warned = 0
;
+ static
bool warned = false
;
if (!warned)
{
if (!warned)
{
diff --git
a/src/data/format.c
b/src/data/format.c
index 01a8d31742be9332a4d653ab786815da6daac82f..022b5b180402b389603ed0fbf3b9dbf4580c1ae9 100644
(file)
--- a/
src/data/format.c
+++ b/
src/data/format.c
@@
-35,7
+35,7
@@
#define DEFFMT(LABEL, NAME, N_ARGS, IMIN_W, IMAX_W, OMIN_W, OMAX_W, CAT, \
OUTPUT, SPSS_FMT) \
{NAME, N_ARGS, IMIN_W, IMAX_W, OMIN_W, OMAX_W, CAT, OUTPUT, SPSS_FMT},
#define DEFFMT(LABEL, NAME, N_ARGS, IMIN_W, IMAX_W, OMIN_W, OMAX_W, CAT, \
OUTPUT, SPSS_FMT) \
{NAME, N_ARGS, IMIN_W, IMAX_W, OMIN_W, OMAX_W, CAT, OUTPUT, SPSS_FMT},
-struct fmt_desc formats[FMT_NUMBER_OF_FORMATS + 1] =
+
const
struct fmt_desc formats[FMT_NUMBER_OF_FORMATS + 1] =
{
#include "format.def"
{"", -1, -1, -1, -1, -1, 0000, -1, -1},
{
#include "format.def"
{"", -1, -1, -1, -1, -1, 0000, -1, -1},
@@
-85,7
+85,7
@@
fmt_to_string (const struct fmt_spec *f)
static bool
check_common_specifier (const struct fmt_spec *spec, bool emit_error)
{
static bool
check_common_specifier (const struct fmt_spec *spec, bool emit_error)
{
- struct fmt_desc *f ;
+
const
struct fmt_desc *f ;
char *str;
assert (spec->type < FMT_NUMBER_OF_FORMATS);
char *str;
assert (spec->type < FMT_NUMBER_OF_FORMATS);
@@
-125,7
+125,7
@@
check_common_specifier (const struct fmt_spec *spec, bool emit_error)
int
check_input_specifier (const struct fmt_spec *spec, int emit_error)
{
int
check_input_specifier (const struct fmt_spec *spec, int emit_error)
{
- struct fmt_desc *f;
+
const
struct fmt_desc *f;
char *str ;
if (!check_common_specifier (spec, emit_error))
char *str ;
if (!check_common_specifier (spec, emit_error))
@@
-165,7
+165,7
@@
check_input_specifier (const struct fmt_spec *spec, int emit_error)
int
check_output_specifier (const struct fmt_spec *spec, int emit_error)
{
int
check_output_specifier (const struct fmt_spec *spec, int emit_error)
{
- struct fmt_desc *f;
+
const
struct fmt_desc *f;
char *str ;
if (!check_common_specifier (spec, emit_error))
char *str ;
if (!check_common_specifier (spec, emit_error))
diff --git
a/src/data/format.h
b/src/data/format.h
index e9d5e5e3f5d8be9cc36e8bfc12377bf936c9ec15..b5e7130a5d325a423a22a9975d4547890d824f20 100644
(file)
--- a/
src/data/format.h
+++ b/
src/data/format.h
@@
-98,7
+98,7
@@
bool alignment_is_valid(enum alignment a);
/* Descriptions of all the display formats above. */
/* Descriptions of all the display formats above. */
-extern struct fmt_desc formats[];
+extern
const
struct fmt_desc formats[];
union value;
union value;
diff --git
a/src/data/identifier.h
b/src/data/identifier.h
index 7f4beb7478ab8d8979fd1ae0aa73c027f18eea92..53be9a7655048c7cabd12c15950bf3a6cd791f6b 100644
(file)
--- a/
src/data/identifier.h
+++ b/
src/data/identifier.h
@@
-68,4
+68,6
@@
bool lex_id_match_len (const char *keyword_string, size_t keyword_len,
bool lex_id_match (const char *keyword_string, const char *token_string);
int lex_id_to_token (const char *id, size_t len);
bool lex_id_match (const char *keyword_string, const char *token_string);
int lex_id_to_token (const char *id, size_t len);
+extern const char *keywords[T_N_KEYWORDS + 1] ;
+
#endif /* !lex_def_h */
#endif /* !lex_def_h */
diff --git
a/src/language/control/control-stack.c
b/src/language/control/control-stack.c
index 7263842933fe225da0a7625250b540cdb89b72aa..193b52b0837c3457dc5057571e6d548229ea1fd5 100644
(file)
--- a/
src/language/control/control-stack.c
+++ b/
src/language/control/control-stack.c
@@
-16,7
+16,7
@@
struct ctl_struct
void *private; /* Private data. */
};
void *private; /* Private data. */
};
-struct ctl_struct *ctl_stack;
+st
atic st
ruct ctl_struct *ctl_stack;
void
ctl_stack_clear (void)
void
ctl_stack_clear (void)
diff --git
a/src/language/data-io/print-space.c
b/src/language/data-io/print-space.c
index 86d94cbcdc0134451435e9d560d1ff1bf14a9bf7..4414bb16a6abae96a5505dd7bcfe414b05ff4514 100644
(file)
--- a/
src/language/data-io/print-space.c
+++ b/
src/language/data-io/print-space.c
@@
-41,8
+41,7
@@
struct print_space_trns
{
struct dfm_writer *writer; /* Output data file. */
struct expression *expr; /* Number of lines; NULL means 1. */
{
struct dfm_writer *writer; /* Output data file. */
struct expression *expr; /* Number of lines; NULL means 1. */
- }
-print_space_trns;
+ };
static trns_proc_func print_space_trns_proc;
static trns_free_func print_space_trns_free;
static trns_proc_func print_space_trns_proc;
static trns_free_func print_space_trns_free;
diff --git
a/src/language/expressions/optimize.c
b/src/language/expressions/optimize.c
index 154517927dee47bdecaa68fe93d4af926dd0227f..d80f4069b87a4cbfe1e7155f9ff3d4c8684a9848 100644
(file)
--- a/
src/language/expressions/optimize.c
+++ b/
src/language/expressions/optimize.c
@@
-45,7
+45,7
@@
expr_optimize (union any_node *node, struct expression *e)
{
int nonconst_cnt = 0; /* Number of nonconstant children. */
int sysmis_cnt = 0; /* Number of system-missing children. */
{
int nonconst_cnt = 0; /* Number of nonconstant children. */
int sysmis_cnt = 0; /* Number of system-missing children. */
- struct operation *op;
+
const
struct operation *op;
struct composite_node *c;
int i;
struct composite_node *c;
int i;
@@
-308,7
+308,7
@@
flatten_atom (union any_node *n, struct expression *e)
static void
flatten_composite (union any_node *n, struct expression *e)
{
static void
flatten_composite (union any_node *n, struct expression *e)
{
- struct operation *op = &operations[n->type];
+
const
struct operation *op = &operations[n->type];
size_t i;
for (i = 0; i < n->composite.arg_cnt; i++)
size_t i;
for (i = 0; i < n->composite.arg_cnt; i++)
diff --git
a/src/language/expressions/parse.c
b/src/language/expressions/parse.c
index 979e756acedfe83ea649e96098329c233aaec2cb..43339baa7a2b08eaff199f92430f876241cadd08 100644
(file)
--- a/
src/language/expressions/parse.c
+++ b/
src/language/expressions/parse.c
@@
-894,7
+894,7
@@
parse_vector_element (struct expression *e)
\f
/* Individual function parsing. */
\f
/* Individual function parsing. */
-struct operation operations[OP_first + OP_cnt] = {
+
const
struct operation operations[OP_first + OP_cnt] = {
#include "parse.inc"
};
#include "parse.inc"
};
@@
-953,7
+953,7
@@
lookup_function_helper (const char *name,
const struct operation **first,
const struct operation **last)
{
const struct operation **first,
const struct operation **last)
{
- struct operation *f;
+
const
struct operation *f;
for (f = operations + OP_function_first;
f <= operations + OP_function_last; f++)
for (f = operations + OP_function_first;
f <= operations + OP_function_last; f++)
@@
-1327,7
+1327,7
@@
expr_allocate_binary (struct expression *e, operation_type op,
static bool
is_valid_node (union any_node *n)
{
static bool
is_valid_node (union any_node *n)
{
- struct operation *op;
+
const
struct operation *op;
size_t i;
assert (n != NULL);
size_t i;
assert (n != NULL);
diff --git
a/src/language/expressions/private.h
b/src/language/expressions/private.h
index 3fa108d5a4bd93007772d47500ab76ce7a9beea5..a47c22166cc73606505f0685407a78403db49063 100644
(file)
--- a/
src/language/expressions/private.h
+++ b/
src/language/expressions/private.h
@@
-78,7
+78,7
@@
struct operation
int array_granularity;
};
int array_granularity;
};
-extern struct operation operations[];
+extern
const
struct operation operations[];
/* Tree structured expressions. */
/* Tree structured expressions. */
diff --git
a/src/language/lexer/lexer.c
b/src/language/lexer/lexer.c
index a8a6cffc1745a532ec38e045cf28448fbae85bc1..452eb7e7beee0ca91471022b42ecf3cd8c05d9ea 100644
(file)
--- a/
src/language/lexer/lexer.c
+++ b/
src/language/lexer/lexer.c
@@
-46,11
+46,6
@@
*/
\f
*/
\f
-/* Global variables. */
-
-extern const char *keywords[T_N_KEYWORDS + 1];
-
-
/* Current token. */
int token;
/* Current token. */
int token;
@@
-859,7
+854,7
@@
lex_token_name (int token)
return t;
}
return t;
}
-
return _("<ERROR>"
);
+
NOT_REACHED (
);
}
/* Returns an ASCII representation of the current token as a
}
/* Returns an ASCII representation of the current token as a
diff --git
a/src/language/stats/frequencies.q
b/src/language/stats/frequencies.q
index 211498fc872ede6654c14dba0a69c5d990c18d14..24ab054bed517de828ed85660801e4710792f6b1 100644
(file)
--- a/
src/language/stats/frequencies.q
+++ b/
src/language/stats/frequencies.q
@@
-1168,9
+1168,9
@@
dump_full (struct variable *v)
const char *s;
};
const char *s;
};
- struct init *p;
+
const
struct init *p;
- static struct init vec[] =
+ static
const
struct init vec[] =
{
{4, 0, N_("Valid")},
{5, 0, N_("Cum")},
{
{4, 0, N_("Valid")},
{5, 0, N_("Cum")},
diff --git
a/src/language/stats/means.q
b/src/language/stats/means.q
index a8739bc2f41ec3bf88b1c872ec6b069c38a41db1..bc927b4715ef7668b613dcac0565cf4587325826 100644
(file)
--- a/
src/language/stats/means.q
+++ b/
src/language/stats/means.q
@@
-52,13
+52,12
@@
/* (functions) */
/* TABLES: Variable lists for each dimension. */
/* (functions) */
/* TABLES: Variable lists for each dimension. */
-
int n_dim;
/* Number of dimensions. */
-s
ize_t *nv_dim;
/* Number of variables in each dimension. */
-st
ruct variable ***v_dim;
/* Variables in each dimension. */
+
static int n_dim;
/* Number of dimensions. */
+s
tatic size_t *nv_dim;
/* Number of variables in each dimension. */
+st
atic struct variable ***v_dim;
/* Variables in each dimension. */
/* VARIABLES: List of variables. */
/* VARIABLES: List of variables. */
-int n_var;
-struct variable **v_var;
+static struct variable **v_var;
/* Parses and executes the T-TEST procedure. */
int
/* Parses and executes the T-TEST procedure. */
int
diff --git
a/src/language/stats/regression.q
b/src/language/stats/regression.q
index 1690abc0c9d1f614a5ddad2e16438a868949fe5d..6f9dc6ccaaa1d63c980e0435790ba2509eab97bf 100644
(file)
--- a/
src/language/stats/regression.q
+++ b/
src/language/stats/regression.q
@@
-84,7
+84,7
@@
static struct cmd_regression cmd;
/* Linear regression models. */
static struct cmd_regression cmd;
/* Linear regression models. */
-pspp_linreg_cache **models = NULL;
+
static
pspp_linreg_cache **models = NULL;
/*
Transformations for saving predicted values
/*
Transformations for saving predicted values
@@
-110,12
+110,12
@@
static size_t n_variables;
File where the model will be saved if the EXPORT subcommand
is given.
*/
File where the model will be saved if the EXPORT subcommand
is given.
*/
-struct file_handle *model_file;
+st
atic st
ruct file_handle *model_file;
/*
Return value for the procedure.
*/
/*
Return value for the procedure.
*/
-int pspp_reg_rc = CMD_SUCCESS;
+
static
int pspp_reg_rc = CMD_SUCCESS;
static bool run_regression (const struct ccase *,
const struct casefile *, void *);
static bool run_regression (const struct ccase *,
const struct casefile *, void *);
diff --git
a/src/output/postscript.c
b/src/output/postscript.c
index bd7a088a07e3d14a7e473072dfbdafd609e9dd1a..b658cdf3d2f669693a5036b96791831211dc7b91 100644
(file)
--- a/
src/output/postscript.c
+++ b/
src/output/postscript.c
@@
-109,8
+109,7
@@
struct ps_driver_ext
struct font *fonts[OUTP_FONT_CNT];
int last_font; /* Index of last font set with setfont. */
struct font *fonts[OUTP_FONT_CNT];
int last_font; /* Index of last font set with setfont. */
- }
-ps_driver_ext;
+ };
/* Transform logical y-ordinate Y into a page ordinate. */
#define YT(Y) (this->length - (Y))
/* Transform logical y-ordinate Y into a page ordinate. */
#define YT(Y) (this->length - (Y))
diff --git
a/src/output/table.c
b/src/output/table.c
index a7dc4817f0f946a46fc73ce0f2713490810bbc5b..461a2d843a57312e5c0df5765ff41e0d341c99ab 100644
(file)
--- a/
src/output/table.c
+++ b/
src/output/table.c
@@
-838,7
+838,7
@@
tab_next_row (struct tab_table *t)
\f
static struct tab_table *t;
static struct outp_driver *d;
\f
static struct tab_table *t;
static struct outp_driver *d;
-int tab_hit;
+
static
int tab_hit;
/* Set the current table to TABLE. */
static void
/* Set the current table to TABLE. */
static void