diff options
Diffstat (limited to 'src/backend/utils/adt')
-rw-r--r-- | src/backend/utils/adt/array_typanalyze.c | 6 | ||||
-rw-r--r-- | src/backend/utils/adt/datetime.c | 52 | ||||
-rw-r--r-- | src/backend/utils/adt/numutils.c | 6 | ||||
-rw-r--r-- | src/backend/utils/adt/partitionfuncs.c | 4 | ||||
-rw-r--r-- | src/backend/utils/adt/ruleutils.c | 4 |
5 files changed, 36 insertions, 36 deletions
diff --git a/src/backend/utils/adt/array_typanalyze.c b/src/backend/utils/adt/array_typanalyze.c index 2360c680ac8..68f845bdee7 100644 --- a/src/backend/utils/adt/array_typanalyze.c +++ b/src/backend/utils/adt/array_typanalyze.c @@ -541,12 +541,12 @@ compute_array_stats(VacAttrStats *stats, AnalyzeAttrFetchFunc fetchfunc, */ for (i = 0; i < num_mcelem; i++) { - TrackItem *item = sort_table[i]; + TrackItem *titem = sort_table[i]; - mcelem_values[i] = datumCopy(item->key, + mcelem_values[i] = datumCopy(titem->key, extra_data->typbyval, extra_data->typlen); - mcelem_freqs[i] = (double) item->frequency / + mcelem_freqs[i] = (double) titem->frequency / (double) nonnull_cnt; } mcelem_freqs[i++] = (double) minfreq / (double) nonnull_cnt; diff --git a/src/backend/utils/adt/datetime.c b/src/backend/utils/adt/datetime.c index 350039cc866..904ac2353cf 100644 --- a/src/backend/utils/adt/datetime.c +++ b/src/backend/utils/adt/datetime.c @@ -1019,17 +1019,17 @@ DecodeDateTime(char **field, int *ftype, int nf, if (ptype == DTK_JULIAN) { char *cp; - int val; + int jday; if (tzp == NULL) return DTERR_BAD_FORMAT; errno = 0; - val = strtoint(field[i], &cp, 10); - if (errno == ERANGE || val < 0) + jday = strtoint(field[i], &cp, 10); + if (errno == ERANGE || jday < 0) return DTERR_FIELD_OVERFLOW; - j2date(val, &tm->tm_year, &tm->tm_mon, &tm->tm_mday); + j2date(jday, &tm->tm_year, &tm->tm_mon, &tm->tm_mday); isjulian = true; /* Get the time zone from the end of the string */ @@ -1181,10 +1181,10 @@ DecodeDateTime(char **field, int *ftype, int nf, if (ptype != 0) { char *cp; - int val; + int value; errno = 0; - val = strtoint(field[i], &cp, 10); + value = strtoint(field[i], &cp, 10); if (errno == ERANGE) return DTERR_FIELD_OVERFLOW; @@ -1209,7 +1209,7 @@ DecodeDateTime(char **field, int *ftype, int nf, switch (ptype) { case DTK_YEAR: - tm->tm_year = val; + tm->tm_year = value; tmask = DTK_M(YEAR); break; @@ -1222,33 +1222,33 @@ DecodeDateTime(char **field, int *ftype, int nf, if ((fmask & DTK_M(MONTH)) != 0 && (fmask & DTK_M(HOUR)) != 0) { - tm->tm_min = val; + tm->tm_min = value; tmask = DTK_M(MINUTE); } else { - tm->tm_mon = val; + tm->tm_mon = value; tmask = DTK_M(MONTH); } break; case DTK_DAY: - tm->tm_mday = val; + tm->tm_mday = value; tmask = DTK_M(DAY); break; case DTK_HOUR: - tm->tm_hour = val; + tm->tm_hour = value; tmask = DTK_M(HOUR); break; case DTK_MINUTE: - tm->tm_min = val; + tm->tm_min = value; tmask = DTK_M(MINUTE); break; case DTK_SECOND: - tm->tm_sec = val; + tm->tm_sec = value; tmask = DTK_M(SECOND); if (*cp == '.') { @@ -1268,10 +1268,10 @@ DecodeDateTime(char **field, int *ftype, int nf, case DTK_JULIAN: /* previous field was a label for "julian date" */ - if (val < 0) + if (value < 0) return DTERR_FIELD_OVERFLOW; tmask = DTK_DATE_M; - j2date(val, &tm->tm_year, &tm->tm_mon, &tm->tm_mday); + j2date(value, &tm->tm_year, &tm->tm_mon, &tm->tm_mday); isjulian = true; /* fractional Julian Day? */ @@ -2066,7 +2066,7 @@ DecodeTimeOnly(char **field, int *ftype, int nf, if (ptype != 0) { char *cp; - int val; + int value; /* Only accept a date under limited circumstances */ switch (ptype) @@ -2082,7 +2082,7 @@ DecodeTimeOnly(char **field, int *ftype, int nf, } errno = 0; - val = strtoint(field[i], &cp, 10); + value = strtoint(field[i], &cp, 10); if (errno == ERANGE) return DTERR_FIELD_OVERFLOW; @@ -2107,7 +2107,7 @@ DecodeTimeOnly(char **field, int *ftype, int nf, switch (ptype) { case DTK_YEAR: - tm->tm_year = val; + tm->tm_year = value; tmask = DTK_M(YEAR); break; @@ -2120,33 +2120,33 @@ DecodeTimeOnly(char **field, int *ftype, int nf, if ((fmask & DTK_M(MONTH)) != 0 && (fmask & DTK_M(HOUR)) != 0) { - tm->tm_min = val; + tm->tm_min = value; tmask = DTK_M(MINUTE); } else { - tm->tm_mon = val; + tm->tm_mon = value; tmask = DTK_M(MONTH); } break; case DTK_DAY: - tm->tm_mday = val; + tm->tm_mday = value; tmask = DTK_M(DAY); break; case DTK_HOUR: - tm->tm_hour = val; + tm->tm_hour = value; tmask = DTK_M(HOUR); break; case DTK_MINUTE: - tm->tm_min = val; + tm->tm_min = value; tmask = DTK_M(MINUTE); break; case DTK_SECOND: - tm->tm_sec = val; + tm->tm_sec = value; tmask = DTK_M(SECOND); if (*cp == '.') { @@ -2166,10 +2166,10 @@ DecodeTimeOnly(char **field, int *ftype, int nf, case DTK_JULIAN: /* previous field was a label for "julian date" */ - if (val < 0) + if (value < 0) return DTERR_FIELD_OVERFLOW; tmask = DTK_DATE_M; - j2date(val, &tm->tm_year, &tm->tm_mon, &tm->tm_mday); + j2date(value, &tm->tm_year, &tm->tm_mon, &tm->tm_mday); isjulian = true; if (*cp == '.') diff --git a/src/backend/utils/adt/numutils.c b/src/backend/utils/adt/numutils.c index cc3f95d3990..834ec0b5882 100644 --- a/src/backend/utils/adt/numutils.c +++ b/src/backend/utils/adt/numutils.c @@ -448,10 +448,10 @@ pg_ulltoa_n(uint64 value, char *a) while (value >= 100000000) { const uint64 q = value / 100000000; - uint32 value2 = (uint32) (value - 100000000 * q); + uint32 value3 = (uint32) (value - 100000000 * q); - const uint32 c = value2 % 10000; - const uint32 d = value2 / 10000; + const uint32 c = value3 % 10000; + const uint32 d = value3 / 10000; const uint32 c0 = (c % 100) << 1; const uint32 c1 = (c / 100) << 1; const uint32 d0 = (d % 100) << 1; diff --git a/src/backend/utils/adt/partitionfuncs.c b/src/backend/utils/adt/partitionfuncs.c index 109dc8023e1..96b5ae52d27 100644 --- a/src/backend/utils/adt/partitionfuncs.c +++ b/src/backend/utils/adt/partitionfuncs.c @@ -238,9 +238,9 @@ pg_partition_ancestors(PG_FUNCTION_ARGS) if (funcctx->call_cntr < list_length(ancestors)) { - Oid relid = list_nth_oid(ancestors, funcctx->call_cntr); + Oid resultrel = list_nth_oid(ancestors, funcctx->call_cntr); - SRF_RETURN_NEXT(funcctx, ObjectIdGetDatum(relid)); + SRF_RETURN_NEXT(funcctx, ObjectIdGetDatum(resultrel)); } SRF_RETURN_DONE(funcctx); diff --git a/src/backend/utils/adt/ruleutils.c b/src/backend/utils/adt/ruleutils.c index c4184035374..855d48372a7 100644 --- a/src/backend/utils/adt/ruleutils.c +++ b/src/backend/utils/adt/ruleutils.c @@ -8099,9 +8099,9 @@ get_parameter(Param *param, deparse_context *context) */ foreach(lc, context->namespaces) { - deparse_namespace *dpns = lfirst(lc); + deparse_namespace *depns = lfirst(lc); - if (dpns->rtable_names != NIL) + if (depns->rtable_names != NIL) { should_qualify = true; break; |