From 4a1f3f274108e25b97bd9870170fe2970892e155 Mon Sep 17 00:00:00 2001 From: "Dr. Stephen Henson" Date: Wed, 6 Jan 2016 02:54:18 +0000 Subject: Only declare stacks in headers Don't define stacks in C source files: it causes warnings about unused functions in some compilers. Reviewed-by: Richard Levitte --- crypto/objects/Makefile | 2 +- crypto/objects/o_names.c | 7 +++---- crypto/objects/o_names.h | 4 ++++ crypto/objects/obj_xref.c | 2 -- crypto/objects/obj_xref.h | 2 ++ crypto/objects/objxref.pl | 2 ++ 6 files changed, 12 insertions(+), 7 deletions(-) create mode 100644 crypto/objects/o_names.h (limited to 'crypto/objects') diff --git a/crypto/objects/Makefile b/crypto/objects/Makefile index 7bc0aac3cf..d6ccb8a235 100644 --- a/crypto/objects/Makefile +++ b/crypto/objects/Makefile @@ -21,7 +21,7 @@ LIBOBJ= o_names.o obj_dat.o obj_lib.o obj_err.o obj_xref.o SRC= $(LIBSRC) -HEADER= obj_dat.h obj_xref.h +HEADER= obj_dat.h obj_xref.h o_names.h ALL= $(GENERAL) $(SRC) $(HEADER) diff --git a/crypto/objects/o_names.c b/crypto/objects/o_names.c index 0839feeee6..aa9b400ef8 100644 --- a/crypto/objects/o_names.c +++ b/crypto/objects/o_names.c @@ -7,6 +7,7 @@ #include #include #include +#include "o_names.h" /* * Later versions of DEC C has started to add lnkage information to certain @@ -28,13 +29,11 @@ DECLARE_LHASH_OF(OBJ_NAME); static LHASH_OF(OBJ_NAME) *names_lh = NULL; static int names_type_num = OBJ_NAME_TYPE_NUM; -typedef struct name_funcs_st { +struct name_funcs_st { unsigned long (*hash_func) (const char *name); int (*cmp_func) (const char *a, const char *b); void (*free_func) (const char *, int, const char *); -} NAME_FUNCS; - -DEFINE_STACK_OF(NAME_FUNCS) +}; static STACK_OF(NAME_FUNCS) *name_funcs_stack; diff --git a/crypto/objects/o_names.h b/crypto/objects/o_names.h new file mode 100644 index 0000000000..914ed33086 --- /dev/null +++ b/crypto/objects/o_names.h @@ -0,0 +1,4 @@ + + +typedef struct name_funcs_st NAME_FUNCS; +DEFINE_STACK_OF(NAME_FUNCS) diff --git a/crypto/objects/obj_xref.c b/crypto/objects/obj_xref.c index 15426fe342..62ff882125 100644 --- a/crypto/objects/obj_xref.c +++ b/crypto/objects/obj_xref.c @@ -61,8 +61,6 @@ #include "obj_xref.h" #include "e_os.h" -DEFINE_STACK_OF(nid_triple) - static STACK_OF(nid_triple) *sig_app, *sigx_app; static int sig_cmp(const nid_triple *a, const nid_triple *b) diff --git a/crypto/objects/obj_xref.h b/crypto/objects/obj_xref.h index c07adee4f2..7096ca5442 100644 --- a/crypto/objects/obj_xref.h +++ b/crypto/objects/obj_xref.h @@ -6,6 +6,8 @@ typedef struct { int pkey_id; } nid_triple; +DEFINE_STACK_OF(nid_triple) + static const nid_triple sigoid_srt[] = { {NID_md2WithRSAEncryption, NID_md2, NID_rsaEncryption}, {NID_md5WithRSAEncryption, NID_md5, NID_rsaEncryption}, diff --git a/crypto/objects/objxref.pl b/crypto/objects/objxref.pl index a1900cab5c..05b987ad16 100644 --- a/crypto/objects/objxref.pl +++ b/crypto/objects/objxref.pl @@ -68,6 +68,8 @@ typedef struct { int pkey_id; } nid_triple; +DEFINE_STACK_OF(nid_triple) + static const nid_triple sigoid_srt[] = { EOF -- cgit v1.2.3