]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Author: Ross Kinsey <RossIKinsey@gmail.com>
authorRoss Kinsey <RossIKinsey@gmail.com>
Wed, 5 Feb 2020 03:47:05 +0000 (13:47 +1000)
committerShane Lontis <shane.lontis@oracle.com>
Wed, 5 Feb 2020 03:47:05 +0000 (13:47 +1000)
Date:   Wed Jan 29 00:19:40 2020 -0500

Removed unnecessary switch statements from bio/bf_* callback_ctrl functions

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/10967)

crypto/bio/bf_buff.c
crypto/bio/bf_lbuf.c
crypto/bio/bf_nbio.c
crypto/bio/bf_null.c

index 80db0b57abe4ad4e30107aa60b6c684e437cf82c..df7c5e99bacc0ea6350dda71d3ac618e2dd93d75 100644 (file)
@@ -410,16 +410,9 @@ static long buffer_ctrl(BIO *b, int cmd, long num, void *ptr)
 
 static long buffer_callback_ctrl(BIO *b, int cmd, BIO_info_cb *fp)
 {
-    long ret = 1;
-
     if (b->next_bio == NULL)
         return 0;
-    switch (cmd) {
-    default:
-        ret = BIO_callback_ctrl(b->next_bio, cmd, fp);
-        break;
-    }
-    return ret;
+    return BIO_callback_ctrl(b->next_bio, cmd, fp);
 }
 
 static int buffer_gets(BIO *b, char *buf, int size)
index 6b5a241a0ea93c66078d6ceafd99f69db5cd2b8c..32091195bf3b2e39b635bd2cbd09bed2e2c1dd64 100644 (file)
@@ -301,16 +301,9 @@ static long linebuffer_ctrl(BIO *b, int cmd, long num, void *ptr)
 
 static long linebuffer_callback_ctrl(BIO *b, int cmd, BIO_info_cb *fp)
 {
-    long ret = 1;
-
     if (b->next_bio == NULL)
         return 0;
-    switch (cmd) {
-    default:
-        ret = BIO_callback_ctrl(b->next_bio, cmd, fp);
-        break;
-    }
-    return ret;
+    return BIO_callback_ctrl(b->next_bio, cmd, fp);
 }
 
 static int linebuffer_gets(BIO *b, char *buf, int size)
index 6f6ccfb1a83f87d36815e578091a8e91d1720701..36deeb82f0f1e8ff82bf839155193942ea997cdd 100644 (file)
@@ -173,16 +173,9 @@ static long nbiof_ctrl(BIO *b, int cmd, long num, void *ptr)
 
 static long nbiof_callback_ctrl(BIO *b, int cmd, BIO_info_cb *fp)
 {
-    long ret = 1;
-
     if (b->next_bio == NULL)
         return 0;
-    switch (cmd) {
-    default:
-        ret = BIO_callback_ctrl(b->next_bio, cmd, fp);
-        break;
-    }
-    return ret;
+    return BIO_callback_ctrl(b->next_bio, cmd, fp);
 }
 
 static int nbiof_gets(BIO *bp, char *buf, int size)
index e548bdc90da1033ce0eff4516db72918df68d6b2..ba693af0a7738b9a91e07c7fd3c3469789ef632e 100644 (file)
@@ -95,16 +95,9 @@ static long nullf_ctrl(BIO *b, int cmd, long num, void *ptr)
 
 static long nullf_callback_ctrl(BIO *b, int cmd, BIO_info_cb *fp)
 {
-    long ret = 1;
-
     if (b->next_bio == NULL)
         return 0;
-    switch (cmd) {
-    default:
-        ret = BIO_callback_ctrl(b->next_bio, cmd, fp);
-        break;
-    }
-    return ret;
+    return BIO_callback_ctrl(b->next_bio, cmd, fp);
 }
 
 static int nullf_gets(BIO *bp, char *buf, int size)