diff options
author | Matt Caswell <matt@openssl.org> | 2016-10-21 15:15:51 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2016-10-28 09:48:54 +0100 |
commit | 42c6046064d2ee45d59baec53bedde4ea434294f (patch) | |
tree | f89d9b3365cf44e739850ac6a75ac63a328acd29 /crypto | |
parent | f42fd819d60c5ebbcfd7bff6173b89664ab2fde1 (diff) |
More parameter naming of BIO_read*/BIO_write* related functions
Based on feedback received.
Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/bio/bio_lib.c | 41 | ||||
-rw-r--r-- | crypto/bio/bio_meth.c | 16 |
2 files changed, 29 insertions, 28 deletions
diff --git a/crypto/bio/bio_lib.c b/crypto/bio/bio_lib.c index 6d958b1e92..1a9b9137ba 100644 --- a/crypto/bio/bio_lib.c +++ b/crypto/bio/bio_lib.c @@ -250,7 +250,7 @@ int BIO_method_type(const BIO *b) * is for compatibility with the old style BIO_read(), where existing code may * make assumptions about the return value that it might get. */ -static int bio_read_intern(BIO *b, void *out, size_t outl, size_t *read) +static int bio_read_intern(BIO *b, void *data, size_t datal, size_t *read) { int ret; @@ -260,7 +260,7 @@ static int bio_read_intern(BIO *b, void *out, size_t outl, size_t *read) } if ((b->callback != NULL || b->callback_ex != NULL) && - ((ret = (int)bio_call_callback(b, BIO_CB_READ, out, outl, 0, 0L, 1L, + ((ret = (int)bio_call_callback(b, BIO_CB_READ, data, datal, 0, 0L, 1L, read)) <= 0)) return ret; @@ -269,27 +269,27 @@ static int bio_read_intern(BIO *b, void *out, size_t outl, size_t *read) return -2; } - ret = b->method->bread(b, out, outl, read); + ret = b->method->bread(b, data, datal, read); if (ret > 0) b->num_read += (uint64_t)*read; if (b->callback != NULL || b->callback_ex != NULL) - ret = (int)bio_call_callback(b, BIO_CB_READ | BIO_CB_RETURN, out, outl, - 0, 0L, ret, read); + ret = (int)bio_call_callback(b, BIO_CB_READ | BIO_CB_RETURN, data, + datal, 0, 0L, ret, read); return ret; } -int BIO_read(BIO *b, void *out, int outl) +int BIO_read(BIO *b, void *data, int datal) { size_t read; int ret; - if (outl < 0) + if (datal < 0) return 0; - ret = bio_read_intern(b, out, (size_t)outl, &read); + ret = bio_read_intern(b, data, (size_t)datal, &read); if (ret > 0) { /* *read should always be <= outl */ @@ -299,11 +299,11 @@ int BIO_read(BIO *b, void *out, int outl) return ret; } -int BIO_read_ex(BIO *b, void *out, size_t outl, size_t *read) +int BIO_read_ex(BIO *b, void *data, size_t datal, size_t *read) { int ret; - ret = bio_read_intern(b, out, outl, read); + ret = bio_read_intern(b, data, datal, read); if (ret > 0) ret = 1; @@ -313,7 +313,8 @@ int BIO_read_ex(BIO *b, void *out, size_t outl, size_t *read) return ret; } -static int bio_write_intern(BIO *b, const void *in, size_t inl, size_t *written) +static int bio_write_intern(BIO *b, const void *data, size_t datal, + size_t *written) { int ret; @@ -326,7 +327,7 @@ static int bio_write_intern(BIO *b, const void *in, size_t inl, size_t *written) } if ((b->callback != NULL || b->callback_ex != NULL) && - ((ret = (int)bio_call_callback(b, BIO_CB_WRITE, in, inl, 0, 0L, 1L, + ((ret = (int)bio_call_callback(b, BIO_CB_WRITE, data, datal, 0, 0L, 1L, written)) <= 0)) return ret; @@ -335,27 +336,27 @@ static int bio_write_intern(BIO *b, const void *in, size_t inl, size_t *written) return -2; } - ret = b->method->bwrite(b, in, inl, written); + ret = b->method->bwrite(b, data, datal, written); if (ret > 0) b->num_write += (uint64_t)*written; if (b->callback != NULL || b->callback_ex != NULL) - ret = (int)bio_call_callback(b, BIO_CB_WRITE | BIO_CB_RETURN, in, inl, - 0, 0L, ret, written); + ret = (int)bio_call_callback(b, BIO_CB_WRITE | BIO_CB_RETURN, data, + datal, 0, 0L, ret, written); return ret; } -int BIO_write(BIO *b, const void *in, int inl) +int BIO_write(BIO *b, const void *data, int datal) { size_t written; int ret; - if (inl < 0) + if (datal < 0) return 0; - ret = bio_write_intern(b, in, (size_t)inl, &written); + ret = bio_write_intern(b, data, (size_t)datal, &written); if (ret > 0) { /* *written should always be <= inl */ @@ -365,11 +366,11 @@ int BIO_write(BIO *b, const void *in, int inl) return ret; } -int BIO_write_ex(BIO *b, const void *in, size_t inl, size_t *written) +int BIO_write_ex(BIO *b, const void *data, size_t datal, size_t *written) { int ret; - ret = bio_write_intern(b, in, inl, written); + ret = bio_write_intern(b, data, datal, written); if (ret > 0) ret = 1; diff --git a/crypto/bio/bio_meth.c b/crypto/bio/bio_meth.c index ea3155f3fa..5eaa1fd461 100644 --- a/crypto/bio/bio_meth.c +++ b/crypto/bio/bio_meth.c @@ -61,14 +61,14 @@ int (*BIO_meth_get_write_ex(BIO_METHOD *biom)) (BIO *, const char *, size_t, } /* Conversion for old style bwrite to new style */ -int bwrite_conv(BIO *bio, const char *in, size_t inl, size_t *written) +int bwrite_conv(BIO *bio, const char *data, size_t datal, size_t *written) { int ret; - if (inl > INT_MAX) - inl = INT_MAX; + if (datal > INT_MAX) + datal = INT_MAX; - ret = bio->method->bwrite_old(bio, in, (int)inl); + ret = bio->method->bwrite_old(bio, data, (int)datal); if (ret <= 0) { *written = 0; @@ -107,14 +107,14 @@ int (*BIO_meth_get_read_ex(BIO_METHOD *biom)) (BIO *, char *, size_t, size_t *) } /* Conversion for old style bread to new style */ -int bread_conv(BIO *bio, char *out, size_t outl, size_t *read) +int bread_conv(BIO *bio, char *data, size_t datal, size_t *read) { int ret; - if (outl > INT_MAX) - outl = INT_MAX; + if (datal > INT_MAX) + datal = INT_MAX; - ret = bio->method->bread_old(bio, out, (int)outl); + ret = bio->method->bread_old(bio, data, (int)datal); if (ret <= 0) { *read = 0; |