From bdf46af748d0f15f257c99bf06e9e25aba6a24f9 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Thu, 26 Apr 2018 14:47:16 -0400 Subject: Post-feature-freeze pgindent run. Discussion: https://postgr.es/m/15719.1523984266@sss.pgh.pa.us --- src/interfaces/ecpg/ecpglib/data.c | 21 ++++++++++++++------- src/interfaces/ecpg/preproc/ecpg.c | 3 ++- src/interfaces/ecpg/preproc/type.c | 6 ++++-- src/interfaces/libpq/fe-connect.c | 2 +- src/interfaces/libpq/fe-secure-openssl.c | 17 +++++++++-------- src/interfaces/libpq/libpq-int.h | 6 +++--- 6 files changed, 33 insertions(+), 22 deletions(-) (limited to 'src/interfaces') diff --git a/src/interfaces/ecpg/ecpglib/data.c b/src/interfaces/ecpg/ecpglib/data.c index b43b36260ac..bd8553f1f53 100644 --- a/src/interfaces/ecpg/ecpglib/data.c +++ b/src/interfaces/ecpg/ecpglib/data.c @@ -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)) diff --git a/src/interfaces/ecpg/preproc/ecpg.c b/src/interfaces/ecpg/preproc/ecpg.c index 8fb731fcfb1..7fdc4ee596b 100644 --- a/src/interfaces/ecpg/preproc/ecpg.c +++ b/src/interfaces/ecpg/preproc/ecpg.c @@ -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; } diff --git a/src/interfaces/ecpg/preproc/type.c b/src/interfaces/ecpg/preproc/type.c index fa1a05c3025..253873dd4ef 100644 --- a/src/interfaces/ecpg/preproc/type.c +++ b/src/interfaces/ecpg/preproc/type.c @@ -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); } diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c index f3057e9d6f5..a7e969d7c1c 100644 --- a/src/interfaces/libpq/fe-connect.c +++ b/src/interfaces/libpq/fe-connect.c @@ -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)}, /* diff --git a/src/interfaces/libpq/fe-secure-openssl.c b/src/interfaces/libpq/fe-secure-openssl.c index 2e2f1074fcb..43640e37996 100644 --- a/src/interfaces/libpq/fe-secure-openssl.c +++ b/src/interfaces/libpq/fe-secure-openssl.c @@ -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 diff --git a/src/interfaces/libpq/libpq-int.h b/src/interfaces/libpq/libpq-int.h index eba23dcecc8..9a586ff25a4 100644 --- a/src/interfaces/libpq/libpq-int.h +++ b/src/interfaces/libpq/libpq-int.h @@ -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 === */ -- cgit v1.2.3