From: Michael Meskes Date: Fri, 21 Dec 2007 14:33:20 +0000 (+0000) Subject: Fixed a few minor glitches pointed out by splint. X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=65a17bfda12626d1bca82f28fc4ada644943cf3a;p=users%2Fbernd%2Fpostgres.git Fixed a few minor glitches pointed out by splint. --- diff --git a/src/interfaces/ecpg/ChangeLog b/src/interfaces/ecpg/ChangeLog index 6753f8edb6..ab3fcc440e 100644 --- a/src/interfaces/ecpg/ChangeLog +++ b/src/interfaces/ecpg/ChangeLog @@ -2268,6 +2268,10 @@ Wed, 10 Oct 2007 08:31:44 +0200 Tue, 06 Nov 2007 09:29:22 +0100 - Fixed two parser bugs. + +Fri, 21 Dec 2007 15:30:39 +0100 + + - Fixed a few minor glitches pointed out by splint. - Set pgtypes library version to 3.0. - Set compat library version to 3.0. - Set ecpg library version to 6.0. diff --git a/src/interfaces/ecpg/preproc/descriptor.c b/src/interfaces/ecpg/preproc/descriptor.c index ee440b3525..d9f1f09834 100644 --- a/src/interfaces/ecpg/preproc/descriptor.c +++ b/src/interfaces/ecpg/preproc/descriptor.c @@ -15,7 +15,7 @@ * assignment handling function (descriptor) */ -struct assignment *assignments; +static struct assignment *assignments; void push_assignment(char *var, enum ECPGdtype value) @@ -43,7 +43,7 @@ drop_assignments(void) } static void -ECPGnumeric_lvalue(FILE *f, char *name) +ECPGnumeric_lvalue(char *name) { const struct variable *v = find_variable(name); @@ -156,7 +156,7 @@ output_get_descr_header(char *desc_name) for (results = assignments; results != NULL; results = results->next) { if (results->value == ECPGd_count) - ECPGnumeric_lvalue(yyout, results->variable); + ECPGnumeric_lvalue(results->variable); else mmerror(PARSE_ERROR, ET_WARNING, "unknown descriptor header item '%d'", results->value); } @@ -205,7 +205,7 @@ output_set_descr_header(char *desc_name) for (results = assignments; results != NULL; results = results->next) { if (results->value == ECPGd_count) - ECPGnumeric_lvalue(yyout, results->variable); + ECPGnumeric_lvalue(results->variable); else mmerror(PARSE_ERROR, ET_WARNING, "unknown descriptor header item '%d'", results->value); } @@ -317,7 +317,7 @@ struct variable * descriptor_variable(const char *name, int input) { static char descriptor_names[2][MAX_DESCRIPTOR_NAMELEN]; - static const struct ECPGtype descriptor_type = {ECPGt_descriptor, NULL}; + static const struct ECPGtype descriptor_type = {ECPGt_descriptor, NULL, NULL, {NULL}, 0}; static const struct variable varspace[2] = { {descriptor_names[0], (struct ECPGtype *) & descriptor_type, 0, NULL}, {descriptor_names[1], (struct ECPGtype *) & descriptor_type, 0, NULL} diff --git a/src/interfaces/ecpg/preproc/ecpg.c b/src/interfaces/ecpg/preproc/ecpg.c index bcd01cdb3f..398e00969a 100644 --- a/src/interfaces/ecpg/preproc/ecpg.c +++ b/src/interfaces/ecpg/preproc/ecpg.c @@ -18,7 +18,6 @@ int ret_value = 0, system_includes = false, force_indicator = true, questionmarks = false, - header_mode = false, regression_mode = false, auto_prepare = false; @@ -132,6 +131,7 @@ main(int argc, char *const argv[]) int fnr, c, verbose = false, + header_mode = false, out_option = 0; struct _include_path *ip; const char *progname; @@ -200,7 +200,7 @@ main(int argc, char *const argv[]) case 'h': header_mode = true; /* this must include "-c" to make sense */ - /* so do not place a break; here */ + /* so do not place a "break;" here */ case 'c': auto_create_c = true; break; diff --git a/src/interfaces/ecpg/preproc/preproc.y b/src/interfaces/ecpg/preproc/preproc.y index ba2c5d48c3..3a8ae4c1db 100644 --- a/src/interfaces/ecpg/preproc/preproc.y +++ b/src/interfaces/ecpg/preproc/preproc.y @@ -47,10 +47,10 @@ static char *ECPGstruct_sizeof = NULL; /* for forward declarations we have to store some data as well */ static char *forward_name = NULL; -struct ECPGtype ecpg_no_indicator = {ECPGt_NO_INDICATOR, 0L, NULL, {NULL}}; +struct ECPGtype ecpg_no_indicator = {ECPGt_NO_INDICATOR, NULL, NULL, {NULL}, 0}; struct variable no_indicator = {"no_indicator", &ecpg_no_indicator, 0, NULL}; -struct ECPGtype ecpg_query = {ECPGt_char_variable, 0L, NULL, {NULL}}; +struct ECPGtype ecpg_query = {ECPGt_char_variable, NULL, NULL, {NULL}, 0}; /* * Handle parsing errors and warnings diff --git a/src/interfaces/ecpg/preproc/type.c b/src/interfaces/ecpg/preproc/type.c index ad57fa68c6..30dcf6e6d2 100644 --- a/src/interfaces/ecpg/preproc/type.c +++ b/src/interfaces/ecpg/preproc/type.c @@ -6,7 +6,7 @@ #define indicator_set ind_type != NULL && ind_type->type != ECPGt_NO_INDICATOR -struct ECPGstruct_member struct_no_indicator = {"no_indicator", &ecpg_no_indicator, NULL}; +static struct ECPGstruct_member struct_no_indicator = {"no_indicator", &ecpg_no_indicator, NULL}; /* malloc + error check */ void * diff --git a/src/interfaces/ecpg/preproc/variable.c b/src/interfaces/ecpg/preproc/variable.c index 9b4daf0dbb..a77aac7529 100644 --- a/src/interfaces/ecpg/preproc/variable.c +++ b/src/interfaces/ecpg/preproc/variable.c @@ -4,7 +4,7 @@ #include "extern.h" -struct variable *allvariables = NULL; +static struct variable *allvariables = NULL; struct variable * new_variable(const char *name, struct ECPGtype * type, int brace_level)