aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/asn1/tasn_dec.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2006-11-16 00:19:39 +0000
committerDr. Stephen Henson <steve@openssl.org>2006-11-16 00:19:39 +0000
commitde12116417081f7b834bca4a583f97169040ce52 (patch)
tree84f4f8286418d1fc35d1837019701277a208e921 /crypto/asn1/tasn_dec.c
parent28b987aec9474e8c0cf1cc12273018edf3a1eca1 (diff)
downloadopenssl-de12116417081f7b834bca4a583f97169040ce52.tar.gz
Initial, incomplete support for typesafe macros without using function
casts.
Diffstat (limited to 'crypto/asn1/tasn_dec.c')
-rw-r--r--crypto/asn1/tasn_dec.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/crypto/asn1/tasn_dec.c b/crypto/asn1/tasn_dec.c
index c32510ffda..61632a9dd2 100644
--- a/crypto/asn1/tasn_dec.c
+++ b/crypto/asn1/tasn_dec.c
@@ -114,6 +114,8 @@ unsigned long ASN1_tag2bit(int tag)
/* Macro to initialize and invalidate the cache */
#define asn1_tlc_clear(c) if (c) (c)->valid = 0
+/* Version to avoid compiler warning about 'c' always non-NULL */
+#define asn1_tlc_clear_nc(c) (c)->valid = 0
/* Decode an ASN1 item, this currently behaves just
* like a standard 'd2i' function. 'in' points to
@@ -130,7 +132,7 @@ ASN1_VALUE *ASN1_item_d2i(ASN1_VALUE **pval,
ASN1_VALUE *ptmpval = NULL;
if (!pval)
pval = &ptmpval;
- asn1_tlc_clear(&c);
+ asn1_tlc_clear_nc(&c);
if (ASN1_item_ex_d2i(pval, in, len, it, -1, 0, 0, &c) > 0)
return *pval;
return NULL;
@@ -140,7 +142,7 @@ int ASN1_template_d2i(ASN1_VALUE **pval,
const unsigned char **in, long len, const ASN1_TEMPLATE *tt)
{
ASN1_TLC c;
- asn1_tlc_clear(&c);
+ asn1_tlc_clear_nc(&c);
return asn1_template_ex_d2i(pval, in, len, tt, 0, &c);
}
@@ -944,7 +946,7 @@ int asn1_ex_c2i(ASN1_VALUE **pval, const unsigned char *cont, int len,
if (utype != typ->type)
ASN1_TYPE_set(typ, utype, NULL);
opval = pval;
- pval = (ASN1_VALUE **)&typ->value.ptr;
+ pval = &typ->value.asn1_value;
}
switch(utype)
{