From 55289c1ee79378e70579e11f1ee50b1abb585320 Mon Sep 17 00:00:00 2001 From: vlm Date: Wed, 15 Jun 2005 18:41:50 +0000 Subject: [PATCH] fixes for gcc 4.x git-svn-id: https://asn1c.svn.sourceforge.net/svnroot/asn1c/trunk@908 59561ff5-6e30-0410-9f3c-9617f08c8826 --- asn1c/unber.c | 4 ++-- libasn1fix/asn1fix_cstring.c | 2 +- libasn1fix/asn1fix_misc.c | 2 +- libasn1parser/asn1p_value.c | 6 +++--- libasn1print/asn1print.c | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/asn1c/unber.c b/asn1c/unber.c index 73004363..28087d4f 100644 --- a/asn1c/unber.c +++ b/asn1c/unber.c @@ -708,10 +708,10 @@ decode_tlv_from_string(const char *datastring) { /* * Dummy functions. */ -asn_dec_rval_t ber_check_tags(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, asn_struct_ctx_t *opt_ctx, const void *ptr, size_t size, int tag_mode, int last_tag_form, ber_tlv_len_t *last_length, int *opt_tlv_form) { asn_dec_rval_t rv; (void)opt_codec_ctx; (void)td; (void)opt_ctx; (void)ptr; (void)size; (void)tag_mode; (void)last_tag_form; (void)last_length; (void)opt_tlv_form; return rv; } +asn_dec_rval_t ber_check_tags(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, asn_struct_ctx_t *opt_ctx, const void *ptr, size_t size, int tag_mode, int last_tag_form, ber_tlv_len_t *last_length, int *opt_tlv_form) { asn_dec_rval_t rv = { 0, 0 }; (void)opt_codec_ctx; (void)td; (void)opt_ctx; (void)ptr; (void)size; (void)tag_mode; (void)last_tag_form; (void)last_length; (void)opt_tlv_form; return rv; } ssize_t der_write_tags(asn_TYPE_descriptor_t *td, size_t slen, int tag_mode, int last_tag_form, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { (void)td; (void)slen; (void)tag_mode; (void)last_tag_form; (void)tag; (void)cb; (void)app_key; return -1; } -asn_dec_rval_t xer_decode_general(asn_codec_ctx_t *opt_codec_ctx, asn_struct_ctx_t *ctx, void *struct_key, const char *xml_tag, const void *buf_ptr, size_t size, int (*otd)(void *struct_key, const void *chunk_buf, size_t chunk_size), ssize_t (*br)(void *struct_key, const void *chunk_buf, size_t chunk_size, int have_more)) { asn_dec_rval_t rv; (void)opt_codec_ctx; (void)ctx; (void)struct_key; (void)xml_tag; (void)buf_ptr; (void)size; (void)otd; (void)br; return rv; } +asn_dec_rval_t xer_decode_general(asn_codec_ctx_t *opt_codec_ctx, asn_struct_ctx_t *ctx, void *struct_key, const char *xml_tag, const void *buf_ptr, size_t size, int (*otd)(void *struct_key, const void *chunk_buf, size_t chunk_size), ssize_t (*br)(void *struct_key, const void *chunk_buf, size_t chunk_size, int have_more)) { asn_dec_rval_t rv = { 0, 0 }; (void)opt_codec_ctx; (void)ctx; (void)struct_key; (void)xml_tag; (void)buf_ptr; (void)size; (void)otd; (void)br; return rv; } int xer_is_whitespace(const void *b, size_t s) { (void)b; (void)s; return 0; } diff --git a/libasn1fix/asn1fix_cstring.c b/libasn1fix/asn1fix_cstring.c index 215336b7..f4e76043 100644 --- a/libasn1fix/asn1fix_cstring.c +++ b/libasn1fix/asn1fix_cstring.c @@ -13,7 +13,7 @@ asn1f_fix_cstring(arg_t *arg) { if(expr->value && expr->value->type == ATV_STRING) { struct _cstring_pattern cp; - char *buf = expr->value->value.string.buf; + char *buf = (char *)expr->value->value.string.buf; int buflen = expr->value->value.string.size; int start = 0; diff --git a/libasn1fix/asn1fix_misc.c b/libasn1fix/asn1fix_misc.c index b82afaee..b28a58a2 100644 --- a/libasn1fix/asn1fix_misc.c +++ b/libasn1fix/asn1fix_misc.c @@ -80,7 +80,7 @@ asn1f_printable_value(asn1p_value_t *v) { case ATV_UNPARSED: /* Buffer is guaranteed to be null-terminated */ assert(v->value.string.buf[v->value.string.size] == '\0'); - return v->value.string.buf; + return (char *)v->value.string.buf; case ATV_BITVECTOR: { uint8_t *bitvector; diff --git a/libasn1parser/asn1p_value.c b/libasn1parser/asn1p_value.c index d6d30077..2242e3f2 100644 --- a/libasn1parser/asn1p_value.c +++ b/libasn1parser/asn1p_value.c @@ -76,7 +76,7 @@ asn1p_value_frombuf(char *buffer, int size, int do_copy) { } v->value.string.buf = p; } else { - v->value.string.buf = buffer; + v->value.string.buf = (uint8_t *)buffer; } v->value.string.size = size; v->type = ATV_STRING; @@ -129,12 +129,12 @@ asn1p_value_clone(asn1p_value_t *v) { if(clone) clone->type = v->type; return clone; case ATV_STRING: - clone = asn1p_value_frombuf(v->value.string.buf, + clone = asn1p_value_frombuf((char *)v->value.string.buf, v->value.string.size, 1); if(clone) clone->type = v->type; return clone; case ATV_UNPARSED: - clone = asn1p_value_frombuf(v->value.string.buf, + clone = asn1p_value_frombuf((char *)v->value.string.buf, v->value.string.size, 1); if(clone) clone->type = ATV_UNPARSED; return clone; diff --git a/libasn1print/asn1print.c b/libasn1print/asn1print.c index 0a073789..01e21ead 100644 --- a/libasn1print/asn1print.c +++ b/libasn1print/asn1print.c @@ -210,7 +210,7 @@ asn1print_value(asn1p_value_t *val, enum asn1print_flags flags) { return 0; case ATV_STRING: { - char *p = val->value.string.buf; + char *p = (char *)val->value.string.buf; putchar('"'); if(strchr(p, '"')) { /* Mask quotes */ @@ -226,7 +226,7 @@ asn1print_value(asn1p_value_t *val, enum asn1print_flags flags) { } return 0; case ATV_UNPARSED: - fputs(val->value.string.buf, stdout); + fputs((char *)val->value.string.buf, stdout); return 0; case ATV_BITVECTOR: {