Skip to content

Commit 845c37f

Browse files
committed
Fixed spacing and inline declarations
1 parent fa95ace commit 845c37f

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

Diff for: crypto/bio/bio.c

+11-14
Original file line numberDiff line numberDiff line change
@@ -115,19 +115,17 @@ static long callback_fn_wrap_ex(BIO *bio, int oper, const char *argp,
115115
return ret;
116116
}
117117

118-
// |get_callback| returns the appropriate callback function for a given |BIO|, preferring
119-
// the extended interface |callback_ex| over the legacy interface.
118+
// |get_callback| returns the appropriate callback function for a given |BIO|, preferring
119+
// the extended interface |callback_ex| over the legacy interface.
120120
//
121-
// When only the legacy callback is available, it is wrapped in the extended format
122-
// via |callback_fn_wrap_ex| to provide a consistent interface. The extended callback
123-
// provides additional parameters for length and bytes processed tracking.
121+
// When only the legacy callback is available, it is wrapped in the extended format
122+
// via |callback_fn_wrap_ex| to provide a consistent interface. The extended callback
123+
// provides additional parameters for length and bytes processed tracking.
124124
//
125-
// Returns the |callback_ex| function if available, a wrapped legacy callback if only
126-
// |callback| is set, or NULL if no callbacks are set.
125+
// Returns the |callback_ex| function if available, a wrapped legacy callback if only
126+
// |callback| is set, or NULL if no callbacks are set.
127127
static BIO_callback_fn_ex get_callback(BIO *bio) {
128-
if (bio == NULL) {
129-
return NULL;
130-
}
128+
assert(bio != NULL);
131129

132130
if (bio->callback_ex != NULL) {
133131
return bio->callback_ex;
@@ -251,7 +249,6 @@ void BIO_free_all(BIO *bio) {
251249
}
252250

253251
int BIO_read(BIO *bio, void *buf, int len) {
254-
int ret = 0;
255252

256253
if (bio == NULL || bio->method == NULL || bio->method->bread == NULL) {
257254
OPENSSL_PUT_ERROR(BIO, BIO_R_UNSUPPORTED_METHOD);
@@ -276,7 +273,7 @@ int BIO_read(BIO *bio, void *buf, int len) {
276273
OPENSSL_PUT_ERROR(BIO, BIO_R_UNINITIALIZED);
277274
return -2;
278275
}
279-
ret = bio->method->bread(bio, buf, len);
276+
int ret = bio->method->bread(bio, buf, len);
280277

281278
return handle_callback_return(bio, BIO_CB_READ, buf, len, ret);
282279
}
@@ -332,7 +329,7 @@ int BIO_gets(BIO *bio, char *buf, int len) {
332329
}
333330

334331
int BIO_write(BIO *bio, const void *in, int inl) {
335-
int ret = 0;
332+
336333
if (bio == NULL || bio->method == NULL || bio->method->bwrite == NULL) {
337334
OPENSSL_PUT_ERROR(BIO, BIO_R_UNSUPPORTED_METHOD);
338335
return -2;
@@ -356,7 +353,7 @@ int BIO_write(BIO *bio, const void *in, int inl) {
356353
OPENSSL_PUT_ERROR(BIO, BIO_R_UNINITIALIZED);
357354
return -2;
358355
}
359-
ret = bio->method->bwrite(bio, in, inl);
356+
int ret = bio->method->bwrite(bio, in, inl);
360357

361358
return handle_callback_return(bio, BIO_CB_WRITE, in, inl, ret);
362359
}

0 commit comments

Comments
 (0)