GH540: add casts to safestack.h
authorAlessandro Ghedini <alessandro@ghedini.me>
Sun, 10 Jan 2016 23:02:17 +0000 (23:02 +0000)
committerRich Salz <rsalz@openssl.org>
Mon, 11 Jan 2016 17:34:34 +0000 (12:34 -0500)
Signed-off-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
util/mkstack.pl

index 06cf0f99cec2ab876f0730d0bf17068a41609dab..eae3d5528028fd6ca3e8668455b1ef080b13d04e 100755 (executable)
@@ -125,7 +125,7 @@ extern "C" {
     } \
     static ossl_inline t2 *sk_##t1##_value(const STACK_OF(t1) *sk, int idx) \
     { \
-        return sk_value((_STACK *)sk, idx); \
+        return (t2 *)sk_value((_STACK *)sk, idx); \
     } \
     static ossl_inline STACK_OF(t1) *sk_##t1##_new(int (*cmpf)(const t3 * const *a, const t3 * const *b)) \
     { \
@@ -145,11 +145,11 @@ extern "C" {
     } \
     static ossl_inline t2 *sk_##t1##_delete(STACK_OF(t1) *sk, int i) \
     { \
-        return sk_delete((_STACK *)sk, i); \
+        return (t2 *)sk_delete((_STACK *)sk, i); \
     } \
     static ossl_inline t2 *sk_##t1##_delete_ptr(STACK_OF(t1) *sk, t2 *ptr) \
     { \
-        return sk_delete_ptr((_STACK *)sk, (void *)ptr); \
+        return (t2 *)sk_delete_ptr((_STACK *)sk, (void *)ptr); \
     } \
     static ossl_inline int sk_##t1##_push(STACK_OF(t1) *sk, t2 *ptr) \
     { \
@@ -177,7 +177,7 @@ extern "C" {
     } \
     static ossl_inline t2 *sk_##t1##_set(STACK_OF(t1) *sk, int idx, t2 *ptr) \
     { \
-        return sk_set((_STACK *)sk, idx, (void *)ptr); \
+        return (t2 *)sk_set((_STACK *)sk, idx, (void *)ptr); \
     } \
     static ossl_inline int sk_##t1##_find(STACK_OF(t1) *sk, t2 *ptr) \
     { \