Skip to content

Commit

Permalink
remove warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
vlm committed Oct 17, 2013
1 parent 4062b01 commit 9c70e74
Show file tree
Hide file tree
Showing 52 changed files with 192 additions and 342 deletions.
6 changes: 3 additions & 3 deletions skeletons/OCTET_STRING.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ OCTET_STRING_decode_ber(asn_codec_ctx_t *opt_codec_ctx,
}

/* Restore parsing context */
ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset);
ctx = (asn_struct_ctx_t *)((void *)st + specs->ctx_offset);

switch(ctx->phase) {
case 0:
Expand Down Expand Up @@ -1143,7 +1143,7 @@ OCTET_STRING__decode_xer(asn_codec_ctx_t *opt_codec_ctx,
}

/* Restore parsing context */
ctx = (asn_struct_ctx_t *)(((char *)*sptr) + specs->ctx_offset);
ctx = (asn_struct_ctx_t *)(((void *)*sptr) + specs->ctx_offset);

return xer_decode_general(opt_codec_ctx, ctx, *sptr, xml_tag,
buf_ptr, size, opt_unexpected_tag_decoder, body_receiver);
Expand Down Expand Up @@ -1716,7 +1716,7 @@ OCTET_STRING_free(asn_TYPE_descriptor_t *td, void *sptr, int contents_only) {
? (asn_OCTET_STRING_specifics_t *)td->specifics
: &asn_DEF_OCTET_STRING_specs;
asn_struct_ctx_t *ctx = (asn_struct_ctx_t *)
((char *)st + specs->ctx_offset);
((void *)st + specs->ctx_offset);
struct _stack *stck;

if(!td || !st)
Expand Down
46 changes: 23 additions & 23 deletions skeletons/constr_CHOICE.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#undef ADVANCE
#define ADVANCE(num_bytes) do { \
size_t num = num_bytes; \
ptr = ((const char *)ptr) + num;\
ptr = ((const void *)ptr) + num;\
size -= num; \
if(ctx->left >= 0) \
ctx->left -= num; \
Expand Down Expand Up @@ -133,7 +133,7 @@ CHOICE_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
/*
* Restore parsing context.
*/
ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset);
ctx = (asn_struct_ctx_t *)((void *)st + specs->ctx_offset);

/*
* Start to parse where left previously
Expand Down Expand Up @@ -211,7 +211,7 @@ CHOICE_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,

skip = ber_skip_length(opt_codec_ctx,
BER_TLV_CONSTRUCTED(ptr),
(const char *)ptr + tag_len,
(const void *)ptr + tag_len,
LEFT - tag_len);

switch(skip) {
Expand Down Expand Up @@ -244,7 +244,7 @@ CHOICE_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
*/
if(elm->flags & ATF_POINTER) {
/* Member is a pointer to another structure */
memb_ptr2 = (void **)((char *)st + elm->memb_offset);
memb_ptr2 = (void **)((void *)st + elm->memb_offset);
} else {
/*
* A pointer to a pointer
Expand Down Expand Up @@ -390,7 +390,7 @@ CHOICE_encode_der(asn_TYPE_descriptor_t *td, void *sptr,
*/
elm = &td->elements[present-1];
if(elm->flags & ATF_POINTER) {
memb_ptr = *(void **)((char *)sptr + elm->memb_offset);
memb_ptr = *(void **)((void *)sptr + elm->memb_offset);
if(memb_ptr == 0) {
if(elm->optional) {
erval.encoded = 0;
Expand All @@ -400,7 +400,7 @@ CHOICE_encode_der(asn_TYPE_descriptor_t *td, void *sptr,
_ASN_ENCODE_FAILED;
}
} else {
memb_ptr = (void *)((char *)sptr + elm->memb_offset);
memb_ptr = (void *)((void *)sptr + elm->memb_offset);
}

/*
Expand Down Expand Up @@ -463,10 +463,10 @@ CHOICE_outmost_tag(asn_TYPE_descriptor_t *td, const void *ptr, int tag_mode, ber

if(elm->flags & ATF_POINTER) {
memb_ptr = *(const void * const *)
((const char *)ptr + elm->memb_offset);
((const void *)ptr + elm->memb_offset);
} else {
memb_ptr = (const void *)
((const char *)ptr + elm->memb_offset);
((const void *)ptr + elm->memb_offset);
}

return asn_TYPE_outmost_tag(elm->type, memb_ptr,
Expand Down Expand Up @@ -498,7 +498,7 @@ CHOICE_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
const void *memb_ptr;

if(elm->flags & ATF_POINTER) {
memb_ptr = *(const void * const *)((const char *)sptr + elm->memb_offset);
memb_ptr = *(const void * const *)((const void *)sptr + elm->memb_offset);
if(!memb_ptr) {
if(elm->optional)
return 0;
Expand All @@ -508,7 +508,7 @@ CHOICE_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
return -1;
}
} else {
memb_ptr = (const void *)((const char *)sptr + elm->memb_offset);
memb_ptr = (const void *)((const void *)sptr + elm->memb_offset);
}

if(elm->memb_constraints) {
Expand All @@ -535,7 +535,7 @@ CHOICE_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
#undef XER_ADVANCE
#define XER_ADVANCE(num_bytes) do { \
size_t num = num_bytes; \
buf_ptr = ((const char *)buf_ptr) + num;\
buf_ptr = ((const void *)buf_ptr) + num;\
size -= num; \
consumed_myself += num; \
} while(0)
Expand Down Expand Up @@ -574,7 +574,7 @@ CHOICE_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
/*
* Restore parsing context.
*/
ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset);
ctx = (asn_struct_ctx_t *)((void *)st + specs->ctx_offset);
if(ctx->phase == 0 && !*xml_tag)
ctx->phase = 1; /* Skip the outer tag checking phase */

Expand Down Expand Up @@ -605,7 +605,7 @@ CHOICE_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,

if(elm->flags & ATF_POINTER) {
/* Member is a pointer to another structure */
memb_ptr2 = (void **)((char *)st
memb_ptr2 = (void **)((void *)st
+ elm->memb_offset);
} else {
memb_ptr = (char *)st + elm->memb_offset;
Expand Down Expand Up @@ -797,10 +797,10 @@ CHOICE_encode_xer(asn_TYPE_descriptor_t *td, void *sptr,
unsigned int mlen = strlen(mname);

if(elm->flags & ATF_POINTER) {
memb_ptr = *(void **)((char *)sptr + elm->memb_offset);
memb_ptr = *(void **)((void *)sptr + elm->memb_offset);
if(!memb_ptr) _ASN_ENCODE_FAILED;
} else {
memb_ptr = (void *)((char *)sptr + elm->memb_offset);
memb_ptr = (void *)((void *)sptr + elm->memb_offset);
}

er.encoded = 0;
Expand Down Expand Up @@ -884,7 +884,7 @@ CHOICE_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
elm = &td->elements[value];
if(elm->flags & ATF_POINTER) {
/* Member is a pointer to another structure */
memb_ptr2 = (void **)((char *)st + elm->memb_offset);
memb_ptr2 = (void **)((void *)st + elm->memb_offset);
} else {
memb_ptr = (char *)st + elm->memb_offset;
memb_ptr2 = &memb_ptr;
Expand Down Expand Up @@ -962,7 +962,7 @@ CHOICE_encode_uper(asn_TYPE_descriptor_t *td,
elm = &td->elements[present];
if(elm->flags & ATF_POINTER) {
/* Member is a pointer to another structure */
memb_ptr = *(void **)((char *)sptr + elm->memb_offset);
memb_ptr = *(void **)((void *)sptr + elm->memb_offset);
if(!memb_ptr) _ASN_ENCODE_FAILED;
} else {
memb_ptr = (char *)sptr + elm->memb_offset;
Expand Down Expand Up @@ -1010,10 +1010,10 @@ CHOICE_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
const void *memb_ptr;

if(elm->flags & ATF_POINTER) {
memb_ptr = *(const void * const *)((const char *)sptr + elm->memb_offset);
memb_ptr = *(const void * const *)((const void *)sptr + elm->memb_offset);
if(!memb_ptr) return (cb("<absent>", 8, app_key) < 0) ? -1 : 0;
} else {
memb_ptr = (const void *)((const char *)sptr + elm->memb_offset);
memb_ptr = (const void *)((const void *)sptr + elm->memb_offset);
}

/* Print member's name and stuff */
Expand Down Expand Up @@ -1053,11 +1053,11 @@ CHOICE_free(asn_TYPE_descriptor_t *td, void *ptr, int contents_only) {
void *memb_ptr;

if(elm->flags & ATF_POINTER) {
memb_ptr = *(void **)((char *)ptr + elm->memb_offset);
memb_ptr = *(void **)((void *)ptr + elm->memb_offset);
if(memb_ptr)
ASN_STRUCT_FREE(*elm->type, memb_ptr);
} else {
memb_ptr = (void *)((char *)ptr + elm->memb_offset);
memb_ptr = (void *)((void *)ptr + elm->memb_offset);
ASN_STRUCT_FREE_CONTENTS_ONLY(*elm->type, memb_ptr);
}
}
Expand All @@ -1082,7 +1082,7 @@ _fetch_present_idx(const void *struct_ptr, int pres_offset, int pres_size) {
const void *present_ptr;
int present;

present_ptr = ((const char *)struct_ptr) + pres_offset;
present_ptr = ((const void *)struct_ptr) + pres_offset;

switch(pres_size) {
case sizeof(int): present = *(const int *)present_ptr; break;
Expand All @@ -1100,7 +1100,7 @@ _fetch_present_idx(const void *struct_ptr, int pres_offset, int pres_size) {
static void
_set_present_idx(void *struct_ptr, int pres_offset, int pres_size, int present) {
void *present_ptr;
present_ptr = ((char *)struct_ptr) + pres_offset;
present_ptr = ((void *)struct_ptr) + pres_offset;

switch(pres_size) {
case sizeof(int): *(int *)present_ptr = present; break;
Expand Down
Loading

0 comments on commit 9c70e74

Please sign in to comment.