From 31c2b6ee7a5bc69b9bfc7eb96f4fa30f3a2681bd Mon Sep 17 00:00:00 2001 From: "Dr. Stephen Henson" Date: Thu, 5 Mar 2015 15:17:33 +0000 Subject: [PATCH] Make STACK_OF opaque. Reviewed-by: Matt Caswell --- crypto/stack/safestack.h | 12 ++---------- crypto/stack/stack.c | 8 ++++++++ crypto/stack/stack.h | 11 +---------- 3 files changed, 11 insertions(+), 20 deletions(-) diff --git a/crypto/stack/safestack.h b/crypto/stack/safestack.h index bd0397d5e9..ceb0ba82f0 100644 --- a/crypto/stack/safestack.h +++ b/crypto/stack/safestack.h @@ -88,16 +88,8 @@ extern "C" { # define STACK_OF(type) struct stack_st_##type # define PREDECLARE_STACK_OF(type) STACK_OF(type); -# define DECLARE_STACK_OF(type) \ -STACK_OF(type) \ - { \ - _STACK stack; \ - }; -# define DECLARE_SPECIAL_STACK_OF(type, type2) \ -STACK_OF(type) \ - { \ - _STACK stack; \ - }; +# define DECLARE_STACK_OF(type) STACK_OF(type); +# define DECLARE_SPECIAL_STACK_OF(type, type2) STACK_OF(type); /*- * Strings are special: normally an lhash entry will point to a single diff --git a/crypto/stack/stack.c b/crypto/stack/stack.c index 758ace941f..1b89f551f1 100644 --- a/crypto/stack/stack.c +++ b/crypto/stack/stack.c @@ -60,6 +60,14 @@ #include #include +struct stack_st { + int num; + char **data; + int sorted; + int num_alloc; + int (*comp) (const void *, const void *); +}; + #undef MIN_NODES #define MIN_NODES 4 diff --git a/crypto/stack/stack.h b/crypto/stack/stack.h index eb07216659..6b8869cd95 100644 --- a/crypto/stack/stack.h +++ b/crypto/stack/stack.h @@ -63,16 +63,7 @@ extern "C" { #endif -typedef struct stack_st { - int num; - char **data; - int sorted; - int num_alloc; - int (*comp) (const void *, const void *); -} _STACK; /* Use STACK_OF(...) instead */ - -# define M_sk_num(sk) ((sk) ? (sk)->num:-1) -# define M_sk_value(sk,n) ((sk) ? (sk)->data[n] : NULL) +typedef struct stack_st _STACK; /* Use STACK_OF(...) instead */ int sk_num(const _STACK *); void *sk_value(const _STACK *, int); -- 2.25.1