[openssl] master update

Dr. Paul Dale pauli at openssl.org
Sat Jun 1 07:55:57 UTC 2019


The branch master has been updated
       via  ff62cad6dd36a4c34df4c2c5579d048e107f8e8f (commit)
      from  8be6a4ed02297f380bbea269f2e1c08a592444bc (commit)


- Log -----------------------------------------------------------------
commit ff62cad6dd36a4c34df4c2c5579d048e107f8e8f
Author: Pauli <paul.dale at oracle.com>
Date:   Sat Jun 1 17:55:33 2019 +1000

    Add sparse array of const pointer type
    
    Reviewed-by: Tomas Mraz <tmraz at fedoraproject.org>
    (Merged from https://github.com/openssl/openssl/pull/8840)

-----------------------------------------------------------------------

Summary of changes:
 crypto/include/internal/sparse_array.h | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/crypto/include/internal/sparse_array.h b/crypto/include/internal/sparse_array.h
index ec3fb2f..037ccfe 100644
--- a/crypto/include/internal/sparse_array.h
+++ b/crypto/include/internal/sparse_array.h
@@ -19,7 +19,7 @@ extern "C" {
 
 # define SPARSE_ARRAY_OF(type) struct sparse_array_st_ ## type
 
-# define DEFINE_SPARSE_ARRAY_OF(type) \
+# define DEFINE_SPARSE_ARRAY_OF_INTERNAL(type, ctype) \
     SPARSE_ARRAY_OF(type); \
     static ossl_unused ossl_inline SPARSE_ARRAY_OF(type) * \
         ossl_sa_##type##_new(void) \
@@ -53,18 +53,23 @@ extern "C" {
                                                 void *))leaf, \
                              arg); \
     } \
-    static ossl_unused ossl_inline type *ossl_sa_##type##_get(const SPARSE_ARRAY_OF(type) *sa, \
+    static ossl_unused ossl_inline ctype *ossl_sa_##type##_get(const SPARSE_ARRAY_OF(type) *sa, \
                                                   ossl_uintmax_t n) \
     { \
         return (type *)OPENSSL_SA_get((OPENSSL_SA *)sa, n); \
     } \
     static ossl_unused ossl_inline int ossl_sa_##type##_set(SPARSE_ARRAY_OF(type) *sa, \
-                                                ossl_uintmax_t n, type *val) \
+                                                ossl_uintmax_t n, ctype *val) \
     { \
         return OPENSSL_SA_set((OPENSSL_SA *)sa, n, (void *)val); \
     } \
     SPARSE_ARRAY_OF(type)
 
+# define DEFINE_SPARSE_ARRAY_OF(type) \
+    DEFINE_SPARSE_ARRAY_OF_INTERNAL(type, type)
+# define DEFINE_SPARSE_ARRAY_OF_CONST(type) \
+    DEFINE_SPARSE_ARRAY_OF_INTERNAL(type, const type)
+
 typedef struct sparse_array_st OPENSSL_SA;
 OPENSSL_SA *OPENSSL_SA_new(void);
 void OPENSSL_SA_free(OPENSSL_SA *sa);


More information about the openssl-commits mailing list