1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

pgindent run before PG 9.1 beta 1.

This commit is contained in:
Bruce Momjian
2011-04-10 11:42:00 -04:00
parent 9a8b73147c
commit bf50caf105
446 changed files with 5737 additions and 5258 deletions

View File

@ -169,7 +169,7 @@ gbt_cash_distance(PG_FUNCTION_ARGS)
key.upper = (GBT_NUMKEY *) &kkk->upper;
PG_RETURN_FLOAT8(
gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo)
gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo)
);
}

View File

@ -90,9 +90,9 @@ static float8
gdb_date_dist(const void *a, const void *b)
{
/* we assume the difference can't overflow */
Datum diff = DirectFunctionCall2(date_mi,
Datum diff = DirectFunctionCall2(date_mi,
DateADTGetDatum(*((const DateADT *) a)),
DateADTGetDatum(*((const DateADT *) b)));
DateADTGetDatum(*((const DateADT *) b)));
return (float8) Abs(DatumGetInt32(diff));
}
@ -113,14 +113,14 @@ static const gbtree_ninfo tinfo =
PG_FUNCTION_INFO_V1(date_dist);
Datum date_dist(PG_FUNCTION_ARGS);
Datum date_dist(PG_FUNCTION_ARGS);
Datum
date_dist(PG_FUNCTION_ARGS)
{
/* we assume the difference can't overflow */
Datum diff = DirectFunctionCall2(date_mi,
PG_GETARG_DATUM(0),
PG_GETARG_DATUM(1));
Datum diff = DirectFunctionCall2(date_mi,
PG_GETARG_DATUM(0),
PG_GETARG_DATUM(1));
PG_RETURN_INT32(Abs(DatumGetInt32(diff)));
}
@ -181,7 +181,7 @@ gbt_date_distance(PG_FUNCTION_ARGS)
key.upper = (GBT_NUMKEY *) &kkk->upper;
PG_RETURN_FLOAT8(
gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo)
gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo)
);
}

View File

@ -94,18 +94,18 @@ static const gbtree_ninfo tinfo =
PG_FUNCTION_INFO_V1(float4_dist);
Datum float4_dist(PG_FUNCTION_ARGS);
Datum float4_dist(PG_FUNCTION_ARGS);
Datum
float4_dist(PG_FUNCTION_ARGS)
{
float4 a = PG_GETARG_FLOAT4(0);
float4 a = PG_GETARG_FLOAT4(0);
float4 b = PG_GETARG_FLOAT4(1);
float4 r;
r = a - b;
CHECKFLOATVAL(r, isinf(a) || isinf(b), true);
PG_RETURN_FLOAT4( Abs(r) );
PG_RETURN_FLOAT4(Abs(r));
}
@ -162,7 +162,7 @@ gbt_float4_distance(PG_FUNCTION_ARGS)
key.upper = (GBT_NUMKEY *) &kkk->upper;
PG_RETURN_FLOAT8(
gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo)
gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo)
);
}

View File

