aboutsummaryrefslogtreecommitdiffstats
path: root/skeletons
diff options
context:
space:
mode:
authorLev Walkin <vlm@lionet.info>2006-07-27 11:46:25 +0000
committerLev Walkin <vlm@lionet.info>2006-07-27 11:46:25 +0000
commitb1919380381a2a475390f8cfb9afe0e8dd1f899e (patch)
tree0ca4bf5ebf26c2082c3a963e5ecab37cbae3b5ac /skeletons
parent640e04b4fe8097883d52057a8852fd1f6697c493 (diff)
strict aliasing rules
Diffstat (limited to 'skeletons')
-rw-r--r--skeletons/tests/check-OCTET_STRING.c3
-rw-r--r--skeletons/tests/check-OIDs.c3
-rw-r--r--skeletons/tests/check-REAL.c6
-rw-r--r--skeletons/tests/check-length.c5
4 files changed, 11 insertions, 6 deletions
diff --git a/skeletons/tests/check-OCTET_STRING.c b/skeletons/tests/check-OCTET_STRING.c
index b3e298f1..120e9c81 100644
--- a/skeletons/tests/check-OCTET_STRING.c
+++ b/skeletons/tests/check-OCTET_STRING.c
@@ -19,6 +19,7 @@ check(enum encoding_type type, char *tagname, char *xmlbuf, char *verify) {
int verlen = verify ? strlen(verify) : 0;
asn_TYPE_descriptor_t *td = &asn_DEF_OCTET_STRING;
OCTET_STRING_t *st = 0;
+ OCTET_STRING_t **stp = &st;
asn_dec_rval_t rc;
xer_type_decoder_f *decoder = 0;
@@ -35,7 +36,7 @@ check(enum encoding_type type, char *tagname, char *xmlbuf, char *verify) {
break;
}
- rc = decoder(0, td, (void **)&st, tagname, xmlbuf, xmllen);
+ rc = decoder(0, td, (void **)stp, tagname, xmlbuf, xmllen);
printf("[%s] => [%s]:%d vs [%s]:%d, code %d\n",
xmlbuf,
st ? (const char *)st->buf : "", st ? st->size : 0,
diff --git a/skeletons/tests/check-OIDs.c b/skeletons/tests/check-OIDs.c
index a28cd00e..4d4c9b56 100644
--- a/skeletons/tests/check-OIDs.c
+++ b/skeletons/tests/check-OIDs.c
@@ -245,13 +245,14 @@ static void check_parse(const char *oid_txt, int retval) {
static void check_xer(int expect_arcs, char *xer) {
asn_dec_rval_t rc;
RELATIVE_OID_t *st = 0;
+ RELATIVE_OID_t **stp = &st;
long arcs[10];
int ret;
int i;
printf("[%s] => ", xer); fflush(stdout);
rc = asn_DEF_RELATIVE_OID.xer_decoder(0,
- &asn_DEF_RELATIVE_OID, (void **)&st, "t",
+ &asn_DEF_RELATIVE_OID, (void **)stp, "t",
xer, strlen(xer));
if(expect_arcs == -1) {
if(rc.code != RC_OK)
diff --git a/skeletons/tests/check-REAL.c b/skeletons/tests/check-REAL.c
index e29df500..641da2da 100644
--- a/skeletons/tests/check-REAL.c
+++ b/skeletons/tests/check-REAL.c
@@ -152,6 +152,8 @@ check_xer(int fuzzy, double orig_value) {
REAL_t st;
REAL_t *newst0 = 0;
REAL_t *newst1 = 0;
+ REAL_t **newst0p = &newst0;
+ REAL_t **newst1p = &newst1;
double value0, value1;
int ret;
@@ -176,12 +178,12 @@ check_xer(int fuzzy, double orig_value) {
reconstr_lens[0], reconstructed[0]
);
- rc = xer_decode(0, &asn_DEF_REAL, (void **)&newst0,
+ rc = xer_decode(0, &asn_DEF_REAL, (void **)newst0p,
reconstructed[0], reconstr_lens[0]);
assert(rc.code == RC_OK);
assert(rc.consumed < reconstr_lens[0]);
- rc = xer_decode(0, &asn_DEF_REAL, (void **)&newst1,
+ rc = xer_decode(0, &asn_DEF_REAL, (void **)newst1p,
reconstructed[1], reconstr_lens[1]);
assert(rc.code == RC_OK);
assert(rc.consumed == reconstr_lens[1]);
diff --git a/skeletons/tests/check-length.c b/skeletons/tests/check-length.c
index 312e0370..fc764b0f 100644
--- a/skeletons/tests/check-length.c
+++ b/skeletons/tests/check-length.c
@@ -39,6 +39,7 @@ static void
check(int size) {
OCTET_STRING_t *os;
OCTET_STRING_t *nos = 0;
+ OCTET_STRING_t **nosp = &nos;
asn_enc_rval_t erval;
asn_dec_rval_t rval;
int i;
@@ -61,7 +62,7 @@ check(int size) {
assert(erval.encoded == buf_off);
assert(buf_off > size);
- rval = ber_decode(0, &asn_DEF_OCTET_STRING, (void **)&nos, buf, buf_off);
+ rval = ber_decode(0, &asn_DEF_OCTET_STRING, (void **)nosp, buf, buf_off);
assert(rval.code == RC_OK);
assert(rval.consumed == buf_off);
@@ -116,7 +117,7 @@ main() {
if(sizeof(tlv_len) <= 4) {
ret = ber_fetch_length(0, buf3, sizeof(buf3), &tlv_len);
printf("ret=%ld\n", (long)ret);
- printf("len=0x%x\n", (long)tlv_len);
+ printf("len=0x%x\n", (int)tlv_len);
assert(ret == -1);
}
if(sizeof(tlv_len) <= 8) {