summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Meskes2009-09-03 09:59:20 +0000
committerMichael Meskes2009-09-03 09:59:20 +0000
commitce4fb24aee2a4463d772af0cc65c1397cc0391f5 (patch)
tree652dccd76bba5fb0148eb5bc74623c70ae4ebd3d
parent67fab29ce6259a351173e5258242c7bbbdd4eb11 (diff)
Removed some variables no longer needed.
-rw-r--r--src/interfaces/ecpg/ChangeLog4
-rw-r--r--src/interfaces/ecpg/compatlib/informix.c8
-rw-r--r--src/interfaces/ecpg/pgtypeslib/interval.c2
-rw-r--r--src/interfaces/ecpg/pgtypeslib/numeric.c6
-rw-r--r--src/interfaces/ecpg/pgtypeslib/timestamp.c2
-rw-r--r--src/interfaces/ecpg/preproc/type.c18
6 files changed, 13 insertions, 27 deletions
diff --git a/src/interfaces/ecpg/ChangeLog b/src/interfaces/ecpg/ChangeLog
index 3a7b0b5a08..6593b6d552 100644
--- a/src/interfaces/ecpg/ChangeLog
+++ b/src/interfaces/ecpg/ChangeLog
@@ -2424,6 +2424,10 @@ Fri, 14 Aug 2009 14:45:02 +0200
- Made sure sqlca is reset for declare cursor in Informix mode as
pointed out by Böszörményi Zoltán <[email protected]>.
+
+Thu, 03 Sep 2009 11:45:13 +0200
+
+ - Removed some no longer used variables as reported by clang.
- Set ecpg library version to 6.2.
- Set compat library version to 3.2.
- Set ecpg version to 4.6.
diff --git a/src/interfaces/ecpg/compatlib/informix.c b/src/interfaces/ecpg/compatlib/informix.c
index e22e59a6d6..4abedfc6ba 100644
--- a/src/interfaces/ecpg/compatlib/informix.c
+++ b/src/interfaces/ecpg/compatlib/informix.c
@@ -767,13 +767,12 @@ rfmtlong(long lng_val, char *fmt, char *outbuf)
size_t fmt_len = strlen(fmt);
size_t temp_len;
int i,
- j,
+ j, /* position in temp */
k,
dotpos;
int leftalign = 0,
blank = 0,
sign = 0,
- entity = 0,
entitydone = 0,
signdone = 0,
brackets_ok = 0;
@@ -811,7 +810,6 @@ rfmtlong(long lng_val, char *fmt, char *outbuf)
/* start to parse the formatstring */
temp[0] = '\0';
- j = 0; /* position in temp */
k = value.digits - 1; /* position in the value_string */
for (i = fmt_len - 1, j = 0; i >= 0; i--, j++)
{
@@ -819,9 +817,7 @@ rfmtlong(long lng_val, char *fmt, char *outbuf)
if (k < 0)
{
blank = 1;
- if (k == -2)
- entity = 1;
- else if (k == -1)
+ if (k == -1)
sign = 1;
if (leftalign)
{
diff --git a/src/interfaces/ecpg/pgtypeslib/interval.c b/src/interfaces/ecpg/pgtypeslib/interval.c
index ee1a3c427e..03f0abaf33 100644
--- a/src/interfaces/ecpg/pgtypeslib/interval.c
+++ b/src/interfaces/ecpg/pgtypeslib/interval.c
@@ -918,7 +918,7 @@ EncodeInterval(struct /* pg_ */ tm * tm, fsec_t fsec, int style, char *str)
AppendSeconds(cp, sec, fsec, MAX_INTERVAL_PRECISION, false);
cp += strlen(cp);
*cp++ = 'S';
- *cp++ = '\0';
+ *cp = '\0';
}
break;
diff --git a/src/interfaces/ecpg/pgtypeslib/numeric.c b/src/interfaces/ecpg/pgtypeslib/numeric.c
index 9c3854ab29..273e4e02ab 100644
--- a/src/interfaces/ecpg/pgtypeslib/numeric.c
+++ b/src/interfaces/ecpg/pgtypeslib/numeric.c
@@ -1046,7 +1046,6 @@ select_div_scale(numeric *var1, numeric *var2, int *rscale)
NumericDigit firstdigit1,
firstdigit2;
int res_dscale;
- int res_rscale;
/*
* 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)
res_dscale = Min(res_dscale, NUMERIC_MAX_DISPLAY_SCALE);
/* Select result scale */
- *rscale = res_rscale = res_dscale + 4;
+ *rscale = res_dscale + 4;
return res_dscale;
}
@@ -1537,9 +1536,8 @@ int
PGTYPESnumeric_to_double(numeric *nv, double *dp)
{
double tmp;
- int i;
- if ((i = numericvar_to_double(nv, &tmp)) != 0)
+ if (numericvar_to_double(nv, &tmp) != 0)
return -1;
*dp = tmp;
return 0;
diff --git a/src/interfaces/ecpg/pgtypeslib/timestamp.c b/src/interfaces/ecpg/pgtypeslib/timestamp.c
index 7445941428..40cba45bb1 100644
--- a/src/interfaces/ecpg/pgtypeslib/timestamp.c
+++ b/src/interfaces/ecpg/pgtypeslib/timestamp.c
@@ -237,8 +237,6 @@ recalc_t:
if (tzn != NULL)
*tzn = NULL;
#endif
-
- dt = dt2local(dt, *tzp);
}
else
{
diff --git a/src/interfaces/ecpg/preproc/type.c b/src/interfaces/ecpg/preproc/type.c
index 52c3e6d913..05319dcb55 100644
--- a/src/interfaces/ecpg/preproc/type.c
+++ b/src/interfaces/ecpg/preproc/type.c
@@ -228,7 +228,7 @@ static void ECPGdump_a_simple(FILE *o, const char *name, enum ECPGttype type,
char *varcharsize,
char *arrsiz, const char *siz, const char *prefix, int);
static void ECPGdump_a_struct(FILE *o, const char *name, const char *ind_name, char *arrsiz,
- struct ECPGtype * type, struct ECPGtype * ind_type, const char *offset, const char *prefix, const char *ind_prefix);
+ struct ECPGtype * type, struct ECPGtype * ind_type, const char *prefix, const char *ind_prefix);
void
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,
type->size,
type->u.element,
(ind_type == NULL) ? NULL : ((ind_type->type == ECPGt_NO_INDICATOR) ? ind_type : ind_type->u.element),
- NULL, prefix, ind_prefix);
+ prefix, ind_prefix);
break;
default:
if (!IS_SIMPLE_TYPE(type->u.element->type))
@@ -280,7 +280,7 @@ ECPGdump_a_type(FILE *o, const char *name, struct ECPGtype * type,
if (indicator_set && ind_type->type != ECPGt_struct)
mmerror(INDICATOR_NOT_STRUCT, ET_FATAL, "indicator for struct has to be a struct");
- ECPGdump_a_struct(o, name, ind_name, make_str("1"), type, ind_type, NULL, prefix, ind_prefix);
+ ECPGdump_a_struct(o, name, ind_name, make_str("1"), type, ind_type, prefix, ind_prefix);
break;
case ECPGt_union: /* cannot dump a complete union */
base_yyerror("type of union has to be specified");
@@ -459,7 +459,7 @@ ECPGdump_a_simple(FILE *o, const char *name, enum ECPGttype type,
/* Penetrate a struct and dump the contents. */
static void
-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)
+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)
{
/*
* If offset is NULL, then this is the first recursive level. If not then
@@ -467,18 +467,8 @@ ECPGdump_a_struct(FILE *o, const char *name, const char *ind_name, char *arrsiz,
*/
struct ECPGstruct_member *p,
*ind_p = NULL;
- char obuf[BUFSIZ];
char pbuf[BUFSIZ],
ind_pbuf[BUFSIZ];
- const char *offset;
-
- if (offsetarg == NULL)
- {
- sprintf(obuf, "sizeof(%s)", name);
- offset = obuf;
- }
- else
- offset = offsetarg;
if (atoi(arrsiz) == 1)
sprintf(pbuf, "%s%s.", prefix ? prefix : "", name);