Commit 04f6b0fd authored by David Benjamin's avatar David Benjamin Committed by Rich Salz
Browse files

RT4660: BIO_METHODs should be const.



BIO_new, etc., don't need a non-const BIO_METHOD. This allows all the
built-in method tables to live in .rodata.

Reviewed-by: default avatarRichard Levitte <levitte@openssl.org>
parent 52d86d9b
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -421,7 +421,7 @@ static int ebcdic_gets(BIO *bp, char *buf, int size);
static int ebcdic_puts(BIO *bp, const char *str);

# define BIO_TYPE_EBCDIC_FILTER  (18|0x0200)
static BIO_METHOD methods_ebcdic = {
static const BIO_METHOD methods_ebcdic = {
    BIO_TYPE_EBCDIC_FILTER,
    "EBCDIC/ASCII filter",
    ebcdic_write,
@@ -439,7 +439,7 @@ typedef struct {
    char buff[1];
} EBCDIC_OUTBUFF;

BIO_METHOD *BIO_f_ebcdic_filter()
const BIO_METHOD *BIO_f_ebcdic_filter()
{
    return (&methods_ebcdic);
}
+2 −2
Original line number Diff line number Diff line
@@ -124,7 +124,7 @@ static int asn1_bio_setup_ex(BIO *b, BIO_ASN1_BUF_CTX *ctx,
                             asn1_bio_state_t ex_state,
                             asn1_bio_state_t other_state);

static BIO_METHOD methods_asn1 = {
static const BIO_METHOD methods_asn1 = {
    BIO_TYPE_ASN1,
    "asn1",
    asn1_bio_write,
@@ -137,7 +137,7 @@ static BIO_METHOD methods_asn1 = {
    asn1_bio_callback_ctrl,
};

BIO_METHOD *BIO_f_asn1(void)
const BIO_METHOD *BIO_f_asn1(void)
{
    return (&methods_asn1);
}
+2 −2
Original line number Diff line number Diff line
@@ -70,7 +70,7 @@ static int buffer_free(BIO *data);
static long buffer_callback_ctrl(BIO *h, int cmd, bio_info_cb *fp);
#define DEFAULT_BUFFER_SIZE     4096

static BIO_METHOD methods_buffer = {
static const BIO_METHOD methods_buffer = {
    BIO_TYPE_BUFFER,
    "buffer",
    buffer_write,
@@ -83,7 +83,7 @@ static BIO_METHOD methods_buffer = {
    buffer_callback_ctrl,
};

BIO_METHOD *BIO_f_buffer(void)
const BIO_METHOD *BIO_f_buffer(void)
{
    return (&methods_buffer);
}
+2 −2
Original line number Diff line number Diff line
@@ -75,7 +75,7 @@ static long linebuffer_callback_ctrl(BIO *h, int cmd, bio_info_cb *fp);

/* #define DEBUG */

static BIO_METHOD methods_linebuffer = {
static const BIO_METHOD methods_linebuffer = {
    BIO_TYPE_LINEBUFFER,
    "linebuffer",
    linebuffer_write,
@@ -88,7 +88,7 @@ static BIO_METHOD methods_linebuffer = {
    linebuffer_callback_ctrl,
};

BIO_METHOD *BIO_f_linebuffer(void)
const BIO_METHOD *BIO_f_linebuffer(void)
{
    return (&methods_linebuffer);
}
+2 −2
Original line number Diff line number Diff line
@@ -79,7 +79,7 @@ typedef struct nbio_test_st {
    int lwn;
} NBIO_TEST;

static BIO_METHOD methods_nbiof = {
static const BIO_METHOD methods_nbiof = {
    BIO_TYPE_NBIO_TEST,
    "non-blocking IO test filter",
    nbiof_write,
@@ -92,7 +92,7 @@ static BIO_METHOD methods_nbiof = {
    nbiof_callback_ctrl,
};

BIO_METHOD *BIO_f_nbio_test(void)
const BIO_METHOD *BIO_f_nbio_test(void)
{
    return (&methods_nbiof);
}
Loading