@ -76,8 +76,8 @@ gbt_float8key_cmp(const void *a, const void *b)
static float8
gbt_float8_dist(const void *a, const void *b)
{
float8 arg1 = *(const float8 *)a;
float8 arg2 = *(const float8 *)b;
float8 arg1 = *(const float8 *) a;
float8 arg2 = *(const float8 *) b;
float8 r;
r = arg1 - arg2;
@ -102,7 +102,7 @@ static const gbtree_ninfo tinfo =
PG_FUNCTION_INFO_V1(float8_dist);
Datum float8_dist(PG_FUNCTION_ARGS);
Datum float8_dist(PG_FUNCTION_ARGS);
Datum
float8_dist(PG_FUNCTION_ARGS)
{
@ -113,7 +113,7 @@ float8_dist(PG_FUNCTION_ARGS)
r = a - b;
CHECKFLOATVAL(r, isinf(a) || isinf(b), true);
PG_RETURN_FLOAT8( Abs(r) );
PG_RETURN_FLOAT8(Abs(r));
}
/**************************************************
@ -169,7 +169,7 @@ gbt_float8_distance(PG_FUNCTION_ARGS)
key.upper = (GBT_NUMKEY *) &kkk->upper;
PG_RETURN_FLOAT8(
gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo)
gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo)
);
}

View File

@ -94,12 +94,12 @@ static const gbtree_ninfo tinfo =
PG_FUNCTION_INFO_V1(int2_dist);
Datum int2_dist(PG_FUNCTION_ARGS);
Datum int2_dist(PG_FUNCTION_ARGS);
Datum
int2_dist(PG_FUNCTION_ARGS)
{
int2 a = PG_GETARG_INT16(0);
int2 b = PG_GETARG_INT16(1);
int2 a = PG_GETARG_INT16(0);
int2 b = PG_GETARG_INT16(1);
int2 r;
int2 ra;
@ -169,7 +169,7 @@ gbt_int2_distance(PG_FUNCTION_ARGS)
key.upper = (GBT_NUMKEY *) &kkk->upper;
PG_RETURN_FLOAT8(
gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo)
gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo)
);
}

View File

@ -95,14 +95,14 @@ static const gbtree_ninfo tinfo =
PG_FUNCTION_INFO_V1(int4_dist);
Datum int4_dist(PG_FUNCTION_ARGS);
Datum int4_dist(PG_FUNCTION_ARGS);
Datum
int4_dist(PG_FUNCTION_ARGS)
{
int4 a = PG_GETARG_INT32(0);
int4 b = PG_GETARG_INT32(1);
int4 r;
int4 ra;
int4 a = PG_GETARG_INT32(0);
int4 b = PG_GETARG_INT32(1);
int4 r;
int4 ra;
r = a - b;
ra = Abs(r);
@ -111,7 +111,7 @@ int4_dist(PG_FUNCTION_ARGS)
if (ra < 0 || (!SAMESIGN(a, b) && !SAMESIGN(r, a)))
ereport(ERROR,
(errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
errmsg("integer out of range")));
errmsg("integer out of range")));
PG_RETURN_INT32(ra);
}
@ -170,7 +170,7 @@ gbt_int4_distance(PG_FUNCTION_ARGS)
key.upper = (GBT_NUMKEY *) &kkk->upper;
PG_RETURN_FLOAT8(
gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo)
gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo)
);
}

View File

@ -95,14 +95,14 @@ static const gbtree_ninfo tinfo =
PG_FUNCTION_INFO_V1(int8_dist);
Datum int8_dist(PG_FUNCTION_ARGS);
Datum int8_dist(PG_FUNCTION_ARGS);
Datum
int8_dist(PG_FUNCTION_ARGS)
{
int64 a = PG_GETARG_INT64(0);
int64 b = PG_GETARG_INT64(1);
int64 r;
int64 ra;
int64 a = PG_GETARG_INT64(0);
int64 b = PG_GETARG_INT64(1);
int64 r;
int64 ra;
r = a - b;
ra = Abs(r);
@ -111,7 +111,7 @@ int8_dist(PG_FUNCTION_ARGS)
if (ra < 0 || (!SAMESIGN(a, b) && !SAMESIGN(r, a)))
ereport(ERROR,
(errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
errmsg("bigint out of range")));
errmsg("bigint out of range")));
PG_RETURN_INT64(ra);
}
@ -170,7 +170,7 @@ gbt_int8_distance(PG_FUNCTION_ARGS)
key.upper = (GBT_NUMKEY *) &kkk->upper;
PG_RETURN_FLOAT8(
gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo)
gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo)
);
}

View File

@ -88,7 +88,7 @@ intr2num(const Interval *i)
static float8
gbt_intv_dist(const void *a, const void *b)
{
return (float8)Abs(intr2num((Interval*)a) - intr2num((Interval*)b));
return (float8) Abs(intr2num((Interval *) a) - intr2num((Interval *) b));
}
/*
@ -127,7 +127,7 @@ abs_interval(Interval *a)
}
PG_FUNCTION_INFO_V1(interval_dist);
Datum interval_dist(PG_FUNCTION_ARGS);
Datum interval_dist(PG_FUNCTION_ARGS);
Datum
interval_dist(PG_FUNCTION_ARGS)
{
@ -240,7 +240,7 @@ gbt_intv_distance(PG_FUNCTION_ARGS)
key.upper = (GBT_NUMKEY *) &kkk->upper;
PG_RETURN_FLOAT8(
gbt_num_distance(&key, (void *) query, GIST_LEAF(entry), &tinfo)
gbt_num_distance(&key, (void *) query, GIST_LEAF(entry), &tinfo)
);
}

View File

@ -101,13 +101,13 @@ static const gbtree_ninfo tinfo =
PG_FUNCTION_INFO_V1(oid_dist);
Datum oid_dist(PG_FUNCTION_ARGS);
Datum oid_dist(PG_FUNCTION_ARGS);
Datum
oid_dist(PG_FUNCTION_ARGS)
{
Oid a = PG_GETARG_OID(0);
Oid b = PG_GETARG_OID(1);
Oid res;
Oid a = PG_GETARG_OID(0);
Oid b = PG_GETARG_OID(1);
Oid res;
if (a < b)
res = b - a;
@ -170,7 +170,7 @@ gbt_oid_distance(PG_FUNCTION_ARGS)
key.upper = (GBT_NUMKEY *) &kkk->upper;
PG_RETURN_FLOAT8(
gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo)
gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo)
);
}

View File

@ -119,7 +119,7 @@ gbt_time_dist(const void *a, const void *b)
{
const TimeADT *aa = (const TimeADT *) a;
const TimeADT *bb = (const TimeADT *) b;
Interval *i;
Interval *i;
i = DatumGetIntervalP(DirectFunctionCall2(time_mi_time,
TimeADTGetDatumFast(*aa),
@ -143,7 +143,7 @@ static const gbtree_ninfo tinfo =
PG_FUNCTION_INFO_V1(time_dist);
Datum time_dist(PG_FUNCTION_ARGS);
Datum time_dist(PG_FUNCTION_ARGS);
Datum
time_dist(PG_FUNCTION_ARGS)
{
@ -239,7 +239,7 @@ gbt_time_distance(PG_FUNCTION_ARGS)
key.upper = (GBT_NUMKEY *) &kkk->upper;
PG_RETURN_FLOAT8(
gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo)
gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo)
);
}

View File

@ -120,7 +120,7 @@ gbt_ts_dist(const void *a, const void *b)
{
const Timestamp *aa = (const Timestamp *) a;
const Timestamp *bb = (const Timestamp *) b;
Interval *i;
Interval *i;
if (TIMESTAMP_NOT_FINITE(*aa) || TIMESTAMP_NOT_FINITE(*bb))
return get_float8_infinity();
@ -147,17 +147,17 @@ static const gbtree_ninfo tinfo =
PG_FUNCTION_INFO_V1(ts_dist);
Datum ts_dist(PG_FUNCTION_ARGS);
Datum ts_dist(PG_FUNCTION_ARGS);
Datum
ts_dist(PG_FUNCTION_ARGS)
{
Timestamp a = PG_GETARG_TIMESTAMP(0);
Timestamp b = PG_GETARG_TIMESTAMP(1);
Interval *r;
Interval *r;
if (TIMESTAMP_NOT_FINITE(a) || TIMESTAMP_NOT_FINITE(b))
{
Interval *p = palloc(sizeof(Interval));
Interval *p = palloc(sizeof(Interval));
p->day = INT_MAX;
p->month = INT_MAX;
@ -169,25 +169,24 @@ ts_dist(PG_FUNCTION_ARGS)
PG_RETURN_INTERVAL_P(p);
}
else
r = DatumGetIntervalP(DirectFunctionCall2(timestamp_mi,
PG_GETARG_DATUM(0),
PG_GETARG_DATUM(1)));
PG_RETURN_INTERVAL_P( abs_interval(r) );
r = DatumGetIntervalP(DirectFunctionCall2(timestamp_mi,
PG_GETARG_DATUM(0),
PG_GETARG_DATUM(1)));
PG_RETURN_INTERVAL_P(abs_interval(r));
}
PG_FUNCTION_INFO_V1(tstz_dist);
Datum tstz_dist(PG_FUNCTION_ARGS);
Datum tstz_dist(PG_FUNCTION_ARGS);
Datum
tstz_dist(PG_FUNCTION_ARGS)
{
TimestampTz a = PG_GETARG_TIMESTAMPTZ(0);
TimestampTz b = PG_GETARG_TIMESTAMPTZ(1);
Interval *r;
TimestampTz a = PG_GETARG_TIMESTAMPTZ(0);
TimestampTz b = PG_GETARG_TIMESTAMPTZ(1);
Interval *r;
if (TIMESTAMP_NOT_FINITE(a) || TIMESTAMP_NOT_FINITE(b))
{
Interval *p = palloc(sizeof(Interval));
Interval *p = palloc(sizeof(Interval));
p->day = INT_MAX;
p->month = INT_MAX;
@ -202,7 +201,7 @@ tstz_dist(PG_FUNCTION_ARGS)
r = DatumGetIntervalP(DirectFunctionCall2(timestamp_mi,
PG_GETARG_DATUM(0),
PG_GETARG_DATUM(1)));
PG_RETURN_INTERVAL_P( abs_interval(r) );
PG_RETURN_INTERVAL_P(abs_interval(r));
}
@ -309,7 +308,7 @@ gbt_ts_distance(PG_FUNCTION_ARGS)
key.upper = (GBT_NUMKEY *) &kkk->upper;
PG_RETURN_FLOAT8(
gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo)
gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo)
);
}
@ -354,7 +353,7 @@ gbt_tstz_distance(PG_FUNCTION_ARGS)
qqq = tstz_to_ts_gmt(query);
PG_RETURN_FLOAT8(
gbt_num_distance(&key, (void *) &qqq, GIST_LEAF(entry), &tinfo)
gbt_num_distance(&key, (void *) &qqq, GIST_LEAF(entry), &tinfo)
);
}

View File

@ -223,8 +223,8 @@ gbt_num_consistent(const GBT_NUMKEY_R *key,
retval = (*tinfo->f_le) (query, key->upper);
break;
case BtreeGistNotEqualStrategyNumber:
retval = (! ((*tinfo->f_eq) (query, key->lower) &&
(*tinfo->f_eq) (query, key->upper))) ? true : false;
retval = (!((*tinfo->f_eq) (query, key->lower) &&
(*tinfo->f_eq) (query, key->upper))) ? true : false;
break;
default:
retval = false;
@ -249,9 +249,9 @@ gbt_num_distance(const GBT_NUMKEY_R *key,
if (tinfo->f_dist == NULL)
elog(ERROR, "KNN search is not supported for btree_gist type %d",
(int) tinfo->t);
if ( tinfo->f_le(query, key->lower) )
if (tinfo->f_le(query, key->lower))
retval = tinfo->f_dist(query, key->lower);
else if ( tinfo->f_ge(query, key->upper) )
else if (tinfo->f_ge(query, key->upper))
retval = tinfo->f_dist(query, key->upper);
else
retval = 0.0;

View File

@ -46,7 +46,7 @@ typedef struct
bool (*f_le) (const void *, const void *); /* less or equal */
bool (*f_lt) (const void *, const void *); /* less than */
int (*f_cmp) (const void *, const void *); /* key compare function */
float8 (*f_dist) (const void *, const void *); /* key distance function */
float8 (*f_dist) (const void *, const void *); /* key distance function */
} gbtree_ninfo;
@ -94,7 +94,7 @@ typedef struct
#define GET_FLOAT_DISTANCE(t, arg1, arg2) Abs( ((float8) *((const t *) (arg1))) - ((float8) *((const t *) (arg2))) )
#define SAMESIGN(a,b) (((a) < 0) == ((b) < 0))
#define SAMESIGN(a,b) (((a) < 0) == ((b) < 0))
/*
* check to see if a float4/8 val has underflowed or overflowed
@ -121,7 +121,7 @@ extern bool gbt_num_consistent(const GBT_NUMKEY_R *key, const void *query,
const gbtree_ninfo *tinfo);
extern float8 gbt_num_distance(const GBT_NUMKEY_R *key, const void *query,
bool is_leaf, const gbtree_ninfo *tinfo);
bool is_leaf, const gbtree_ninfo *tinfo);
extern GIST_SPLITVEC *gbt_num_picksplit(const GistEntryVector *entryvec, GIST_SPLITVEC *v,
const gbtree_ninfo *tinfo);

View File

@ -598,7 +598,7 @@ gbt_var_consistent(
|| gbt_var_node_pf_match(key, query, tinfo);
break;
case BtreeGistNotEqualStrategyNumber:
retval = ! ((*tinfo->f_eq) (query, key->lower) && (*tinfo->f_eq) (query, key->upper));
retval = !((*tinfo->f_eq) (query, key->lower) && (*tinfo->f_eq) (query, key->upper));
break;
default:
retval = FALSE;