diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/access/gist/gistproc.c | 4 | ||||
-rw-r--r-- | src/backend/optimizer/geqo/geqo_erx.c | 8 | ||||
-rw-r--r-- | src/backend/partitioning/partbounds.c | 4 | ||||
-rw-r--r-- | src/backend/utils/adt/datetime.c | 8 | ||||
-rw-r--r-- | src/backend/utils/adt/numeric.c | 20 | ||||
-rw-r--r-- | src/backend/utils/adt/rangetypes_gist.c | 4 | ||||
-rw-r--r-- | src/backend/utils/adt/selfuncs.c | 2 | ||||
-rw-r--r-- | src/backend/utils/adt/timestamp.c | 4 | ||||
-rw-r--r-- | src/backend/utils/adt/tsgistidx.c | 2 | ||||
-rw-r--r-- | src/backend/utils/adt/tsrank.c | 2 | ||||
-rw-r--r-- | src/backend/utils/misc/guc.c | 2 | ||||
-rw-r--r-- | src/interfaces/ecpg/pgtypeslib/interval.c | 4 |
12 files changed, 32 insertions, 32 deletions
diff --git a/src/backend/access/gist/gistproc.c b/src/backend/access/gist/gistproc.c index 22f2c185370..406c65d6ec2 100644 --- a/src/backend/access/gist/gistproc.c +++ b/src/backend/access/gist/gistproc.c @@ -797,8 +797,8 @@ gist_box_picksplit(PG_FUNCTION_ARGS) for (i = 0; i < commonEntriesCount; i++) { box = DatumGetBoxP(entryvec->vector[commonEntries[i].index].key); - commonEntries[i].delta = Abs(float8_mi(box_penalty(leftBox, box), - box_penalty(rightBox, box))); + commonEntries[i].delta = fabs(float8_mi(box_penalty(leftBox, box), + box_penalty(rightBox, box))); } /* diff --git a/src/backend/optimizer/geqo/geqo_erx.c b/src/backend/optimizer/geqo/geqo_erx.c index cc0661365f6..21ad7854118 100644 --- a/src/backend/optimizer/geqo/geqo_erx.c +++ b/src/backend/optimizer/geqo/geqo_erx.c @@ -162,7 +162,7 @@ gimme_edge(PlannerInfo *root, Gene gene1, Gene gene2, Edge *edge_table) for (i = 0; i < edges; i++) { - if ((Gene) Abs(edge_table[city1].edge_list[i]) == city2) + if ((Gene) abs(edge_table[city1].edge_list[i]) == city2) { /* mark shared edges as negative */ @@ -249,14 +249,14 @@ remove_gene(PlannerInfo *root, Gene gene, Edge edge, Edge *edge_table) for (i = 0; i < edge.unused_edges; i++) { - possess_edge = (int) Abs(edge.edge_list[i]); + possess_edge = abs(edge.edge_list[i]); genes_remaining = edge_table[possess_edge].unused_edges; /* find the input gene in all edge_lists and delete it */ for (j = 0; j < genes_remaining; j++) { - if ((Gene) Abs(edge_table[possess_edge].edge_list[j]) == gene) + if ((Gene) abs(edge_table[possess_edge].edge_list[j]) == gene) { edge_table[possess_edge].unused_edges--; @@ -307,7 +307,7 @@ gimme_gene(PlannerInfo *root, Edge edge, Edge *edge_table) * converting to absolute values */ if (friend < 0) - return (Gene) Abs(friend); + return (Gene) abs(friend); /* diff --git a/src/backend/partitioning/partbounds.c b/src/backend/partitioning/partbounds.c index a49e97a2251..0823fa7b1db 100644 --- a/src/backend/partitioning/partbounds.c +++ b/src/backend/partitioning/partbounds.c @@ -3206,7 +3206,7 @@ check_new_partition_bound(char *relname, Relation parent, * datums list. */ PartitionRangeDatum *datum = - list_nth(spec->upperdatums, Abs(cmpval) - 1); + list_nth(spec->upperdatums, abs(cmpval) - 1); /* * The new partition overlaps with the @@ -3232,7 +3232,7 @@ check_new_partition_bound(char *relname, Relation parent, * if we have equality, point to the first one. */ datum = cmpval == 0 ? linitial(spec->lowerdatums) : - list_nth(spec->lowerdatums, Abs(cmpval) - 1); + list_nth(spec->lowerdatums, abs(cmpval) - 1); overlap = true; overlap_location = datum->location; with = boundinfo->indexes[offset + 1]; diff --git a/src/backend/utils/adt/datetime.c b/src/backend/utils/adt/datetime.c index 904ac2353cf..a8b025f43fa 100644 --- a/src/backend/utils/adt/datetime.c +++ b/src/backend/utils/adt/datetime.c @@ -448,14 +448,14 @@ AppendSeconds(char *cp, int sec, fsec_t fsec, int precision, bool fillzeros) Assert(precision >= 0); if (fillzeros) - cp = pg_ultostr_zeropad(cp, Abs(sec), 2); + cp = pg_ultostr_zeropad(cp, abs(sec), 2); else - cp = pg_ultostr(cp, Abs(sec)); + cp = pg_ultostr(cp, abs(sec)); /* fsec_t is just an int32 */ if (fsec != 0) { - int32 value = Abs(fsec); + int32 value = abs(fsec); char *end = &cp[precision + 1]; bool gotnonzero = false; @@ -490,7 +490,7 @@ AppendSeconds(char *cp, int sec, fsec_t fsec, int precision, bool fillzeros) * which will generate a correct answer in the minimum valid width. */ if (value) - return pg_ultostr(cp, Abs(fsec)); + return pg_ultostr(cp, abs(fsec)); return end; } diff --git a/src/backend/utils/adt/numeric.c b/src/backend/utils/adt/numeric.c index 85ee9ec4260..cafe1ac47b0 100644 --- a/src/backend/utils/adt/numeric.c +++ b/src/backend/utils/adt/numeric.c @@ -8870,7 +8870,7 @@ div_var_fast(const NumericVar *var1, const NumericVar *var2, if (qdigit != 0) { /* Do we need to normalize now? */ - maxdiv += Abs(qdigit); + maxdiv += abs(qdigit); if (maxdiv > (INT_MAX - INT_MAX / NBASE - 1) / (NBASE - 1)) { /* @@ -8923,7 +8923,7 @@ div_var_fast(const NumericVar *var1, const NumericVar *var2, fquotient = fdividend * fdivisorinverse; qdigit = (fquotient >= 0.0) ? ((int) fquotient) : (((int) fquotient) - 1); /* truncate towards -infinity */ - maxdiv += Abs(qdigit); + maxdiv += abs(qdigit); } /* @@ -9107,7 +9107,7 @@ div_var_int(const NumericVar *var, int ival, int ival_weight, * become as large as divisor * NBASE - 1, and so it requires a 64-bit * integer if this exceeds UINT_MAX. */ - divisor = Abs(ival); + divisor = abs(ival); if (divisor <= UINT_MAX / NBASE) { @@ -9948,7 +9948,7 @@ exp_var(const NumericVar *arg, NumericVar *result, int rscale) /* Guard against overflow/underflow */ /* If you change this limit, see also power_var()'s limit */ - if (Abs(val) >= NUMERIC_MAX_RESULT_SCALE * 3) + if (fabs(val) >= NUMERIC_MAX_RESULT_SCALE * 3) { if (val > 0) ereport(ERROR, @@ -9966,15 +9966,15 @@ exp_var(const NumericVar *arg, NumericVar *result, int rscale) * Reduce x to the range -0.01 <= x <= 0.01 (approximately) by dividing by * 2^ndiv2, to improve the convergence rate of the Taylor series. * - * Note that the overflow check above ensures that Abs(x) < 6000, which + * Note that the overflow check above ensures that fabs(x) < 6000, which * means that ndiv2 <= 20 here. */ - if (Abs(val) > 0.01) + if (fabs(val) > 0.01) { ndiv2 = 1; val /= 2; - while (Abs(val) > 0.01) + while (fabs(val) > 0.01) { ndiv2++; val /= 2; @@ -10116,7 +10116,7 @@ estimate_ln_dweight(const NumericVar *var) *---------- */ ln_var = log((double) digits) + dweight * 2.302585092994046; - ln_dweight = (int) log10(Abs(ln_var)); + ln_dweight = (int) log10(fabs(ln_var)); } else { @@ -10427,7 +10427,7 @@ power_var(const NumericVar *base, const NumericVar *exp, NumericVar *result) val = numericvar_to_double_no_overflow(&ln_num); /* initial overflow/underflow test with fuzz factor */ - if (Abs(val) > NUMERIC_MAX_RESULT_SCALE * 3.01) + if (fabs(val) > NUMERIC_MAX_RESULT_SCALE * 3.01) { if (val > 0) ereport(ERROR, @@ -10583,7 +10583,7 @@ power_var_int(const NumericVar *base, int exp, NumericVar *result, int rscale) * Now we can proceed with the multiplications. */ neg = (exp < 0); - mask = Abs(exp); + mask = abs(exp); init_var(&base_prod); set_var_from_var(base, &base_prod); diff --git a/src/backend/utils/adt/rangetypes_gist.c b/src/backend/utils/adt/rangetypes_gist.c index 777fdf0e2e9..5996de417de 100644 --- a/src/backend/utils/adt/rangetypes_gist.c +++ b/src/backend/utils/adt/rangetypes_gist.c @@ -743,8 +743,8 @@ range_gist_picksplit(PG_FUNCTION_ARGS) emptyCount = total_count - nonEmptyCount; if (infCount > 0 && nonInfCount > 0 && - (Abs(infCount - nonInfCount) <= - Abs(emptyCount - nonEmptyCount))) + (abs(infCount - nonInfCount) <= + abs(emptyCount - nonEmptyCount))) { classes_groups[CLS_NORMAL] = SPLIT_RIGHT; classes_groups[CLS_CONTAIN_EMPTY] = SPLIT_RIGHT; diff --git a/src/backend/utils/adt/selfuncs.c b/src/backend/utils/adt/selfuncs.c index 234fb665806..69e0fb98f5b 100644 --- a/src/backend/utils/adt/selfuncs.c +++ b/src/backend/utils/adt/selfuncs.c @@ -7835,7 +7835,7 @@ brincostestimate(PlannerInfo *root, IndexPath *path, double loop_count, double varCorrelation = 0.0; if (sslot.nnumbers > 0) - varCorrelation = Abs(sslot.numbers[0]); + varCorrelation = fabs(sslot.numbers[0]); if (varCorrelation > *indexCorrelation) *indexCorrelation = varCorrelation; diff --git a/src/backend/utils/adt/timestamp.c b/src/backend/utils/adt/timestamp.c index 9799647e1a5..d8552a1f186 100644 --- a/src/backend/utils/adt/timestamp.c +++ b/src/backend/utils/adt/timestamp.c @@ -3290,7 +3290,7 @@ interval_mul(PG_FUNCTION_ARGS) * cascade from months and days. It might still be >24 if the combination * of cascade and the seconds factor operation itself. */ - if (Abs(sec_remainder) >= SECS_PER_DAY) + if (fabs(sec_remainder) >= SECS_PER_DAY) { result->day += (int) (sec_remainder / SECS_PER_DAY); sec_remainder -= (int) (sec_remainder / SECS_PER_DAY) * SECS_PER_DAY; @@ -3347,7 +3347,7 @@ interval_div(PG_FUNCTION_ARGS) sec_remainder = (orig_day / factor - result->day + month_remainder_days - (int) month_remainder_days) * SECS_PER_DAY; sec_remainder = TSROUND(sec_remainder); - if (Abs(sec_remainder) >= SECS_PER_DAY) + if (fabs(sec_remainder) >= SECS_PER_DAY) { result->day += (int) (sec_remainder / SECS_PER_DAY); sec_remainder -= (int) (sec_remainder / SECS_PER_DAY) * SECS_PER_DAY; diff --git a/src/backend/utils/adt/tsgistidx.c b/src/backend/utils/adt/tsgistidx.c index fe438f1c4d3..728b5e9e713 100644 --- a/src/backend/utils/adt/tsgistidx.c +++ b/src/backend/utils/adt/tsgistidx.c @@ -700,7 +700,7 @@ gtsvector_picksplit(PG_FUNCTION_ARGS) costvector[j - 1].pos = j; size_alpha = hemdistcache(&(cache[seed_1]), &(cache[j]), siglen); size_beta = hemdistcache(&(cache[seed_2]), &(cache[j]), siglen); - costvector[j - 1].cost = Abs(size_alpha - size_beta); + costvector[j - 1].cost = abs(size_alpha - size_beta); } qsort((void *) costvector, maxoff, sizeof(SPLITCOST), comparecost); diff --git a/src/backend/utils/adt/tsrank.c b/src/backend/utils/adt/tsrank.c index 3858fc59281..e353669dbaa 100644 --- a/src/backend/utils/adt/tsrank.c +++ b/src/backend/utils/adt/tsrank.c @@ -257,7 +257,7 @@ calc_rank_and(const float *w, TSVector t, TSQuery q) { for (p = 0; p < lenct; p++) { - dist = Abs((int) WEP_GETPOS(post[l]) - (int) WEP_GETPOS(ct[p])); + dist = abs((int) WEP_GETPOS(post[l]) - (int) WEP_GETPOS(ct[p])); if (dist || (dist == 0 && (pos[i] == POSNULL || pos[k] == POSNULL))) { float curw; diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c index 01357660359..f997ec0f822 100644 --- a/src/backend/utils/misc/guc.c +++ b/src/backend/utils/misc/guc.c @@ -5378,7 +5378,7 @@ estimate_variable_size(struct config_generic *gconf) * small values. Maximum value is 2147483647, i.e. 10 chars. * Include one byte for sign. */ - if (Abs(*conf->variable) < 1000) + if (abs(*conf->variable) < 1000) valsize = 3 + 1; else valsize = 10 + 1; diff --git a/src/interfaces/ecpg/pgtypeslib/interval.c b/src/interfaces/ecpg/pgtypeslib/interval.c index 73bde94aaf0..dc083c13272 100644 --- a/src/interfaces/ecpg/pgtypeslib/interval.c +++ b/src/interfaces/ecpg/pgtypeslib/interval.c @@ -742,9 +742,9 @@ AppendSeconds(char *cp, int sec, fsec_t fsec, int precision, bool fillzeros) else { if (fillzeros) - sprintf(cp, "%02d.%0*d", abs(sec), precision, (int) Abs(fsec)); + sprintf(cp, "%02d.%0*d", abs(sec), precision, abs(fsec)); else - sprintf(cp, "%d.%0*d", abs(sec), precision, (int) Abs(fsec)); + sprintf(cp, "%d.%0*d", abs(sec), precision, abs(fsec)); TrimTrailingZeros(cp); } } |