Skip to content

Commit 2720c57

Browse files
author
Michael Meskes
committed
Removed some variables no longer needed.
1 parent fe35c8e commit 2720c57

File tree

6 files changed

+18
-32
lines changed

6 files changed

+18
-32
lines changed

src/interfaces/ecpg/ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2424,6 +2424,10 @@ Fri, 14 Aug 2009 14:45:02 +0200
24242424

24252425
- Made sure sqlca is reset for declare cursor in Informix mode as
24262426
pointed out by Böszörményi Zoltán <zb@cybertec.at>.
2427+
2428+
Thu, 03 Sep 2009 11:45:13 +0200
2429+
2430+
- Removed some no longer used variables as reported by clang.
24272431
- Set ecpg library version to 6.2.
24282432
- Set compat library version to 3.2.
24292433
- Set ecpg version to 4.6.

src/interfaces/ecpg/compatlib/informix.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $PostgreSQL: pgsql/src/interfaces/ecpg/compatlib/informix.c,v 1.60 2009/08/14 13:28:22 meskes Exp $ */
1+
/* $PostgreSQL: pgsql/src/interfaces/ecpg/compatlib/informix.c,v 1.61 2009/09/03 09:59:20 meskes Exp $ */
22

33
#define POSTGRES_ECPG_INTERNAL
44
#include "postgres_fe.h"
@@ -767,13 +767,12 @@ rfmtlong(long lng_val, char *fmt, char *outbuf)
767767
size_t fmt_len = strlen(fmt);
768768
size_t temp_len;
769769
int i,
770-
j,
770+
j, /* position in temp */
771771
k,
772772
dotpos;
773773
int leftalign = 0,
774774
blank = 0,
775775
sign = 0,
776-
entity = 0,
777776
entitydone = 0,
778777
signdone = 0,
779778
brackets_ok = 0;
@@ -811,17 +810,14 @@ rfmtlong(long lng_val, char *fmt, char *outbuf)
811810

