From 0c77a52f37797c6f74d0599d11c467bfb9bce1e2 Mon Sep 17 00:00:00 2001 From: "ludovic.rousseau" Date: Fri, 2 Apr 2010 13:12:53 +0000 Subject: [PATCH] Remove 2 ugly casts and fix warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit asn1.c: In function ‘asn1_decode_entry’: asn1.c:979: warning: dereferencing type-punned pointer will break strict-aliasing rules asn1.c: In function ‘asn1_encode_entry’: asn1.c:1263: warning: dereferencing type-punned pointer will break strict-aliasing rules git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4207 c6295689-39f2-0310-b995-f0e70906c6a9 --- src/libopensc/asn1.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libopensc/asn1.c b/src/libopensc/asn1.c index bdcca287..76dc7746 100644 --- a/src/libopensc/asn1.c +++ b/src/libopensc/asn1.c @@ -976,7 +976,7 @@ static int asn1_decode_entry(sc_context_t *ctx,struct sc_asn1_entry *entry, size_t *len = (size_t *) entry->arg; int r = 0; - *(void **)(&callback_func) = parm; + callback_func = parm; sc_debug(ctx, SC_LOG_DEBUG_ASN1, "%*.*sdecoding '%s'\n", depth, depth, "", entry->name); @@ -1260,7 +1260,7 @@ static int asn1_encode_entry(sc_context_t *ctx, const struct sc_asn1_entry *entr u8 * buf = NULL; size_t buflen = 0; - *(void **)(&callback_func) = parm; + callback_func = parm; sc_debug(ctx, SC_LOG_DEBUG_ASN1, "%*.*sencoding '%s'%s\n", depth, depth, "", entry->name,