mirror of
https://github.com/postgres/postgres.git
synced 2025-06-29 10:41:53 +03:00
pgindent run for release 9.3
This is the first run of the Perl-based pgindent script. Also update pgindent instructions.
This commit is contained in:
@ -311,7 +311,6 @@ deccvlong(long lng, decimal *np)
|
||||
int
|
||||
decdiv(decimal *n1, decimal *n2, decimal *result)
|
||||
{
|
||||
|
||||
int i;
|
||||
|
||||
errno = 0;
|
||||
|
@ -65,7 +65,7 @@ ecpg_type_name(enum ECPGttype typ)
|
||||
default:
|
||||
abort();
|
||||
}
|
||||
return ""; /* keep MSC compiler happy */
|
||||
return ""; /* keep MSC compiler happy */
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -52,7 +52,6 @@ PGTYPESdate_from_timestamp(timestamp dt)
|
||||
date
|
||||
PGTYPESdate_from_asc(char *str, char **endptr)
|
||||
{
|
||||
|
||||
date dDate;
|
||||
fsec_t fsec;
|
||||
struct tm tt,
|
||||
|
@ -801,7 +801,6 @@ AppendSeconds(char *cp, int sec, fsec_t fsec, int precision, bool fillzeros)
|
||||
int
|
||||
EncodeInterval(struct /* pg_ */ tm * tm, fsec_t fsec, int style, char *str)
|
||||
{
|
||||
|
||||
char *cp = str;
|
||||
int year = tm->tm_year;
|
||||
int mon = tm->tm_mon;
|
||||
|
@ -1362,7 +1362,6 @@ done:
|
||||
int
|
||||
PGTYPESnumeric_cmp(numeric *var1, numeric *var2)
|
||||
{
|
||||
|
||||
/* use cmp_abs function to calculate the result */
|
||||
|
||||
/* both are positive: normal comparation with cmp_abs */
|
||||
|
@ -949,7 +949,6 @@ int
|
||||
PGTYPEStimestamp_add_interval(timestamp * tin, interval * span, timestamp * tout)
|
||||
{
|
||||
|
||||
|
||||
if (TIMESTAMP_NOT_FINITE(*tin))
|
||||
*tout = *tin;
|
||||
|
||||
|
@ -506,8 +506,8 @@ ECPGdump_a_struct(FILE *o, const char *name, const char *ind_name, char *arrsiz,
|
||||
*/
|
||||
struct ECPGstruct_member *p,
|
||||
*ind_p = NULL;
|
||||
char *pbuf = (char *) mm_alloc(strlen(name) + ((prefix == NULL) ? 0 : strlen(prefix)) + 3);
|
||||
char *ind_pbuf = (char *) mm_alloc(strlen(ind_name) + ((ind_prefix == NULL) ? 0 : strlen(ind_prefix)) + 3);
|
||||
char *pbuf = (char *) mm_alloc(strlen(name) + ((prefix == NULL) ? 0 : strlen(prefix)) + 3);
|
||||
char *ind_pbuf = (char *) mm_alloc(strlen(ind_name) + ((ind_prefix == NULL) ? 0 : strlen(ind_prefix)) + 3);
|
||||
|
||||
if (atoi(arrsiz) == 1)
|
||||
sprintf(pbuf, "%s%s.", prefix ? prefix : "", name);
|
||||
|
@ -244,7 +244,7 @@ pg_krb5_sendauth(PGconn *conn)
|
||||
}
|
||||
|
||||
retval = krb5_sendauth(info.pg_krb5_context, &auth_context,
|
||||
(krb5_pointer) &conn->sock, (char *) conn->krbsrvname,
|
||||
(krb5_pointer) & conn->sock, (char *) conn->krbsrvname,
|
||||
info.pg_krb5_client, server,
|
||||
AP_OPTS_MUTUAL_REQUIRED,
|
||||
NULL, 0, /* no creds, use ccache instead */
|
||||
@ -285,7 +285,7 @@ pg_krb5_sendauth(PGconn *conn)
|
||||
char sebuf[256];
|
||||
|
||||
printfPQExpBuffer(&conn->errorMessage,
|
||||
libpq_gettext("could not restore nonblocking mode on socket: %s\n"),
|
||||
libpq_gettext("could not restore nonblocking mode on socket: %s\n"),
|
||||
pqStrerror(errno, sebuf, sizeof(sebuf)));
|
||||
ret = STATUS_ERROR;
|
||||
}
|
||||
|
@ -162,7 +162,7 @@ typedef struct _internalPQconninfoOption
|
||||
* ---
|
||||
*/
|
||||
off_t connofs; /* Offset into PGconn struct, -1 if not there */
|
||||
} internalPQconninfoOption;
|
||||
} internalPQconninfoOption;
|
||||
|
||||
static const internalPQconninfoOption PQconninfoOptions[] = {
|
||||
/*
|
||||
@ -389,7 +389,7 @@ pgthreadlock_t pg_g_threadlock = default_threadlock;
|
||||
* pqDropConnection
|
||||
*
|
||||
* Close any physical connection to the server, and reset associated
|
||||
* state inside the connection object. We don't release state that
|
||||
* state inside the connection object. We don't release state that
|
||||
* would be needed to reconnect, though.
|
||||
*/
|
||||
void
|
||||
@ -1376,8 +1376,8 @@ connectDBStart(PGconn *conn)
|
||||
{
|
||||
appendPQExpBuffer(&conn->errorMessage,
|
||||
libpq_gettext("Unix-domain socket path \"%s\" is too long (maximum %d bytes)\n"),
|
||||
portstr,
|
||||
(int) (UNIXSOCK_PATH_BUFLEN - 1));
|
||||
portstr,
|
||||
(int) (UNIXSOCK_PATH_BUFLEN - 1));
|
||||
conn->options_valid = false;
|
||||
goto connect_errReturn;
|
||||
}
|
||||
|
@ -1181,7 +1181,7 @@ PQsendQueryParams(PGconn *conn,
|
||||
if (nParams < 0 || nParams > 65535)
|
||||
{
|
||||
printfPQExpBuffer(&conn->errorMessage,
|
||||
libpq_gettext("number of parameters must be between 0 and 65535\n"));
|
||||
libpq_gettext("number of parameters must be between 0 and 65535\n"));
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -1227,7 +1227,7 @@ PQsendPrepare(PGconn *conn,
|
||||
if (nParams < 0 || nParams > 65535)
|
||||
{
|
||||
printfPQExpBuffer(&conn->errorMessage,
|
||||
libpq_gettext("number of parameters must be between 0 and 65535\n"));
|
||||
libpq_gettext("number of parameters must be between 0 and 65535\n"));
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -1322,7 +1322,7 @@ PQsendQueryPrepared(PGconn *conn,
|
||||
if (nParams < 0 || nParams > 65535)
|
||||
{
|
||||
printfPQExpBuffer(&conn->errorMessage,
|
||||
libpq_gettext("number of parameters must be between 0 and 65535\n"));
|
||||
libpq_gettext("number of parameters must be between 0 and 65535\n"));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -329,7 +329,6 @@ do_field(const PQprintOpt *po, const PGresult *res,
|
||||
unsigned char *fieldNotNum, int *fieldMax,
|
||||
const int fieldMaxLen, FILE *fout)
|
||||
{
|
||||
|
||||
const char *pval,
|
||||
*p;
|
||||
int plen;
|
||||
@ -441,7 +440,6 @@ do_header(FILE *fout, const PQprintOpt *po, const int nFields, int *fieldMax,
|
||||
const char **fieldNames, unsigned char *fieldNotNum,
|
||||
const int fs_len, const PGresult *res)
|
||||
{
|
||||
|
||||
int j; /* for loop index */
|
||||
char *border = NULL;
|
||||
|
||||
@ -528,7 +526,6 @@ output_row(FILE *fout, const PQprintOpt *po, const int nFields, char **fields,
|
||||
unsigned char *fieldNotNum, int *fieldMax, char *border,
|
||||
const int row_index)
|
||||
{
|
||||
|
||||
int field_index; /* for loop index */
|
||||
|
||||
if (po->html3)
|
||||
|
@ -1467,6 +1467,7 @@ getCopyDataMessage(PGconn *conn)
|
||||
case 'd': /* Copy Data, pass it back to caller */
|
||||
return msgLength;
|
||||
case 'c':
|
||||
|
||||
/*
|
||||
* If this is a CopyDone message, exit COPY_OUT mode and let
|
||||
* caller read status with PQgetResult(). If we're in
|
||||
@ -1478,6 +1479,7 @@ getCopyDataMessage(PGconn *conn)
|
||||
conn->asyncStatus = PGASYNC_BUSY;
|
||||
return -1;
|
||||
default: /* treat as end of copy */
|
||||
|
||||
/*
|
||||
* Any other message terminates either COPY_IN or COPY_BOTH
|
||||
* mode.
|
||||
|
@ -24,7 +24,7 @@ extern "C"
|
||||
#endif
|
||||
|
||||
/* Callback Event Ids */
|
||||
typedef enum
|
||||
typedef enum
|
||||
{
|
||||
PGEVT_REGISTER,
|
||||
PGEVT_CONNRESET,
|
||||
|
Reference in New Issue
Block a user