812811
/* start to parse the formatstring */
813812
temp[0] = '\0';
814-
j = 0; /* position in temp */
815813
k = value.digits - 1; /* position in the value_string */
816814
for (i = fmt_len - 1, j = 0; i >= 0; i--, j++)
817815
{
818816
/* qualify, where we are in the value_string */
819817
if (k < 0)
820818
{
821819
blank = 1;
822-
if (k == -2)
823-
entity = 1;
824-
else if (k == -1)
820+
if (k == -1)
825821
sign = 1;
826822
if (leftalign)
827823
{

src/interfaces/ecpg/pgtypeslib/interval.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $PostgreSQL: pgsql/src/interfaces/ecpg/pgtypeslib/interval.c,v 1.41 2009/06/11 14:49:13 momjian Exp $ */
1+
/* $PostgreSQL: pgsql/src/interfaces/ecpg/pgtypeslib/interval.c,v 1.42 2009/09/03 09:59:20 meskes Exp $ */
22

33
#include "postgres_fe.h"
44
#include <time.h>
@@ -918,7 +918,7 @@ EncodeInterval(struct /* pg_ */ tm * tm, fsec_t fsec, int style, char *str)
918918
AppendSeconds(cp, sec, fsec, MAX_INTERVAL_PRECISION, false);
919919
cp += strlen(cp);
920920
*cp++ = 'S';
921-
*cp++ = '\0';
921+
*cp = '\0';
922922
}
923923
break;
924924

src/interfaces/ecpg/pgtypeslib/numeric.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $PostgreSQL: pgsql/src/interfaces/ecpg/pgtypeslib/numeric.c,v 1.33 2006/10/04 00:30:12 momjian Exp $ */
1+
/* $PostgreSQL: pgsql/src/interfaces/ecpg/pgtypeslib/numeric.c,v 1.34 2009/09/03 09:59:20 meskes Exp $ */
22

33
#include "postgres_fe.h"
44
#include <ctype.h>
@@ -1046,7 +1046,6 @@ select_div_scale(numeric *var1, numeric *var2, int *rscale)
10461046
NumericDigit firstdigit1,
10471047
firstdigit2;
10481048
int res_dscale;
1049-
int res_rscale;
10501049

10511050
/*
10521051
* The result scale of a division isn't specified in any SQL standard. For
@@ -1098,7 +1097,7 @@ select_div_scale(numeric *var1, numeric *var2, int *rscale)
10981097
res_dscale = Min(res_dscale, NUMERIC_MAX_DISPLAY_SCALE);
10991098

11001099
/* Select result scale */
1101-
*rscale = res_rscale = res_dscale + 4;
1100+
*rscale = res_dscale + 4;
11021101

11031102
return res_dscale;
11041103
}
@@ -1537,9 +1536,8 @@ int
15371536
PGTYPESnumeric_to_double(numeric *nv, double *dp)
15381537
{
15391538
double tmp;
1540-
int i;
15411539

1542-
if ((i = numericvar_to_double(nv, &tmp)) != 0)
1540+
if (numericvar_to_double(nv, &tmp) != 0)
15431541
return -1;
15441542
*dp = tmp;
15451543
return 0;

src/interfaces/ecpg/pgtypeslib/timestamp.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* $PostgreSQL: pgsql/src/interfaces/ecpg/pgtypeslib/timestamp.c,v 1.45 2009/06/11 14:49:13 momjian Exp $
2+
* $PostgreSQL: pgsql/src/interfaces/ecpg/pgtypeslib/timestamp.c,v 1.46 2009/09/03 09:59:20 meskes Exp $
33
*/
44
#include "postgres_fe.h"
55

@@ -237,8 +237,6 @@ timestamp2tm(timestamp dt, int *tzp, struct tm * tm, fsec_t *fsec, char **tzn)
237237
if (tzn != NULL)
238238
*tzn = NULL;
239239
#endif
240-
241-
dt = dt2local(dt, *tzp);
242240
}
243241
else
244242
{

src/interfaces/ecpg/preproc/type.c

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/type.c,v 1.84 2009/08/07 10:51:20 meskes Exp $ */
1+
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/type.c,v 1.85 2009/09/03 09:59:20 meskes Exp $ */
22

33
#include "postgres_fe.h"
44

@@ -228,7 +228,7 @@ static void ECPGdump_a_simple(FILE *o, const char *name, enum ECPGttype type,
228228
char *varcharsize,
229229
char *arrsiz, const char *siz, const char *prefix, int);
230230
static void ECPGdump_a_struct(FILE *o, const char *name, const char *ind_name, char *arrsiz,
231-
struct ECPGtype * type, struct ECPGtype * ind_type, const char *offset, const char *prefix, const char *ind_prefix);
231+
struct ECPGtype * type, struct ECPGtype * ind_type, const char *prefix, const char *ind_prefix);
232232

233233
void
234234
ECPGdump_a_type(FILE *o, const char *name, struct ECPGtype * type,
@@ -254,7 +254,7 @@ ECPGdump_a_type(FILE *o, const char *name, struct ECPGtype * type,
254254
type->size,
255255
type->u.element,
256256
(ind_type == NULL) ? NULL : ((ind_type->type == ECPGt_NO_INDICATOR) ? ind_type : ind_type->u.element),
257-
NULL, prefix, ind_prefix);
257+
prefix, ind_prefix);
258258
break;
259259
default:
260260
if (!IS_SIMPLE_TYPE(type->u.element->type))
@@ -280,7 +280,7 @@ ECPGdump_a_type(FILE *o, const char *name, struct ECPGtype * type,
280280
if (indicator_set && ind_type->type != ECPGt_struct)
281281
mmerror(INDICATOR_NOT_STRUCT, ET_FATAL, "indicator for struct has to be a struct");
282282

283-
ECPGdump_a_struct(o, name, ind_name, make_str("1"), type, ind_type, NULL, prefix, ind_prefix);
283+
ECPGdump_a_struct(o, name, ind_name, make_str("1"), type, ind_type, prefix, ind_prefix);
284284
break;
285285
case ECPGt_union: /* cannot dump a complete union */
286286
base_yyerror("type of union has to be specified");
@@ -459,26 +459,16 @@ ECPGdump_a_simple(FILE *o, const char *name, enum ECPGttype type,
459459

460460
/* Penetrate a struct and dump the contents. */
461461
static void
462-
ECPGdump_a_struct(FILE *o, const char *name, const char *ind_name, char *arrsiz, struct ECPGtype * type, struct ECPGtype * ind_type, const char *offsetarg, const char *prefix, const char *ind_prefix)
462+
ECPGdump_a_struct(FILE *o, const char *name, const char *ind_name, char *arrsiz, struct ECPGtype * type, struct ECPGtype * ind_type, const char *prefix, const char *ind_prefix)
463463
{
464464
/*
465465
* If offset is NULL, then this is the first recursive level. If not then
466466
* we are in a struct in a struct and the offset is used as offset.
467467
*/
468468
struct ECPGstruct_member *p,
469469
*ind_p = NULL;
470-
char obuf[BUFSIZ];
471470
char pbuf[BUFSIZ],
472471
ind_pbuf[BUFSIZ];
473-
const char *offset;
474-
475-
if (offsetarg == NULL)
476-
{
477-
sprintf(obuf, "sizeof(%s)", name);
478-
offset = obuf;
479-
}
480-
else
481-
offset = offsetarg;
482472

483473
if (atoi(arrsiz) == 1)
484474
sprintf(pbuf, "%s%s.", prefix ? prefix : "", name);

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