1
0
mirror of https://github.com/postgres/postgres.git synced 2025-10-16 17:07:43 +03:00

Post-feature-freeze pgindent run.

Discussion: https://postgr.es/m/15719.1523984266@sss.pgh.pa.us
This commit is contained in:
Tom Lane
2018-04-26 14:47:16 -04:00
parent f83bf385c1
commit bdf46af748
167 changed files with 1174 additions and 1061 deletions

View File

@@ -464,15 +464,22 @@ ecpg_get_data(const PGresult *results, int act_tuple, int act_field, int lineno,
if (varcharsize == 0 || varcharsize > size)
{
/* compatibility mode, blank pad and null terminate char array */
/*
* compatibility mode, blank pad and null
* terminate char array
*/
if (ORACLE_MODE(compat) && (type == ECPGt_char || type == ECPGt_unsigned_char))
{
memset(str, ' ', varcharsize);
memcpy(str, pval, size);
str[varcharsize-1] = '\0';
str[varcharsize - 1] = '\0';
/* compatibility mode empty string gets -1 indicator but no warning */
if (size == 0) {
/*
* compatibility mode empty string gets -1
* indicator but no warning
*/
if (size == 0)
{
/* truncation */
switch (ind_type)
{
@@ -488,12 +495,12 @@ ecpg_get_data(const PGresult *results, int act_tuple, int act_field, int lineno,
case ECPGt_unsigned_long:
*((long *) (ind + ind_offset * act_tuple)) = -1;
break;
#ifdef HAVE_LONG_LONG_INT
#ifdef HAVE_LONG_LONG_INT
case ECPGt_long_long:
case ECPGt_unsigned_long_long:
*((long long int *) (ind + ind_offset * act_tuple)) = -1;
break;
#endif /* HAVE_LONG_LONG_INT */
#endif /* HAVE_LONG_LONG_INT */
default:
break;
}
@@ -523,7 +530,7 @@ ecpg_get_data(const PGresult *results, int act_tuple, int act_field, int lineno,
if (ORACLE_MODE(compat) && (varcharsize - 1) < size)
{
if (type == ECPGt_char || type == ECPGt_unsigned_char)
str[varcharsize-1] = '\0';
str[varcharsize - 1] = '\0';
}
if (varcharsize < size || (ORACLE_MODE(compat) && (varcharsize - 1) < size))

View File

@@ -479,7 +479,8 @@ main(int argc, char *const argv[])
}
}
if (output_filename && out_option == 0) {
if (output_filename && out_option == 0)
{
free(output_filename);
output_filename = NULL;
}

View File

@@ -611,14 +611,16 @@ ECPGdump_a_struct(FILE *o, const char *name, const char *ind_name, char *arrsize
if (ind_p != NULL && ind_p != &struct_no_indicator)
{
ind_p = ind_p->next;
if (ind_p == NULL && p->next != NULL) {
if (ind_p == NULL && p->next != NULL)
{
mmerror(PARSE_ERROR, ET_WARNING, "indicator struct \"%s\" has too few members", ind_name);
ind_p = &struct_no_indicator;
}
}
}
if (ind_type != NULL && ind_p != NULL && ind_p != &struct_no_indicator) {
if (ind_type != NULL && ind_p != NULL && ind_p != &struct_no_indicator)
{
mmerror(PARSE_ERROR, ET_WARNING, "indicator struct \"%s\" has too many members", ind_name);
}

View File

@@ -266,7 +266,7 @@ static const internalPQconninfoOption PQconninfoOptions[] = {
{"scram_channel_binding", NULL, DefaultSCRAMChannelBinding, NULL,
"SCRAM-Channel-Binding", "D",
21, /* sizeof("tls-server-end-point") == 21 */
21, /* sizeof("tls-server-end-point") == 21 */
offsetof(struct pg_conn, scram_channel_binding)},
/*

View File

@@ -63,8 +63,8 @@
static int verify_cb(int ok, X509_STORE_CTX *ctx);
static int openssl_verify_peer_name_matches_certificate_name(PGconn *conn,
ASN1_STRING *name,
char **store_name);
ASN1_STRING *name,
char **store_name);
static void destroy_ssl_system(void);
static int initialize_SSL(PGconn *conn);
static PostgresPollingStatusType open_client_SSL(PGconn *);
@@ -560,8 +560,8 @@ pgtls_verify_peer_name_matches_certificate_guts(PGconn *conn,
(*names_examined)++;
rc = openssl_verify_peer_name_matches_certificate_name(conn,
name->d.dNSName,
&alt_name);
name->d.dNSName,
&alt_name);
if (alt_name)
{
@@ -599,10 +599,10 @@ pgtls_verify_peer_name_matches_certificate_guts(PGconn *conn,
{
(*names_examined)++;
rc = openssl_verify_peer_name_matches_certificate_name(
conn,
X509_NAME_ENTRY_get_data(
X509_NAME_get_entry(subject_name, cn_index)),
first_name);
conn,
X509_NAME_ENTRY_get_data(
X509_NAME_get_entry(subject_name, cn_index)),
first_name);
}
}
}
@@ -1194,6 +1194,7 @@ initialize_SSL(PGconn *conn)
#ifdef SSL_OP_NO_COMPRESSION
if (conn->sslcompression && conn->sslcompression[0] == '0')
SSL_set_options(conn->ssl, SSL_OP_NO_COMPRESSION);
/*
* Mainline OpenSSL introduced SSL_clear_options() before
* SSL_OP_NO_COMPRESSION, so this following #ifdef should not be

View File

@@ -349,7 +349,7 @@ struct pg_conn
* retransmits */
char *keepalives_count; /* maximum number of TCP keepalive
* retransmits */
char *scram_channel_binding; /* SCRAM channel binding type */
char *scram_channel_binding; /* SCRAM channel binding type */
char *sslmode; /* SSL mode (require,prefer,allow,disable) */
char *sslcompression; /* SSL compression (0 or 1) */
char *sslkey; /* client key filename */
@@ -742,8 +742,8 @@ extern char *pgtls_get_peer_certificate_hash(PGconn *conn, size_t *len);
*
*/
extern int pgtls_verify_peer_name_matches_certificate_guts(PGconn *conn,
int *names_examined,
char **first_name);
int *names_examined,
char **first_name);
/* === miscellaneous macros === */