Skip to content

Commit 51a5921

Browse files
author
Michael Meskes
committed
Fixed a few minor glitches pointed out by splint.
1 parent 7b009a2 commit 51a5921

File tree

6 files changed

+20
-16
lines changed

6 files changed

+20
-16
lines changed

src/interfaces/ecpg/ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2268,6 +2268,10 @@ Wed, 10 Oct 2007 08:31:44 +0200
22682268
Tue, 06 Nov 2007 09:29:22 +0100
22692269

22702270
- Fixed two parser bugs.
2271+
2272+
Fri, 21 Dec 2007 15:30:39 +0100
2273+
2274+
- Fixed a few minor glitches pointed out by splint.
22712275
- Set pgtypes library version to 3.0.
22722276
- Set compat library version to 3.0.
22732277
- Set ecpg library version to 6.0.

src/interfaces/ecpg/preproc/descriptor.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* functions needed for descriptor handling
33
*
4-
* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/descriptor.c,v 1.25 2007/02/07 00:52:35 petere Exp $
4+
* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/descriptor.c,v 1.26 2007/12/21 14:33:20 meskes Exp $
55
*
66
* since descriptor might be either a string constant or a string var
77
* we need to check for a constant if we expect a constant
@@ -15,7 +15,7 @@
1515
* assignment handling function (descriptor)
1616
*/
1717

18-
struct assignment *assignments;
18+
static struct assignment *assignments;
1919

2020
void
2121
push_assignment(char *var, enum ECPGdtype value)
@@ -43,7 +43,7 @@ drop_assignments(void)
4343
}
4444

4545
static void
46-
ECPGnumeric_lvalue(FILE *f, char *name)
46+
ECPGnumeric_lvalue(char *name)
4747
{
4848
const struct variable *v = find_variable(name);
4949

@@ -156,7 +156,7 @@ output_get_descr_header(char *desc_name)
156156
for (results = assignments; results != NULL; results = results->next)
157157
{
158158
if (results->value == ECPGd_count)
159-
ECPGnumeric_lvalue(yyout, results->variable);
159+
ECPGnumeric_lvalue(results->variable);
160160
else
161161
mmerror(PARSE_ERROR, ET_WARNING, "unknown descriptor header item '%d'", results->value);
162162
}
@@ -205,7 +205,7 @@ output_set_descr_header(char *desc_name)
205205
for (results = assignments; results != NULL; results = results->next)
206206
{
207207
if (results->value == ECPGd_count)
208-
ECPGnumeric_lvalue(yyout, results->variable);
208+
ECPGnumeric_lvalue(results->variable);
209209
else
210210
mmerror(PARSE_ERROR, ET_WARNING, "unknown descriptor header item '%d'", results->value);
211211
}
@@ -317,7 +317,7 @@ struct variable *
317317
descriptor_variable(const char *name, int input)
318318
{
319319
static char descriptor_names[2][MAX_DESCRIPTOR_NAMELEN];
320-
static const struct ECPGtype descriptor_type = {ECPGt_descriptor, NULL};
320+
static const struct ECPGtype descriptor_type = {ECPGt_descriptor, NULL, NULL, {NULL}, 0};
321321
static const struct variable varspace[2] = {
322322
{descriptor_names[0], (struct ECPGtype *) & descriptor_type, 0, NULL},
323323
{descriptor_names[1], (struct ECPGtype *) & descriptor_type, 0, NULL}

src/interfaces/ecpg/preproc/ecpg.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.c,v 1.102 2007/11/15 21:14:45 momjian Exp $ */
1+
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.c,v 1.103 2007/12/21 14:33:20 meskes Exp $ */
22

33
/* New main for ecpg, the PostgreSQL embedded SQL precompiler. */
44
/* (C) Michael Meskes <meskes@postgresql.org> Feb 5th, 1998 */
@@ -18,7 +18,6 @@ int ret_value = 0,
1818
system_includes = false,
1919
force_indicator = true,
2020
questionmarks = false,
21-
header_mode = false,
2221
regression_mode = false,
2322
auto_prepare = false;
2423

@@ -132,6 +131,7 @@ main(int argc, char *const argv[])
132131
int fnr,
133132
c,
134133
verbose = false,
134+
header_mode = false,
135135
out_option = 0;
136136
struct _include_path *ip;
137137
const char *progname;
@@ -200,7 +200,7 @@ main(int argc, char *const argv[])
200200
case 'h':
201201
header_mode = true;
202202
/* this must include "-c" to make sense */
203-
/* so do not place a break; here */
203+
/* so do not place a "break;" here */
204204
case 'c':
205205
auto_create_c = true;
206206
break;

src/interfaces/ecpg/preproc/preproc.y

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/preproc.y,v 1.355 2007/11/06 08:32:08 meskes Exp $ */
1+
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/preproc.y,v 1.356 2007/12/21 14:33:20 meskes Exp $ */
22

33
/* Copyright comment */
44
%{
@@ -47,10 +47,10 @@ static char *ECPGstruct_sizeof = NULL;
4747
/* for forward declarations we have to store some data as well */
4848
static char *forward_name = NULL;
4949

50-
struct ECPGtype ecpg_no_indicator = {ECPGt_NO_INDICATOR, 0L, NULL, {NULL}};
50+
struct ECPGtype ecpg_no_indicator = {ECPGt_NO_INDICATOR, NULL, NULL, {NULL}, 0};
5151
struct variable no_indicator = {"no_indicator", &ecpg_no_indicator, 0, NULL};
5252

53-
struct ECPGtype ecpg_query = {ECPGt_char_variable, 0L, NULL, {NULL}};
53+
struct ECPGtype ecpg_query = {ECPGt_char_variable, NULL, NULL, {NULL}, 0};
5454

5555
/*
5656
* Handle parsing errors and warnings

src/interfaces/ecpg/preproc/type.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/type.c,v 1.76 2007/11/15 21:14:45 momjian Exp $ */
1+
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/type.c,v 1.77 2007/12/21 14:33:20 meskes Exp $ */
22

33
#include "postgres_fe.h"
44

55
#include "extern.h"
66

77
#define indicator_set ind_type != NULL && ind_type->type != ECPGt_NO_INDICATOR
88

9-
struct ECPGstruct_member struct_no_indicator = {"no_indicator", &ecpg_no_indicator, NULL};
9+
static struct ECPGstruct_member struct_no_indicator = {"no_indicator", &ecpg_no_indicator, NULL};
1010

1111
/* malloc + error check */
1212
void *

src/interfaces/ecpg/preproc/variable.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/variable.c,v 1.42 2007/08/14 10:01:53 meskes Exp $ */
1+
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/variable.c,v 1.43 2007/12/21 14:33:20 meskes Exp $ */
22

33
#include "postgres_fe.h"
44

55
#include "extern.h"
66

7-
struct variable *allvariables = NULL;
7+
static struct variable *allvariables = NULL;
88

99
struct variable *
1010
new_variable(const char *name, struct ECPGtype * type, int brace_level)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy