Skip to content

Commit 436a295

Browse files
committed
Re-run pgindent, fixing a problem where comment lines after a blank
comment line where output as too long, and update typedefs for /lib directory. Also fix case where identifiers were used as variable names in the backend, but as typedefs in ecpg (favor the backend for indenting). Backpatch to 8.1.X.
1 parent e196eed commit 436a295

File tree

264 files changed

+4417
-4111
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

264 files changed

+4417
-4111
lines changed

contrib/dblink/dblink.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@
6060

6161
typedef struct remoteConn
6262
{
63-
PGconn *conn; /* Hold the remote connection */
63+
PGconn *conn; /* Hold the remote connection */
6464
int openCursorCount; /* The number of open cursors */
65-
bool newXactForCursor; /* Opened a transaction for a cursor */
65+
bool newXactForCursor; /* Opened a transaction for a cursor */
6666
} remoteConn;
6767

6868
/*
@@ -85,8 +85,8 @@ static Oid get_relid_from_relname(text *relname_text);
8585
static char *generate_relation_name(Oid relid);
8686

8787
/* Global */
88-
static remoteConn *pconn = NULL;
89-
static HTAB *remoteConnHash = NULL;
88+
static remoteConn *pconn = NULL;
89+
static HTAB *remoteConnHash = NULL;
9090

9191
/*
9292
* Following is list that holds multiple remote connections.
@@ -347,7 +347,7 @@ dblink_open(PG_FUNCTION_ARGS)
347347
else
348348
conn = rconn->conn;
349349

350-
/* If we are not in a transaction, start one */
350+
/* If we are not in a transaction, start one */
351351
if (PQtransactionStatus(conn) == PQTRANS_IDLE)
352352
{
353353
res = PQexec(conn, "BEGIN");
@@ -1505,7 +1505,7 @@ get_text_array_contents(ArrayType *array, int *numitems)
15051505
else
15061506
{
15071507
values[i] = DatumGetCString(DirectFunctionCall1(textout,
1508-
PointerGetDatum(ptr)));
1508+
PointerGetDatum(ptr)));
15091509
ptr = att_addlength(ptr, typlen, PointerGetDatum(ptr));
15101510
ptr = (char *) att_align(ptr, typalign);
15111511
}
@@ -1717,7 +1717,7 @@ get_sql_update(Oid relid, int2vector *pkattnums, int16 pknumatts, char **src_pka
17171717
key = -1;
17181718

17191719
if (key > -1)
1720-
val = tgt_pkattvals[key] ? pstrdup(tgt_pkattvals[key]) : NULL;
1720+
val = tgt_pkattvals[key] ? pstrdup(tgt_pkattvals[key]) : NULL;
17211721
else
17221722
val = SPI_getvalue(tuple, tupdesc, i + 1);
17231723

@@ -1744,7 +1744,7 @@ get_sql_update(Oid relid, int2vector *pkattnums, int16 pknumatts, char **src_pka
17441744
quote_ident_cstr(NameStr(tupdesc->attrs[pkattnum - 1]->attname)));
17451745

17461746
if (tgt_pkattvals != NULL)
1747-
val = tgt_pkattvals[i] ? pstrdup(tgt_pkattvals[i]) : NULL;
1747+
val = tgt_pkattvals[i] ? pstrdup(tgt_pkattvals[i]) : NULL;
17481748
else
17491749
val = SPI_getvalue(tuple, tupdesc, pkattnum);
17501750

contrib/intarray/_int_gist.c

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ g_int_consistent(PG_FUNCTION_ARGS)
3939
if (strategy == BooleanSearchStrategy)
4040
PG_RETURN_BOOL(execconsistent((QUERYTYPE *) query,
4141
(ArrayType *) DatumGetPointer(entry->key),
42-
GIST_LEAF(entry)));
42+
GIST_LEAF(entry)));
4343

4444
/* XXX are we sure it's safe to scribble on the query object here? */
4545
/* XXX what about toasted input? */
@@ -97,7 +97,7 @@ g_int_union(PG_FUNCTION_ARGS)
9797

9898
for (i = 0; i < entryvec->n; i++)
9999
{
100-
ArrayType *ent = GETENTRY(entryvec, i);
100+
ArrayType *ent = GETENTRY(entryvec, i);
101101

102102
CHECKARRVALID(ent);
103103
totlen += ARRNELEMS(ent);
@@ -108,8 +108,8 @@ g_int_union(PG_FUNCTION_ARGS)
108108

109109
for (i = 0; i < entryvec->n; i++)
110110
{
111-
ArrayType *ent = GETENTRY(entryvec, i);
112-
int nel;
111+
ArrayType *ent = GETENTRY(entryvec, i);
112+
int nel;
113113

114114
nel = ARRNELEMS(ent);
115115
memcpy(ptr, ARRPTR(ent), nel * sizeof(int4));
@@ -143,23 +143,25 @@ g_int_compress(PG_FUNCTION_ARGS)
143143
CHECKARRVALID(r);
144144
PREPAREARR(r);
145145

146-
if (ARRNELEMS(r)>= 2 * MAXNUMRANGE)
147-
elog(NOTICE,"Input array is too big (%d maximum allowed, %d current), use gist__intbig_ops opclass instead",
148-
2 * MAXNUMRANGE - 1, ARRNELEMS(r));
149-
146+
if (ARRNELEMS(r) >= 2 * MAXNUMRANGE)
147+
elog(NOTICE, "Input array is too big (%d maximum allowed, %d current), use gist__intbig_ops opclass instead",
148+
2 * MAXNUMRANGE - 1, ARRNELEMS(r));
149+
150150
retval = palloc(sizeof(GISTENTRY));
151151
gistentryinit(*retval, PointerGetDatum(r),
152152
entry->rel, entry->page, entry->offset, VARSIZE(r), FALSE);
153153

154154
PG_RETURN_POINTER(retval);
155155
}
156156

157-
/* leaf entries never compress one more time, only when entry->leafkey ==true,
158-
so now we work only with internal keys */
157+
/*
158+
* leaf entries never compress one more time, only when entry->leafkey
159+
* ==true, so now we work only with internal keys
160+
*/
159161

160162
r = (ArrayType *) PG_DETOAST_DATUM(entry->key);
161163
CHECKARRVALID(r);
162-
if (ARRISVOID(r))
164+
if (ARRISVOID(r))
163165
{
164166
if (r != (ArrayType *) DatumGetPointer(entry->key))
165167
pfree(r);

contrib/pgbench/pgbench.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* $PostgreSQL: pgsql/contrib/pgbench/pgbench.c,v 1.45 2005/10/29 19:38:07 tgl Exp $
2+
* $PostgreSQL: pgsql/contrib/pgbench/pgbench.c,v 1.46 2005/11/22 18:17:04 momjian Exp $
33
*
44
* pgbench: a simple benchmark program for PostgreSQL
55
* written by Tatsuo Ishii
@@ -1110,7 +1110,8 @@ main(int argc, char **argv)
11101110
fprintf(stderr, "Use limit/ulimt to increase the limit before using pgbench.\n");
11111111
exit(1);
11121112
}
1113-
#endif /* #if !(defined(__CYGWIN__) || defined(__MINGW32__)) */
1113+
#endif /* #if !(defined(__CYGWIN__) ||
1114+
* defined(__MINGW32__)) */
11141115
break;
11151116
case 'C':
11161117
is_connect = 1;

contrib/pgcrypto/pgp-decrypt.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2727
* SUCH DAMAGE.
2828
*
29-
* $PostgreSQL: pgsql/contrib/pgcrypto/pgp-decrypt.c,v 1.6 2005/10/15 02:49:06 momjian Exp $
29+
* $PostgreSQL: pgsql/contrib/pgcrypto/pgp-decrypt.c,v 1.7 2005/11/22 18:17:04 momjian Exp $
3030
*/
3131

3232
#include "postgres.h"
@@ -269,14 +269,14 @@ prefix_init(void **priv_p, void *arg, PullFilter * src)
269269
* The original purpose of the 2-byte check was to show user a
270270
* friendly "wrong key" message. This made following possible:
271271
*
272-
* "An Attack on CFB Mode Encryption As Used By OpenPGP" by Serge Mister
273-
* and Robert Zuccherato
272+
* "An Attack on CFB Mode Encryption As Used By OpenPGP" by Serge
273+
* Mister and Robert Zuccherato
274274
*
275-
* To avoid being 'oracle', we delay reporting, which basically means we
276-
* prefer to run into corrupt packet header.
275+
* To avoid being 'oracle', we delay reporting, which basically means
276+
* we prefer to run into corrupt packet header.
277277
*
278-
* We _could_ throw PXE_PGP_CORRUPT_DATA here, but there is possibility
279-
* of attack via timing, so we don't.
278+
* We _could_ throw PXE_PGP_CORRUPT_DATA here, but there is
279+
* possibility of attack via timing, so we don't.
280280
*/
281281
ctx->corrupt_prefix = 1;
282282
}

contrib/pgcrypto/pgp-pgsql.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2727
* SUCH DAMAGE.
2828
*
29-
* $PostgreSQL: pgsql/contrib/pgcrypto/pgp-pgsql.c,v 1.6 2005/10/15 02:49:06 momjian Exp $
29+
* $PostgreSQL: pgsql/contrib/pgcrypto/pgp-pgsql.c,v 1.7 2005/11/22 18:17:04 momjian Exp $
3030
*/
3131

3232
#include "postgres.h"
@@ -125,8 +125,8 @@ add_entropy(text *data1, text *data2, text *data3)
125125
/*
126126
* Try to make the feeding unpredictable.
127127
*
128-
* Prefer data over keys, as it's rather likely that key is same in several
129-
* calls.
128+
* Prefer data over keys, as it's rather likely that key is same in
129+
* several calls.
130130
*/
131131

132132
/* chance: 7/8 */

contrib/tablefunc/tablefunc.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -547,8 +547,8 @@ crosstab(PG_FUNCTION_ARGS)
547547
* Get the next category item value, which is alway
548548
* attribute number three.
549549
*
550-
* Be careful to sssign the value to the array index based on
551-
* which category we are presently processing.
550+
* Be careful to sssign the value to the array index based
551+
* on which category we are presently processing.
552552
*/
553553
values[1 + i] = SPI_getvalue(spi_tuple, spi_tupdesc, 3);
554554

@@ -870,8 +870,8 @@ get_crosstab_tuplestore(char *sql,
870870
/*
871871
* The provided SQL query must always return at least three columns:
872872
*
873-
* 1. rowname the label for each row - column 1 in the final result 2.
874-
* category the label for each value-column in the final result 3.
873+
* 1. rowname the label for each row - column 1 in the final result
874+
* 2. category the label for each value-column in the final result 3.
875875
* value the values used to populate the value-columns
876876
*
877877
* If there are more than three columns, the last two are taken as

contrib/tsearch2/query.c

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ gettoken_query(QPRS_STATE * state, int4 *val, int4 *lenval, char **strval, int2
178178
state->state = WAITOPERATOR;
179179
return VAL;
180180
}
181-
else if ( state->state == WAITFIRSTOPERAND )
181+
else if (state->state == WAITFIRSTOPERAND)
182182
return END;
183183
else
184184
ereport(ERROR,
@@ -206,13 +206,13 @@ gettoken_query(QPRS_STATE * state, int4 *val, int4 *lenval, char **strval, int2
206206
return ERR;
207207
break;
208208
case WAITSINGLEOPERAND:
209-
if ( *(state->buf) == '\0' )
209+
if (*(state->buf) == '\0')
210210
return END;
211211
*strval = state->buf;
212-
*lenval = strlen( state->buf );
213-
state->buf += strlen( state->buf );
212+
*lenval = strlen(state->buf);
213+
state->buf += strlen(state->buf);
214214
state->count++;
215-
return VAL;
215+
return VAL;
216216
default:
217217
return ERR;
218218
break;
@@ -600,7 +600,7 @@ findoprnd(ITEM * ptr, int4 *pos)
600600
* input
601601
*/
602602
static QUERYTYPE *
603-
queryin(char *buf, void (*pushval) (QPRS_STATE *, int, char *, int, int2), int cfg_id, bool isplain)
603+
queryin(char *buf, void (*pushval) (QPRS_STATE *, int, char *, int, int2), int cfg_id, bool isplain)
604604
{
605605
QPRS_STATE state;
606606
int4 i;
@@ -637,12 +637,13 @@ queryin(char *buf, void (*pushval) (QPRS_STATE *, int, char *, int, int2), int c
637637
/* parse query & make polish notation (postfix, but in reverse order) */
638638
makepol(&state, pushval);
639639
pfree(state.valstate.word);
640-
if (!state.num) {
640+
if (!state.num)
641+
{
641642
elog(NOTICE, "Query doesn't contain lexem(s)");
642-
query = (QUERYTYPE*)palloc( HDRSIZEQT );
643+
query = (QUERYTYPE *) palloc(HDRSIZEQT);
643644
query->len = HDRSIZEQT;
644645
query->size = 0;
645-
return query;
646+
return query;
646647
}
647648

648649
/* make finish struct */
@@ -928,9 +929,9 @@ to_tsquery(PG_FUNCTION_ARGS)
928929
str = text2char(in);
929930
PG_FREE_IF_COPY(in, 1);
930931

931-
query = queryin(str, pushval_morph, PG_GETARG_INT32(0),false);
932-
933-
if ( query->size == 0 )
932+
query = queryin(str, pushval_morph, PG_GETARG_INT32(0), false);
933+
934+
if (query->size == 0)
934935
PG_RETURN_POINTER(query);
935936

936937
res = clean_fakeval_v2(GETQUERY(query), &len);
@@ -984,8 +985,8 @@ plainto_tsquery(PG_FUNCTION_ARGS)
984985
PG_FREE_IF_COPY(in, 1);
985986

986987
query = queryin(str, pushval_morph, PG_GETARG_INT32(0), true);
987-
988-
if ( query->size == 0 )
988+
989+
if (query->size == 0)
989990
PG_RETURN_POINTER(query);
990991

991992
res = clean_fakeval_v2(GETQUERY(query), &len);
@@ -1023,4 +1024,3 @@ plainto_tsquery_current(PG_FUNCTION_ARGS)
10231024
Int32GetDatum(get_currcfg()),
10241025
PG_GETARG_DATUM(0)));
10251026
}
1026-

contrib/tsearch2/query.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ typedef struct ITEM
1717
int4 val;
1818
/* user-friendly value, must correlate with WordEntry */
1919
uint32
20-
istrue:1, /* use for ranking in Cover */
20+
istrue:1, /* use for ranking in Cover */
2121
length:11,
2222
distance:20;
2323
} ITEM;

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