summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaoruToda <kunnpuu@gmail.com>2017-10-09 20:05:58 +0900
committerMatt Caswell <matt@openssl.org>2017-10-09 13:17:09 +0100
commit208fb891e36f16d20262710c70ef0ff3df0e885c (patch)
tree514e6161c7c21122fced736efaddd87f5b5e0538
parent2e8b5d75afaff7c9b75917b750f997dc82336fac (diff)
Since return is inconsistent, I removed unnecessary parentheses and
unified them. - return (0); -> return 0; - return (1); -> return 1; - return (-1); -> return -1; Reviewed-by: Stephen Henson <steve@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4500)
-rw-r--r--apps/apps.c4
-rw-r--r--apps/openssl.c2
-rw-r--r--apps/rehash.c2
-rw-r--r--apps/s_cb.c2
-rw-r--r--apps/s_server.c2
-rw-r--r--crypto/asn1/a_bitstr.c6
-rw-r--r--crypto/asn1/a_digest.c4
-rw-r--r--crypto/asn1/a_print.c4
-rw-r--r--crypto/asn1/evp_asn1.c2
-rw-r--r--crypto/bio/b_sock.c2
-rw-r--r--crypto/bio/bf_buff.c4
-rw-r--r--crypto/bio/bf_lbuf.c4
-rw-r--r--crypto/bio/bf_nbio.c4
-rw-r--r--crypto/bio/bf_null.c4
-rw-r--r--crypto/bio/bss_acpt.c4
-rw-r--r--crypto/bio/bss_conn.c4
-rw-r--r--crypto/bio/bss_dgram.c12
-rw-r--r--crypto/bio/bss_fd.c6
-rw-r--r--crypto/bio/bss_log.c4
-rw-r--r--crypto/bio/bss_mem.c2
-rw-r--r--crypto/bio/bss_null.c4
-rw-r--r--crypto/bio/bss_sock.c6
-rw-r--r--crypto/bn/bn_div.c6
-rw-r--r--crypto/bn/bn_lib.c12
-rw-r--r--crypto/bn/bn_mont.c6
-rw-r--r--crypto/bn/bn_mul.c2
-rw-r--r--crypto/bn/bn_prime.c2
-rw-r--r--crypto/bn/bn_recp.c4
-rw-r--r--crypto/bn/bn_shift.c12
-rw-r--r--crypto/bn/bn_word.c8
-rw-r--r--crypto/des/rand_key.c2
-rw-r--r--crypto/des/set_key.c4
-rw-r--r--crypto/dh/dh_key.c4
-rw-r--r--crypto/dsa/dsa_asn1.c2
-rw-r--r--crypto/dsa/dsa_ossl.c4
-rw-r--r--crypto/dso/dso_dl.c6
-rw-r--r--crypto/dso/dso_dlfcn.c6
-rw-r--r--crypto/dso/dso_lib.c4
-rw-r--r--crypto/dso/dso_vms.c6
-rw-r--r--crypto/dso/dso_win32.c6
-rw-r--r--crypto/evp/encode.c4
-rw-r--r--crypto/evp/evp_enc.c2
-rw-r--r--crypto/pkcs7/pk7_doit.c6
-rw-r--r--crypto/pkcs7/pk7_lib.c14
-rw-r--r--crypto/txt_db/txt_db.c4
-rw-r--r--crypto/whrlpool/wp_dgst.c6
-rw-r--r--crypto/x509/t_req.c2
-rw-r--r--crypto/x509/t_x509.c2
-rw-r--r--crypto/x509/x509_d2.c4
-rw-r--r--crypto/x509/x509_set.c2
-rw-r--r--crypto/x509/x509_v3.c4
-rw-r--r--crypto/x509/x509name.c4
-rw-r--r--ssl/bio_ssl.c2
-rw-r--r--ssl/record/rec_layer_d1.c6
-rw-r--r--ssl/record/ssl3_record.c8
-rw-r--r--ssl/s3_enc.c4
-rw-r--r--ssl/s3_lib.c12
-rw-r--r--ssl/s3_msg.c2
-rw-r--r--ssl/ssl_lib.c6
-rw-r--r--ssl/ssl_sess.c8
-rw-r--r--ssl/ssl_txt.c4
-rw-r--r--ssl/statem/statem_lib.c2
-rw-r--r--ssl/t1_enc.c4
-rw-r--r--ssl/tls_srp.c8
64 files changed, 152 insertions, 152 deletions
diff --git a/apps/apps.c b/apps/apps.c
index 6f93249391..16c99aae5b 100644
--- a/apps/apps.c
+++ b/apps/apps.c
@@ -109,13 +109,13 @@ int chopup_args(ARGS *arg, char *buf)
}
}
arg->argv[arg->argc] = NULL;
- return (1);
+ return 1;
}
#ifndef APP_INIT
int app_init(long mesgwin)
{
- return (1);
+ return 1;
}
#endif
diff --git a/apps/openssl.c b/apps/openssl.c
index 3b347ba11e..402a818a83 100644
--- a/apps/openssl.c
+++ b/apps/openssl.c
@@ -571,7 +571,7 @@ static int do_cmd(LHASH_OF(FUNCTION) *prog, int argc, char *argv[])
BIO_printf(bio_err, "Invalid command '%s'; type \"help\" for a list.\n",
argv[0]);
- return (1);
+ return 1;
}
static void list_pkey(void)
diff --git a/apps/rehash.c b/apps/rehash.c
index 8bb9a14ef6..c14bce4007 100644
--- a/apps/rehash.c
+++ b/apps/rehash.c
@@ -518,7 +518,7 @@ const OPTIONS rehash_options[] = {
int rehash_main(int argc, char **argv)
{
BIO_printf(bio_err, "Not available; use c_rehash script\n");
- return (1);
+ return 1;
}
#endif /* defined(OPENSSL_SYS_UNIX) || defined(__APPLE__) */
diff --git a/apps/s_cb.c b/apps/s_cb.c
index cb5d18c083..e82d4d036c 100644
--- a/apps/s_cb.c
+++ b/apps/s_cb.c
@@ -137,7 +137,7 @@ int set_cert_stuff(SSL_CTX *ctx, char *cert_file, char *key_file)
return (0);
}
}
- return (1);
+ return 1;
}
int set_cert_key_stuff(SSL_CTX *ctx, X509 *cert, EVP_PKEY *key,
diff --git a/apps/s_server.c b/apps/s_server.c
index b22f08311b..ea23d892e7 100644
--- a/apps/s_server.c
+++ b/apps/s_server.c
@@ -2760,7 +2760,7 @@ static int init_ssl_connection(SSL *con)
if ((dtlslisten && i == 0)
|| (!dtlslisten && retry)) {
BIO_printf(bio_s_out, "DELAY\n");
- return (1);
+ return 1;
}
BIO_printf(bio_err, "ERROR\n");
diff --git a/crypto/asn1/a_bitstr.c b/crypto/asn1/a_bitstr.c
index b2e0fb6882..b192621551 100644
--- a/crypto/asn1/a_bitstr.c
+++ b/crypto/asn1/a_bitstr.c
@@ -24,7 +24,7 @@ int i2c_ASN1_BIT_STRING(ASN1_BIT_STRING *a, unsigned char **pp)
unsigned char *p, *d;
if (a == NULL)
- return (0);
+ return 0;
len = a->length;
@@ -175,7 +175,7 @@ int ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value)
a->data[w] = ((a->data[w]) & iv) | v;
while ((a->length > 0) && (a->data[a->length - 1] == 0))
a->length--;
- return (1);
+ return 1;
}
int ASN1_BIT_STRING_get_bit(const ASN1_BIT_STRING *a, int n)
@@ -185,7 +185,7 @@ int ASN1_BIT_STRING_get_bit(const ASN1_BIT_STRING *a, int n)
w = n / 8;
v = 1 << (7 - (n & 0x07));
if ((a == NULL) || (a->length < (w + 1)) || (a->data == NULL))
- return (0);
+ return 0;
return ((a->data[w] & v) != 0);
}
diff --git a/crypto/asn1/a_digest.c b/crypto/asn1/a_digest.c
index c84ecc9b4b..5945041d82 100644
--- a/crypto/asn1/a_digest.c
+++ b/crypto/asn1/a_digest.c
@@ -39,7 +39,7 @@ int ASN1_digest(i2d_of_void *i2d, const EVP_MD *type, char *data,
return 0;
}
OPENSSL_free(str);
- return (1);
+ return 1;
}
#endif
@@ -59,5 +59,5 @@ int ASN1_item_digest(const ASN1_ITEM *it, const EVP_MD *type, void *asn,
return 0;
}
OPENSSL_free(str);
- return (1);
+ return 1;
}
diff --git a/crypto/asn1/a_print.c b/crypto/asn1/a_print.c
index ed72b51926..fd466d287c 100644
--- a/crypto/asn1/a_print.c
+++ b/crypto/asn1/a_print.c
@@ -62,7 +62,7 @@ int ASN1_UNIVERSALSTRING_to_string(ASN1_UNIVERSALSTRING *s)
*(p) = '\0';
s->length /= 4;
s->type = ASN1_PRINTABLE_type(s->data, s->length);
- return (1);
+ return 1;
}
int ASN1_STRING_print(BIO *bp, const ASN1_STRING *v)
@@ -91,5 +91,5 @@ int ASN1_STRING_print(BIO *bp, const ASN1_STRING *v)
if (n > 0)
if (BIO_write(bp, buf, n) <= 0)
return (0);
- return (1);
+ return 1;
}
diff --git a/crypto/asn1/evp_asn1.c b/crypto/asn1/evp_asn1.c
index f3b675e379..d115911d0f 100644
--- a/crypto/asn1/evp_asn1.c
+++ b/crypto/asn1/evp_asn1.c
@@ -23,7 +23,7 @@ int ASN1_TYPE_set_octetstring(ASN1_TYPE *a, unsigned char *data, int len)
return 0;
}
ASN1_TYPE_set(a, V_ASN1_OCTET_STRING, os);
- return (1);
+ return 1;
}
/* int max_len: for returned value */
diff --git a/crypto/bio/b_sock.c b/crypto/bio/b_sock.c
index 65339629f8..270d1a5966 100644
--- a/crypto/bio/b_sock.c
+++ b/crypto/bio/b_sock.c
@@ -153,7 +153,7 @@ int BIO_sock_init(void)
return (-1);
# endif
- return (1);
+ return 1;
}
void bio_sock_cleanup_int(void)
diff --git a/crypto/bio/bf_buff.c b/crypto/bio/bf_buff.c
index 255a4d476e..0b3fe5f104 100644
--- a/crypto/bio/bf_buff.c
+++ b/crypto/bio/bf_buff.c
@@ -67,7 +67,7 @@ static int buffer_new(BIO *bi)
bi->init = 1;
bi->ptr = (char *)ctx;
bi->flags = 0;
- return (1);
+ return 1;
}
static int buffer_free(BIO *a)
@@ -83,7 +83,7 @@ static int buffer_free(BIO *a)
a->ptr = NULL;
a->init = 0;
a->flags = 0;
- return (1);
+ return 1;
}
static int buffer_read(BIO *b, char *out, int outl)
diff --git a/crypto/bio/bf_lbuf.c b/crypto/bio/bf_lbuf.c
index 0cee526bfd..742271fdca 100644
--- a/crypto/bio/bf_lbuf.c
+++ b/crypto/bio/bf_lbuf.c
@@ -73,7 +73,7 @@ static int linebuffer_new(BIO *bi)
bi->init = 1;
bi->ptr = (char *)ctx;
bi->flags = 0;
- return (1);
+ return 1;
}
static int linebuffer_free(BIO *a)
@@ -88,7 +88,7 @@ static int linebuffer_free(BIO *a)
a->ptr = NULL;
a->init = 0;
a->flags = 0;
- return (1);
+ return 1;
}
static int linebuffer_read(BIO *b, char *out, int outl)
diff --git a/crypto/bio/bf_nbio.c b/crypto/bio/bf_nbio.c
index 1d98a942f3..455cdde1c5 100644
--- a/crypto/bio/bf_nbio.c
+++ b/crypto/bio/bf_nbio.c
@@ -63,7 +63,7 @@ static int nbiof_new(BIO *bi)
nt->lwn = -1;
bi->ptr = (char *)nt;
bi->init = 1;
- return (1);
+ return 1;
}
static int nbiof_free(BIO *a)
@@ -74,7 +74,7 @@ static int nbiof_free(BIO *a)
a->ptr = NULL;
a->init = 0;
a->flags = 0;
- return (1);
+ return 1;
}
static int nbiof_read(BIO *b, char *out, int outl)
diff --git a/crypto/bio/bf_null.c b/crypto/bio/bf_null.c
index ff2a04ccd8..fb1e9c26ff 100644
--- a/crypto/bio/bf_null.c
+++ b/crypto/bio/bf_null.c
@@ -51,7 +51,7 @@ static int nullf_new(BIO *bi)
bi->init = 1;
bi->ptr = NULL;
bi->flags = 0;
- return (1);
+ return 1;
}
static int nullf_free(BIO *a)
@@ -63,7 +63,7 @@ static int nullf_free(BIO *a)
a->init=0;
a->flags=0;
*/
- return (1);
+ return 1;
}
static int nullf_read(BIO *b, char *out, int outl)
diff --git a/crypto/bio/bss_acpt.c b/crypto/bio/bss_acpt.c
index dda637db7f..ecb115762e 100644
--- a/crypto/bio/bss_acpt.c
+++ b/crypto/bio/bss_acpt.c
@@ -85,7 +85,7 @@ static int acpt_new(BIO *bi)
bi->ptr = (char *)ba;
ba->state = ACPT_S_BEFORE;
bi->shutdown = 1;
- return (1);
+ return 1;
}
static BIO_ACCEPT *BIO_ACCEPT_new(void)
@@ -143,7 +143,7 @@ static int acpt_free(BIO *a)
a->flags = 0;
a->init = 0;
}
- return (1);
+ return 1;
}
static int acpt_state(BIO *b, BIO_ACCEPT *c)
diff --git a/crypto/bio/bss_conn.c b/crypto/bio/bss_conn.c
index 5562efaa3b..7c6c9a45df 100644
--- a/crypto/bio/bss_conn.c
+++ b/crypto/bio/bss_conn.c
@@ -254,7 +254,7 @@ static int conn_new(BIO *bi)
if ((bi->ptr = (char *)BIO_CONNECT_new()) == NULL)
return (0);
else
- return (1);
+ return 1;
}
static void conn_close_socket(BIO *bio)
@@ -286,7 +286,7 @@ static int conn_free(BIO *a)
a->flags = 0;
a->init = 0;
}
- return (1);
+ return 1;
}
static int conn_read(BIO *b, char *out, int outl)
diff --git a/crypto/bio/bss_dgram.c b/crypto/bio/bss_dgram.c
index f886b07333..28fc7a50d5 100644
--- a/crypto/bio/bss_dgram.c
+++ b/crypto/bio/bss_dgram.c
@@ -157,7 +157,7 @@ static int dgram_new(BIO *bi)
if (data == NULL)
return 0;
bi->ptr = data;
- return (1);
+ return 1;
}
static int dgram_free(BIO *a)
@@ -172,7 +172,7 @@ static int dgram_free(BIO *a)
data = (bio_dgram_data *)a->ptr;
OPENSSL_free(data);
- return (1);
+ return 1;
}
static int dgram_clear(BIO *a)
@@ -186,7 +186,7 @@ static int dgram_clear(BIO *a)
a->init = 0;
a->flags = 0;
}
- return (1);
+ return 1;
}
static void dgram_adjust_rcv_timeout(BIO *b)
@@ -969,7 +969,7 @@ static int dgram_sctp_new(BIO *bi)
bi->ptr = data;
bi->flags = 0;
- return (1);
+ return 1;
}
static int dgram_sctp_free(BIO *a)
@@ -985,7 +985,7 @@ static int dgram_sctp_free(BIO *a)
if (data != NULL)
OPENSSL_free(data);
- return (1);
+ return 1;
}
# ifdef SCTP_AUTHENTICATION_EVENT
@@ -1895,7 +1895,7 @@ int BIO_dgram_non_fatal_error(int err)
case EALREADY:
# endif
- return (1);
+ return 1;
default:
break;
}
diff --git a/crypto/bio/bss_fd.c b/crypto/bio/bss_fd.c
index 2a9a0422a2..9fcaaa60d9 100644
--- a/crypto/bio/bss_fd.c
+++ b/crypto/bio/bss_fd.c
@@ -94,7 +94,7 @@ static int fd_new(BIO *bi)
bi->num = -1;
bi->ptr = NULL;
bi->flags = BIO_FLAGS_UPLINK; /* essentially redundant */
- return (1);
+ return 1;
}
static int fd_free(BIO *a)
@@ -108,7 +108,7 @@ static int fd_free(BIO *a)
a->init = 0;
a->flags = BIO_FLAGS_UPLINK;
}
- return (1);
+ return 1;
}
static int fd_read(BIO *b, char *out, int outl)
@@ -270,7 +270,7 @@ int BIO_fd_non_fatal_error(int err)
# ifdef EALREADY
case EALREADY:
# endif
- return (1);
+ return 1;
default:
break;
}
diff --git a/crypto/bio/bss_log.c b/crypto/bio/bss_log.c
index 963371ed25..181ab9c58f 100644
--- a/crypto/bio/bss_log.c
+++ b/crypto/bio/bss_log.c
@@ -110,7 +110,7 @@ static int slg_new(BIO *bi)
bi->num = 0;
bi->ptr = NULL;
xopenlog(bi, "application", LOG_DAEMON);
- return (1);
+ return 1;
}
static int slg_free(BIO *a)
@@ -118,7 +118,7 @@ static int slg_free(BIO *a)
if (a == NULL)
return (0);
xcloselog(a);
- return (1);
+ return 1;
}
static int slg_write(BIO *b, const char *in, int inl)
diff --git a/crypto/bio/bss_mem.c b/crypto/bio/bss_mem.c
index 38ffb1025d..49ac1da024 100644
--- a/crypto/bio/bss_mem.c
+++ b/crypto/bio/bss_mem.c
@@ -165,7 +165,7 @@ static int mem_buf_free(BIO *a, int free_all)
a->ptr = NULL;
}
}
- return (1);
+ return 1;
}
/*
diff --git a/crypto/bio/bss_null.c b/crypto/bio/bss_null.c
index d197a609bd..14964d3985 100644
--- a/crypto/bio/bss_null.c
+++ b/crypto/bio/bss_null.c
@@ -46,14 +46,14 @@ static int null_new(BIO *bi)
bi->init = 1;
bi->num = 0;
bi->ptr = (NULL);
- return (1);
+ return 1;
}
static int null_free(BIO *a)
{
if (a == NULL)
return (0);
- return (1);
+ return 1;
}
static int null_read(BIO *b, char *out, int outl)
diff --git a/crypto/bio/bss_sock.c b/crypto/bio/bss_sock.c
index 71be1cde83..6ff0f663ed 100644
--- a/crypto/bio/bss_sock.c
+++ b/crypto/bio/bss_sock.c
@@ -73,7 +73,7 @@ static int sock_new(BIO *bi)
bi->num = 0;
bi->ptr = NULL;
bi->flags = 0;
- return (1);
+ return 1;
}
static int sock_free(BIO *a)
@@ -87,7 +87,7 @@ static int sock_free(BIO *a)
a->init = 0;
a->flags = 0;
}
- return (1);
+ return 1;
}
static int sock_read(BIO *b, char *out, int outl)
@@ -223,7 +223,7 @@ int BIO_sock_non_fatal_error(int err)
# ifdef EALREADY
case EALREADY:
# endif
- return (1);
+ return 1;
default:
break;
}
diff --git a/crypto/bn/bn_div.c b/crypto/bn/bn_div.c
index bd49e07dbc..6801eccdd1 100644
--- a/crypto/bn/bn_div.c
+++ b/crypto/bn/bn_div.c
@@ -34,7 +34,7 @@ int BN_div(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m, const BIGNUM *d,
}
if (dv != NULL)
BN_zero(dv);
- return (1);
+ return 1;
}
BN_CTX_start(ctx);
@@ -187,7 +187,7 @@ int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor,
}
if (dv != NULL)
BN_zero(dv);
- return (1);
+ return 1;
}
BN_CTX_start(ctx);
@@ -411,7 +411,7 @@ int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor,
if (no_branch)
bn_correct_top(res);
BN_CTX_end(ctx);
- return (1);
+ return 1;
err:
bn_check_top(rm);
BN_CTX_end(ctx);
diff --git a/crypto/bn/bn_lib.c b/crypto/bn/bn_lib.c
index f0a3bf1e3d..d22a83fc34 100644
--- a/crypto/bn/bn_lib.c
+++ b/crypto/bn/bn_lib.c
@@ -404,7 +404,7 @@ int BN_set_word(BIGNUM *a, BN_ULONG w)
a->d[0] = w;
a->top = (w ? 1 : 0);
bn_check_top(a);
- return (1);
+ return 1;
}
BIGNUM *BN_bin2bn(const unsigned char *s, int len, BIGNUM *ret)
@@ -587,7 +587,7 @@ int BN_cmp(const BIGNUM *a, const BIGNUM *b)
if (a != NULL)
return (-1);
else if (b != NULL)
- return (1);
+ return 1;
else
return (0);
}
@@ -599,7 +599,7 @@ int BN_cmp(const BIGNUM *a, const BIGNUM *b)
if (a->neg)
return (-1);
else
- return (1);
+ return 1;
}
if (a->neg == 0) {
gt = 1;
@@ -643,7 +643,7 @@ int BN_set_bit(BIGNUM *a, int n)
a->d[i] |= (((BN_ULONG)1) << j);
bn_check_top(a);
- return (1);
+ return 1;
}
int BN_clear_bit(BIGNUM *a, int n)
@@ -661,7 +661,7 @@ int BN_clear_bit(BIGNUM *a, int n)
a->d[i] &= (~(((BN_ULONG)1) << j));
bn_correct_top(a);
- return (1);
+ return 1;
}
int BN_is_bit_set(const BIGNUM *a, int n)
@@ -697,7 +697,7 @@ int BN_mask_bits(BIGNUM *a, int n)
a->d[w] &= ~(BN_MASK2 << b);
}
bn_correct_top(a);
- return (1);
+ return 1;
}
void BN_set_negative(BIGNUM *a, int b)
diff --git a/crypto/bn/bn_mont.c b/crypto/bn/bn_mont.c
index 975689432a..3585757da7 100644
--- a/crypto/bn/bn_mont.c
+++ b/crypto/bn/bn_mont.c
@@ -38,7 +38,7 @@ int BN_mod_mul_montgomery(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
r->neg = a->neg ^ b->neg;
r->top = num;
bn_correct_top(r);
- return (1);
+ return 1;
}
}
#endif
@@ -82,7 +82,7 @@ static int BN_from_montgomery_word(BIGNUM *ret, BIGNUM *r, BN_MONT_CTX *mont)
nl = n->top;
if (nl == 0) {
ret->top = 0;
- return (1);
+ return 1;
}
max = (2 * nl); /* carry is stored separately */
@@ -159,7 +159,7 @@ static int BN_from_montgomery_word(BIGNUM *ret, BIGNUM *r, BN_MONT_CTX *mont)
bn_correct_top(ret);
bn_check_top(ret);
- return (1);
+ return 1;
}
#endif /* MONT_WORD */
diff --git a/crypto/bn/bn_mul.c b/crypto/bn/bn_mul.c
index 36d1b4ecc8..fd6b4c2429 100644
--- a/crypto/bn/bn_mul.c
+++ b/crypto/bn/bn_mul.c
@@ -516,7 +516,7 @@ int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)
if ((al == 0) || (bl == 0)) {
BN_zero(r);
- return (1);
+ return 1;
}
top = al + bl;
diff --git a/crypto/bn/bn_prime.c b/crypto/bn/bn_prime.c
index 026c119c13..0b98618a18 100644
--- a/crypto/bn/bn_prime.c
+++ b/