Skip to content

Commit

Permalink
Since return is inconsistent, I removed unnecessary parentheses and
Browse files Browse the repository at this point in the history
unified them.
- return (0); -> return 0;
- return (1); -> return 1;
- return (-1); -> return -1;

Reviewed-by: Stephen Henson <[email protected]>
Reviewed-by: Matt Caswell <[email protected]>
(Merged from openssl#4500)
  • Loading branch information
KaoruToda authored and mattcaswell committed Oct 9, 2017
1 parent 2e8b5d7 commit 208fb89
Show file tree
Hide file tree
Showing 64 changed files with 152 additions and 152 deletions.
4 changes: 2 additions & 2 deletions apps/apps.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion apps/openssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion apps/rehash.c
Original file line number Diff line number Diff line change
Expand Up @@ -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__) */
2 changes: 1 addition & 1 deletion apps/s_cb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion apps/s_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
6 changes: 3 additions & 3 deletions crypto/asn1/a_bitstr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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)
Expand All @@ -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);
}

Expand Down
4 changes: 2 additions & 2 deletions crypto/asn1/a_digest.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
}
4 changes: 2 additions & 2 deletions crypto/asn1/a_print.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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;
}
2 changes: 1 addition & 1 deletion crypto/asn1/evp_asn1.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion crypto/bio/b_sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ int BIO_sock_init(void)
return (-1);
# endif

return (1);
return 1;
}

void bio_sock_cleanup_int(void)
Expand Down
4 changes: 2 additions & 2 deletions crypto/bio/bf_buff.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions crypto/bio/bf_lbuf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions crypto/bio/bf_nbio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions crypto/bio/bf_null.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions crypto/bio/bss_acpt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions crypto/bio/bss_conn.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
12 changes: 6 additions & 6 deletions crypto/bio/bss_dgram.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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)
Expand All @@ -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
Expand Down Expand Up @@ -1895,7 +1895,7 @@ int BIO_dgram_non_fatal_error(int err)
case EALREADY:
# endif

return (1);
return 1;
default:
break;
}
Expand Down
6 changes: 3 additions & 3 deletions crypto/bio/bss_fd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -270,7 +270,7 @@ int BIO_fd_non_fatal_error(int err)
# ifdef EALREADY
case EALREADY:
# endif
return (1);
return 1;
default:
break;
}
Expand Down
4 changes: 2 additions & 2 deletions crypto/bio/bss_log.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,15 @@ 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)
{
if (a == NULL)
return (0);
xcloselog(a);
return (1);
return 1;
}

static int slg_write(BIO *b, const char *in, int inl)
Expand Down
2 changes: 1 addition & 1 deletion crypto/bio/bss_mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ static int mem_buf_free(BIO *a, int free_all)
a->ptr = NULL;
}
}
return (1);
return 1;
}

/*
Expand Down
4 changes: 2 additions & 2 deletions crypto/bio/bss_null.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions crypto/bio/bss_sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -223,7 +223,7 @@ int BIO_sock_non_fatal_error(int err)
# ifdef EALREADY
case EALREADY:
# endif
return (1);
return 1;
default:
break;
}
Expand Down
Loading

0 comments on commit 208fb89

Please sign in to comment.