diff options
author | Lev Walkin <vlm@lionet.info> | 2013-03-27 01:56:23 -0700 |
---|---|---|
committer | Lev Walkin <vlm@lionet.info> | 2013-03-27 01:56:23 -0700 |
commit | 2a744a747082995dec6f524368807391e0baa569 (patch) | |
tree | b472e9f10a52e5e638945a827541c4f2c4412e2b /tests | |
parent | 11c9a8c7edfc1dbff68c1630bf00f4eb9de24e04 (diff) |
Behavior of -fnative-types made default; old behavior saved under -fwide-types
Diffstat (limited to 'tests')
-rw-r--r-- | tests/03-enum-OK.asn1.-Pfwide-types (renamed from tests/03-enum-OK.asn1.-P) | 0 | ||||
-rw-r--r-- | tests/104-param-1-OK.asn1.-Pfwide-types (renamed from tests/104-param-1-OK.asn1.-P) | 0 | ||||
-rw-r--r-- | tests/105-param-2-OK.asn1.-Pfwide-types (renamed from tests/105-param-2-OK.asn1.-P) | 0 | ||||
-rw-r--r-- | tests/108-param-constr-3-OK.asn1.-Pfwide-types (renamed from tests/108-param-constr-3-OK.asn1.-P) | 0 | ||||
-rw-r--r-- | tests/110-param-3-OK.asn1.-Pfwide-types (renamed from tests/110-param-3-OK.asn1.-P) | 0 | ||||
-rw-r--r-- | tests/119-per-strings-OK.asn1.-Pgen-PER | 6 | ||||
-rw-r--r-- | tests/125-bitstring-constraint-OK.asn1.-X | 2 | ||||
-rw-r--r-- | tests/126-per-extensions-OK.asn1.-Pgen-PER | 14 | ||||
-rw-r--r-- | tests/127-per-long-OK.asn1.-Pgen-PER | 4 | ||||
-rw-r--r-- | tests/19-param-OK.asn1.-Pfwide-types (renamed from tests/19-param-OK.asn1.-P) | 0 | ||||
-rw-r--r-- | tests/22-tags-OK.asn1.-Pfwide-types (renamed from tests/22-tags-OK.asn1.-P) | 0 | ||||
-rw-r--r-- | tests/30-set-OK.asn1.-Pfwide-types (renamed from tests/30-set-OK.asn1.-P) | 0 | ||||
-rw-r--r-- | tests/31-set-of-OK.asn1.-Pfwide-types (renamed from tests/31-set-of-OK.asn1.-P) | 0 | ||||
-rw-r--r-- | tests/37-indirect-choice-OK.asn1.-Pfwide-types (renamed from tests/37-indirect-choice-OK.asn1.-P) | 0 | ||||
-rw-r--r-- | tests/39-sequence-of-OK.asn1.-Pfwide-types (renamed from tests/39-sequence-of-OK.asn1.-P) | 0 | ||||
-rw-r--r-- | tests/42-real-life-OK.asn1.-PR | 32 | ||||
-rw-r--r-- | tests/43-recursion-OK.asn1.-Pfwide-types (renamed from tests/43-recursion-OK.asn1.-P) | 18 | ||||
-rw-r--r-- | tests/47-set-ext-OK.asn1.-Pfwide-types (renamed from tests/47-set-ext-OK.asn1.-P) | 0 | ||||
-rw-r--r-- | tests/50-constraint-OK.asn1.-Pfwide-types (renamed from tests/50-constraint-OK.asn1.-P) | 4 | ||||
-rw-r--r-- | tests/50-constraint-OK.asn1.-Pgen-PER | 198 | ||||
-rw-r--r-- | tests/59-choice-extended-OK.asn1.-Pfwide-types (renamed from tests/59-choice-extended-OK.asn1.-P) | 0 | ||||
-rw-r--r-- | tests/60-any-OK.asn1.-Pfwide-types (renamed from tests/60-any-OK.asn1.-P) | 0 | ||||
-rw-r--r-- | tests/65-multi-tag-OK.asn1.-Pfwide-types (renamed from tests/65-multi-tag-OK.asn1.-P) | 0 | ||||
-rw-r--r-- | tests/66-ref-simple-OK.asn1.-Pfwide-types (renamed from tests/66-ref-simple-OK.asn1.-P) | 0 | ||||
-rw-r--r-- | tests/69-reserved-words-OK.asn1.-Pfwide-types (renamed from tests/69-reserved-words-OK.asn1.-P) | 0 | ||||
-rw-r--r-- | tests/70-xer-test-OK.asn1.-Pfwide-types (renamed from tests/70-xer-test-OK.asn1.-P) | 0 | ||||
-rw-r--r-- | tests/72-same-names-OK.asn1.-Pfwide-types (renamed from tests/72-same-names-OK.asn1.-P) | 0 | ||||
-rw-r--r-- | tests/73-circular-OK.asn1.-Pfwide-types (renamed from tests/73-circular-OK.asn1.-P) | 0 | ||||
-rw-r--r-- | tests/84-param-tags-OK.asn1.-Pfwide-types (renamed from tests/84-param-tags-OK.asn1.-P) | 0 | ||||
-rw-r--r-- | tests/88-integer-enum-OK.asn1.-Pfwide-types (renamed from tests/88-integer-enum-OK.asn1.-P) | 0 | ||||
-rw-r--r-- | tests/89-bit-string-enum-OK.asn1.-Pfwide-types (renamed from tests/89-bit-string-enum-OK.asn1.-P) | 0 | ||||
-rw-r--r-- | tests/90-cond-int-type-OK.asn1.-P | 213 | ||||
-rw-r--r-- | tests/90-cond-int-type-OK.asn1.-Pfwide-types (renamed from tests/90-cond-int-type-OK.asn1.-Pfnative-types) | 213 | ||||
-rw-r--r-- | tests/90-cond-int-type-OK.asn1.-Pgen-PER | 213 | ||||
-rw-r--r-- | tests/91-cond-int-blessSize-OK.asn1.-Pfbless-SIZE | 33 | ||||
-rw-r--r-- | tests/92-circular-loops-OK.asn1.-Pfindirect-choice | 16 | ||||
-rw-r--r-- | tests/92-circular-loops-OK.asn1.-Pfwide-types (renamed from tests/92-circular-loops-OK.asn1.-P) | 0 | ||||
-rw-r--r-- | tests/93-asn1c-controls-OK.asn1.-Pfwide-types (renamed from tests/93-asn1c-controls-OK.asn1.-P) | 0 | ||||
-rw-r--r-- | tests/95-choice-per-order-OK.asn1.-Pfwide-types (renamed from tests/95-choice-per-order-OK.asn1.-P) | 4 | ||||
-rw-r--r-- | tests/95-choice-per-order-OK.asn1.-Pgen-PER | 10 |
40 files changed, 452 insertions, 528 deletions
diff --git a/tests/03-enum-OK.asn1.-P b/tests/03-enum-OK.asn1.-Pfwide-types index d2e8ad0f..d2e8ad0f 100644 --- a/tests/03-enum-OK.asn1.-P +++ b/tests/03-enum-OK.asn1.-Pfwide-types diff --git a/tests/104-param-1-OK.asn1.-P b/tests/104-param-1-OK.asn1.-Pfwide-types index 24f4a64a..24f4a64a 100644 --- a/tests/104-param-1-OK.asn1.-P +++ b/tests/104-param-1-OK.asn1.-Pfwide-types diff --git a/tests/105-param-2-OK.asn1.-P b/tests/105-param-2-OK.asn1.-Pfwide-types index 8a9b9f86..8a9b9f86 100644 --- a/tests/105-param-2-OK.asn1.-P +++ b/tests/105-param-2-OK.asn1.-Pfwide-types diff --git a/tests/108-param-constr-3-OK.asn1.-P b/tests/108-param-constr-3-OK.asn1.-Pfwide-types index b0903001..b0903001 100644 --- a/tests/108-param-constr-3-OK.asn1.-P +++ b/tests/108-param-constr-3-OK.asn1.-Pfwide-types diff --git a/tests/110-param-3-OK.asn1.-P b/tests/110-param-3-OK.asn1.-Pfwide-types index 9bd39a9b..9bd39a9b 100644 --- a/tests/110-param-3-OK.asn1.-P +++ b/tests/110-param-3-OK.asn1.-Pfwide-types diff --git a/tests/119-per-strings-OK.asn1.-Pgen-PER b/tests/119-per-strings-OK.asn1.-Pgen-PER index 3a24fda9..d21d818d 100644 --- a/tests/119-per-strings-OK.asn1.-Pgen-PER +++ b/tests/119-per-strings-OK.asn1.-Pgen-PER @@ -8,7 +8,7 @@ #include <UTF8String.h> #include <BMPString.h> #include <UniversalString.h> -#include <REAL.h> +#include <NativeReal.h> #include <OBJECT_IDENTIFIER.h> #include <asn_SEQUENCE_OF.h> #include <constr_SEQUENCE_OF.h> @@ -55,7 +55,7 @@ typedef struct PDU { UniversalString_t *us_cs /* OPTIONAL */; UniversalString_t *us_ce /* OPTIONAL */; UniversalString_t *us_ir /* OPTIONAL */; - REAL_t *real /* OPTIONAL */; + double *real /* OPTIONAL */; OBJECT_IDENTIFIER_t *oid /* OPTIONAL */; /* Context for parsing across buffer boundaries */ @@ -1492,7 +1492,7 @@ static asn_TYPE_member_t asn_MBR_PDU_1[] = { { ATF_POINTER, 2, offsetof(struct PDU, real), .tag = (ASN_TAG_CLASS_CONTEXT | (29 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ - .type = &asn_DEF_REAL, + .type = &asn_DEF_NativeReal, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* No PER visible constraints */ .default_value = 0, diff --git a/tests/125-bitstring-constraint-OK.asn1.-X b/tests/125-bitstring-constraint-OK.asn1.-X index 64a21c41..2cccb90b 100644 --- a/tests/125-bitstring-constraint-OK.asn1.-X +++ b/tests/125-bitstring-constraint-OK.asn1.-X @@ -1,4 +1,4 @@ -<!-- XML DTD generated by asn1c-0.9.22 --> +<!-- XML DTD generated by asn1c-0.9.24 --> <!-- ASN.1 module ModuleBitStringConstraint { iso org(3) dod(6) internet(1) private(4) diff --git a/tests/126-per-extensions-OK.asn1.-Pgen-PER b/tests/126-per-extensions-OK.asn1.-Pgen-PER index 91aac0cc..2bb515f1 100644 --- a/tests/126-per-extensions-OK.asn1.-Pgen-PER +++ b/tests/126-per-extensions-OK.asn1.-Pgen-PER @@ -222,7 +222,7 @@ asn_TYPE_descriptor_t asn_DEF_Singleton = { /*** <<< INCLUDES [PDU-2] >>> ***/ -#include <INTEGER.h> +#include <NativeInteger.h> #include <constr_CHOICE.h> /*** <<< DEPS [PDU-2] >>> ***/ @@ -240,13 +240,13 @@ typedef enum PDU_2_PR { typedef struct PDU_2 { PDU_2_PR present; union PDU_2_u { - INTEGER_t main; + long main; /* * This type is extensible, * possible extensions are below. */ - INTEGER_t ext1; - INTEGER_t ext0; + long ext1; + long ext0; } choice; /* Context for parsing across buffer boundaries */ @@ -271,7 +271,7 @@ static asn_TYPE_member_t asn_MBR_PDU_2_1[] = { { ATF_NOFLAGS, 0, offsetof(struct PDU_2, choice.main), .tag = (ASN_TAG_CLASS_CONTEXT | (3 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ - .type = &asn_DEF_INTEGER, + .type = &asn_DEF_NativeInteger, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* No PER visible constraints */ .default_value = 0, @@ -280,7 +280,7 @@ static asn_TYPE_member_t asn_MBR_PDU_2_1[] = { { ATF_NOFLAGS, 0, offsetof(struct PDU_2, choice.ext1), .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ - .type = &asn_DEF_INTEGER, + .type = &asn_DEF_NativeInteger, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* No PER visible constraints */ .default_value = 0, @@ -289,7 +289,7 @@ static asn_TYPE_member_t asn_MBR_PDU_2_1[] = { { ATF_NOFLAGS, 0, offsetof(struct PDU_2, choice.ext0), .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ - .type = &asn_DEF_INTEGER, + .type = &asn_DEF_NativeInteger, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* No PER visible constraints */ .default_value = 0, diff --git a/tests/127-per-long-OK.asn1.-Pgen-PER b/tests/127-per-long-OK.asn1.-Pgen-PER index 439468bd..ab541953 100644 --- a/tests/127-per-long-OK.asn1.-Pgen-PER +++ b/tests/127-per-long-OK.asn1.-Pgen-PER @@ -27,7 +27,6 @@ extern asn_TYPE_descriptor_t asn_DEF_T; static int unsigned32_4_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { - unsigned long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, @@ -36,7 +35,6 @@ unsigned32_4_constraint(asn_TYPE_descriptor_t *td, const void *sptr, return -1; } - value = *(const unsigned long *)sptr; /* Constraint check succeeded */ return 0; @@ -280,7 +278,6 @@ memb_full32range_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, static int memb_unsigned32_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { - unsigned long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, @@ -289,7 +286,6 @@ memb_unsigned32_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, return -1; } - value = *(const unsigned long *)sptr; /* Constraint check succeeded */ return 0; diff --git a/tests/19-param-OK.asn1.-P b/tests/19-param-OK.asn1.-Pfwide-types index eedbc1bf..eedbc1bf 100644 --- a/tests/19-param-OK.asn1.-P +++ b/tests/19-param-OK.asn1.-Pfwide-types diff --git a/tests/22-tags-OK.asn1.-P b/tests/22-tags-OK.asn1.-Pfwide-types index 988e7293..988e7293 100644 --- a/tests/22-tags-OK.asn1.-P +++ b/tests/22-tags-OK.asn1.-Pfwide-types diff --git a/tests/30-set-OK.asn1.-P b/tests/30-set-OK.asn1.-Pfwide-types index c4f65d41..c4f65d41 100644 --- a/tests/30-set-OK.asn1.-P +++ b/tests/30-set-OK.asn1.-Pfwide-types diff --git a/tests/31-set-of-OK.asn1.-P b/tests/31-set-of-OK.asn1.-Pfwide-types index 576f5c45..576f5c45 100644 --- a/tests/31-set-of-OK.asn1.-P +++ b/tests/31-set-of-OK.asn1.-Pfwide-types diff --git a/tests/37-indirect-choice-OK.asn1.-P b/tests/37-indirect-choice-OK.asn1.-Pfwide-types index 48e97aec..48e97aec 100644 --- a/tests/37-indirect-choice-OK.asn1.-P +++ b/tests/37-indirect-choice-OK.asn1.-Pfwide-types diff --git a/tests/39-sequence-of-OK.asn1.-P b/tests/39-sequence-of-OK.asn1.-Pfwide-types index 4e6ed8c8..4e6ed8c8 100644 --- a/tests/39-sequence-of-OK.asn1.-P +++ b/tests/39-sequence-of-OK.asn1.-Pfwide-types diff --git a/tests/42-real-life-OK.asn1.-PR b/tests/42-real-life-OK.asn1.-PR index 0fd30dca..3a2c1b0e 100644 --- a/tests/42-real-life-OK.asn1.-PR +++ b/tests/42-real-life-OK.asn1.-PR @@ -589,7 +589,7 @@ asn_TYPE_descriptor_t asn_DEF_VariablePart = { /*** <<< INCLUDES [ActionItem] >>> ***/ -#include <ENUMERATED.h> +#include <NativeEnumerated.h> #include <BOOLEAN.h> #include <VisibleString.h> #include <asn_SET_OF.h> @@ -610,7 +610,7 @@ typedef enum accept_as { /*** <<< TYPE-DECLS [ActionItem] >>> ***/ typedef struct ActionItem { - ENUMERATED_t accept_as; + long accept_as; struct notify { BOOLEAN_t critical; struct email { @@ -647,29 +647,29 @@ static int accept_as_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ - td->check_constraints = asn_DEF_ENUMERATED.check_constraints; + td->check_constraints = asn_DEF_NativeEnumerated.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* - * This type is implemented using ENUMERATED, + * This type is implemented using NativeEnumerated, * so here we adjust the DEF accordingly. */ static void accept_as_2_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { - td->free_struct = asn_DEF_ENUMERATED.free_struct; - td->print_struct = asn_DEF_ENUMERATED.print_struct; - td->ber_decoder = asn_DEF_ENUMERATED.ber_decoder; - td->der_encoder = asn_DEF_ENUMERATED.der_encoder; - td->xer_decoder = asn_DEF_ENUMERATED.xer_decoder; - td->xer_encoder = asn_DEF_ENUMERATED.xer_encoder; - td->uper_decoder = asn_DEF_ENUMERATED.uper_decoder; - td->uper_encoder = asn_DEF_ENUMERATED.uper_encoder; + td->free_struct = asn_DEF_NativeEnumerated.free_struct; + td->print_struct = asn_DEF_NativeEnumerated.print_struct; + td->ber_decoder = asn_DEF_NativeEnumerated.ber_decoder; + td->der_encoder = asn_DEF_NativeEnumerated.der_encoder; + td->xer_decoder = asn_DEF_NativeEnumerated.xer_decoder; + td->xer_encoder = asn_DEF_NativeEnumerated.xer_encoder; + td->uper_decoder = asn_DEF_NativeEnumerated.uper_decoder; + td->uper_encoder = asn_DEF_NativeEnumerated.uper_encoder; if(!td->per_constraints) - td->per_constraints = asn_DEF_ENUMERATED.per_constraints; - td->elements = asn_DEF_ENUMERATED.elements; - td->elements_count = asn_DEF_ENUMERATED.elements_count; - /* td->specifics = asn_DEF_ENUMERATED.specifics; // Defined explicitly */ + td->per_constraints = asn_DEF_NativeEnumerated.per_constraints; + td->elements = asn_DEF_NativeEnumerated.elements; + td->elements_count = asn_DEF_NativeEnumerated.elements_count; + /* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */ } static void diff --git a/tests/43-recursion-OK.asn1.-P b/tests/43-recursion-OK.asn1.-Pfwide-types index 3f2555c0..7cbc587e 100644 --- a/tests/43-recursion-OK.asn1.-P +++ b/tests/43-recursion-OK.asn1.-Pfwide-types @@ -239,14 +239,14 @@ struct Choice_1; typedef struct Choice_1 { Choice_1_PR present; union Choice_1_u { - struct Choice_1 *and; - struct or { + struct Choice_1 *And; + struct Or { A_SET_OF(struct Choice_1) list; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; - } or; - struct Choice_1 *not; + } Or; + struct Choice_1 *Not; INTEGER_t other; } choice; @@ -280,8 +280,8 @@ static ber_tlv_tag_t asn_DEF_or_tags_3[] = { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)) }; static asn_SET_OF_specifics_t asn_SPC_or_specs_3 = { - sizeof(struct or), - offsetof(struct or, _asn_ctx), + sizeof(struct Or), + offsetof(struct Or, _asn_ctx), 2, /* XER encoding is XMLValueList */ }; static /* Use -fall-defs-global to expose */ @@ -310,7 +310,7 @@ asn_TYPE_descriptor_t asn_DEF_or_3 = { }; static asn_TYPE_member_t asn_MBR_Choice_1_1[] = { - { ATF_POINTER, 0, offsetof(struct Choice_1, choice.and), + { ATF_POINTER, 0, offsetof(struct Choice_1, choice.And), .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)), .tag_mode = +1, /* EXPLICIT tag at current level */ .type = &asn_DEF_Choice_1, @@ -319,7 +319,7 @@ static asn_TYPE_member_t asn_MBR_Choice_1_1[] = { .default_value = 0, .name = "and" }, - { ATF_NOFLAGS, 0, offsetof(struct Choice_1, choice.or), + { ATF_NOFLAGS, 0, offsetof(struct Choice_1, choice.Or), .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)), .tag_mode = 0, .type = &asn_DEF_or_3, @@ -328,7 +328,7 @@ static asn_TYPE_member_t asn_MBR_Choice_1_1[] = { .default_value = 0, .name = "or" }, - { ATF_POINTER, 0, offsetof(struct Choice_1, choice.not), + { ATF_POINTER, 0, offsetof(struct Choice_1, choice.Not), .tag = (ASN_TAG_CLASS_CONTEXT | (3 << 2)), .tag_mode = +1, /* EXPLICIT tag at current level */ .type = &asn_DEF_Choice_1, diff --git a/tests/47-set-ext-OK.asn1.-P b/tests/47-set-ext-OK.asn1.-Pfwide-types index 0f08cd28..0f08cd28 100644 --- a/tests/47-set-ext-OK.asn1.-P +++ b/tests/47-set-ext-OK.asn1.-Pfwide-types diff --git a/tests/50-constraint-OK.asn1.-P b/tests/50-constraint-OK.asn1.-Pfwide-types index 5fcd1a91..36f29446 100644 --- a/tests/50-constraint-OK.asn1.-P +++ b/tests/50-constraint-OK.asn1.-Pfwide-types @@ -3515,7 +3515,7 @@ typedef struct Sequence { Int1_t *int1_c /* DEFAULT 3 */; Int4_t int4; Int4_t int4_c; - BOOLEAN_t *bool /* DEFAULT 1 */; + BOOLEAN_t *Bool /* DEFAULT 1 */; ENUMERATED_t enum_c; NULL_t *null /* OPTIONAL */; /* @@ -3818,7 +3818,7 @@ static asn_TYPE_member_t asn_MBR_Sequence_1[] = { .default_value = 0, .name = "int4-c" }, - { ATF_POINTER, 1, offsetof(struct Sequence, bool), + { ATF_POINTER, 1, offsetof(struct Sequence, Bool), .tag = (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), .tag_mode = 0, .type = &asn_DEF_BOOLEAN, diff --git a/tests/50-constraint-OK.asn1.-Pgen-PER b/tests/50-constraint-OK.asn1.-Pgen-PER index 74903a6a..17645532 100644 --- a/tests/50-constraint-OK.asn1.-Pgen-PER +++ b/tests/50-constraint-OK.asn1.-Pgen-PER @@ -1,11 +1,11 @@ /*** <<< INCLUDES [Int1] >>> ***/ -#include <INTEGER.h> +#include <NativeInteger.h> /*** <<< TYPE-DECLS [Int1] >>> ***/ -typedef INTEGER_t Int1_t; +typedef long Int1_t; /*** <<< FUNC-DECLS [Int1] >>> ***/ @@ -26,29 +26,29 @@ int Int1_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ - td->check_constraints = asn_DEF_INTEGER.check_constraints; + td->check_constraints = asn_DEF_NativeInteger.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* - * This type is implemented using INTEGER, + * This type is implemented using NativeInteger, * so here we adjust the DEF accordingly. */ static void Int1_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { - td->free_struct = asn_DEF_INTEGER.free_struct; - td->print_struct = asn_DEF_INTEGER.print_struct; - td->ber_decoder = asn_DEF_INTEGER.ber_decoder; - td->der_encoder = asn_DEF_INTEGER.der_encoder; - td->xer_decoder = asn_DEF_INTEGER.xer_decoder; - td->xer_encoder = asn_DEF_INTEGER.xer_encoder; - td->uper_decoder = asn_DEF_INTEGER.uper_decoder; - td->uper_encoder = asn_DEF_INTEGER.uper_encoder; + td->free_struct = asn_DEF_NativeInteger.free_struct; + td->print_struct = asn_DEF_NativeInteger.print_struct; + td->ber_decoder = asn_DEF_NativeInteger.ber_decoder; + td->der_encoder = asn_DEF_NativeInteger.der_encoder; + td->xer_decoder = asn_DEF_NativeInteger.xer_decoder; + td->xer_encoder = asn_DEF_NativeInteger.xer_encoder; + td->uper_decoder = asn_DEF_NativeInteger.uper_decoder; + td->uper_encoder = asn_DEF_NativeInteger.uper_encoder; if(!td->per_constraints) - td->per_constraints = asn_DEF_INTEGER.per_constraints; - td->elements = asn_DEF_INTEGER.elements; - td->elements_count = asn_DEF_INTEGER.elements_count; - td->specifics = asn_DEF_INTEGER.specifics; + td->per_constraints = asn_DEF_NativeInteger.per_constraints; + td->elements = asn_DEF_NativeInteger.elements; + td->elements_count = asn_DEF_NativeInteger.elements_count; + td->specifics = asn_DEF_NativeInteger.specifics; } void @@ -167,7 +167,6 @@ per_type_encoder_f Int2_encode_uper; int Int2_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { - const Int1_t *st = (const Int1_t *)sptr; long value; if(!sptr) { @@ -177,8 +176,7 @@ Int2_constraint(asn_TYPE_descriptor_t *td, const void *sptr, return -1; } - /* Check if the sign bit is present */ - value = st->buf ? ((st->buf[0] & 0x80) ? -1 : 1) : 0; + value = *(const long *)sptr; if((value >= 0)) { /* Constraint check succeeded */ @@ -336,7 +334,6 @@ per_type_encoder_f Int3_encode_uper; int Int3_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { - const Int2_t *st = (const Int2_t *)sptr; long value; if(!sptr) { @@ -346,12 +343,7 @@ Int3_constraint(asn_TYPE_descriptor_t *td, const void *sptr, return -1; } - if(asn_INTEGER2long(st, &value)) { - _ASN_CTFAIL(app_key, td, sptr, - "%s: value too large (%s:%d)", - td->name, __FILE__, __LINE__); - return -1; - } + value = *(const long *)sptr; if((value >= 0 && value <= 10)) { /* Constraint check succeeded */ @@ -509,7 +501,6 @@ per_type_encoder_f Int4_encode_uper; int Int4_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { - const Int3_t *st = (const Int3_t *)sptr; long value; if(!sptr) { @@ -519,12 +510,7 @@ Int4_constraint(asn_TYPE_descriptor_t *td, const void *sptr, return -1; } - if(asn_INTEGER2long(st, &value)) { - _ASN_CTFAIL(app_key, td, sptr, - "%s: value too large (%s:%d)", - td->name, __FILE__, __LINE__); - return -1; - } + value = *(const long *)sptr; if((value >= 1 && value <= 10)) { /* Constraint check succeeded */ @@ -682,7 +668,6 @@ per_type_encoder_f Int5_encode_uper; int Int5_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { - const Int4_t *st = (const Int4_t *)sptr; long value; if(!sptr) { @@ -692,12 +677,7 @@ Int5_constraint(asn_TYPE_descriptor_t *td, const void *sptr, return -1; } - if(asn_INTEGER2long(st, &value)) { - _ASN_CTFAIL(app_key, td, sptr, - "%s: value too large (%s:%d)", - td->name, __FILE__, __LINE__); - return -1; - } + value = *(const long *)sptr; if((value == 5)) { /* Constraint check succeeded */ @@ -831,11 +811,11 @@ asn_TYPE_descriptor_t asn_DEF_Int5 = { /*** <<< INCLUDES [ExtensibleExtensions] >>> ***/ -#include <INTEGER.h> +#include <NativeInteger.h> /*** <<< TYPE-DECLS [ExtensibleExtensions] >>> ***/ -typedef INTEGER_t ExtensibleExtensions_t; +typedef long ExtensibleExtensions_t; /*** <<< FUNC-DECLS [ExtensibleExtensions] >>> ***/ @@ -855,7 +835,6 @@ per_type_encoder_f ExtensibleExtensions_encode_uper; int ExtensibleExtensions_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { - const INTEGER_t *st = (const INTEGER_t *)sptr; long value; if(!sptr) { @@ -865,12 +844,7 @@ ExtensibleExtensions_constraint(asn_TYPE_descriptor_t *td, const void *sptr, return -1; } - if(asn_INTEGER2long(st, &value)) { - _ASN_CTFAIL(app_key, td, sptr, - "%s: value too large (%s:%d)", - td->name, __FILE__, __LINE__); - return -1; - } + value = *(const long *)sptr; if((value >= 1 && value <= 256)) { /* Constraint check succeeded */ @@ -884,24 +858,24 @@ ExtensibleExtensions_constraint(asn_TYPE_descriptor_t *td, const void *sptr, } /* - * This type is implemented using INTEGER, + * This type is implemented using NativeInteger, * so here we adjust the DEF accordingly. */ static void ExtensibleExtensions_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { - td->free_struct = asn_DEF_INTEGER.free_struct; - td->print_struct = asn_DEF_INTEGER.print_struct; - td->ber_decoder = asn_DEF_INTEGER.ber_decoder; - td->der_encoder = asn_DEF_INTEGER.der_encoder; - td->xer_decoder = asn_DEF_INTEGER.xer_decoder; - td->xer_encoder = asn_DEF_INTEGER.xer_encoder; - td->uper_decoder = asn_DEF_INTEGER.uper_decoder; - td->uper_encoder = asn_DEF_INTEGER.uper_encoder; + td->free_struct = asn_DEF_NativeInteger.free_struct; + td->print_struct = asn_DEF_NativeInteger.print_struct; + td->ber_decoder = asn_DEF_NativeInteger.ber_decoder; + td->der_encoder = asn_DEF_NativeInteger.der_encoder; + td->xer_decoder = asn_DEF_NativeInteger.xer_decoder; + td->xer_encoder = asn_DEF_NativeInteger.xer_encoder; + td->uper_decoder = asn_DEF_NativeInteger.uper_decoder; + td->uper_encoder = asn_DEF_NativeInteger.uper_encoder; if(!td->per_constraints) - td->per_constraints = asn_DEF_INTEGER.per_constraints; - td->elements = asn_DEF_INTEGER.elements; - td->elements_count = asn_DEF_INTEGER.elements_count; - td->specifics = asn_DEF_INTEGER.specifics; + td->per_constraints = asn_DEF_NativeInteger.per_constraints; + td->elements = asn_DEF_NativeInteger.elements; + td->elements_count = asn_DEF_NativeInteger.elements_count; + td->specifics = asn_DEF_NativeInteger.specifics; } void @@ -4080,7 +4054,7 @@ asn_TYPE_descriptor_t asn_DEF_VisibleIdentifier = { #include "Int1.h" #include "Int4.h" #include <BOOLEAN.h> -#include <ENUMERATED.h> +#include <NativeEnumerated.h> #include <NULL.h> #include "Int5.h" #include <constr_SEQUENCE.h> @@ -4102,8 +4076,8 @@ typedef struct Sequence { Int1_t *int1_c /* DEFAULT 3 */; Int4_t int4; Int4_t int4_c; - BOOLEAN_t *bool /* DEFAULT 1 */; - ENUMERATED_t enum_c; + BOOLEAN_t *Bool /* DEFAULT 1 */; + long enum_c; NULL_t *null /* OPTIONAL */; /* * This type is extensible, @@ -4126,29 +4100,29 @@ static int enum_c_6_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ - td->check_constraints = asn_DEF_ENUMERATED.check_constraints; + td->check_constraints = asn_DEF_NativeEnumerated.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* - * This type is implemented using ENUMERATED, + * This type is implemented using NativeEnumerated, * so here we adjust the DEF accordingly. */ static void enum_c_6_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { - td->free_struct = asn_DEF_ENUMERATED.free_struct; - td->print_struct = asn_DEF_ENUMERATED.print_struct; - td->ber_decoder = asn_DEF_ENUMERATED.ber_decoder; - td->der_encoder = asn_DEF_ENUMERATED.der_encoder; - td->xer_decoder = asn_DEF_ENUMERATED.xer_decoder; - td->xer_encoder = asn_DEF_ENUMERATED.xer_encoder; - td->uper_decoder = asn_DEF_ENUMERATED.uper_decoder; - td->uper_encoder = asn_DEF_ENUMERATED.uper_encoder; + td->free_struct = asn_DEF_NativeEnumerated.free_struct; + td->print_struct = asn_DEF_NativeEnumerated.print_struct; + td->ber_decoder = asn_DEF_NativeEnumerated.ber_decoder; + td->der_encoder = asn_DEF_NativeEnumerated.der_encoder; + td->xer_decoder = asn_DEF_NativeEnumerated.xer_decoder; + td->xer_encoder = asn_DEF_NativeEnumerated.xer_encoder; + td->uper_decoder = asn_DEF_NativeEnumerated.uper_decoder; + td->uper_encoder = asn_DEF_NativeEnumerated.uper_encoder; if(!td->per_constraints) - td->per_constraints = asn_DEF_ENUMERATED.per_constraints; - td->elements = asn_DEF_ENUMERATED.elements; - td->elements_count = asn_DEF_ENUMERATED.elements_count; - /* td->specifics = asn_DEF_ENUMERATED.specifics; // Defined explicitly */ + td->per_constraints = asn_DEF_NativeEnumerated.per_constraints; + td->elements = asn_DEF_NativeEnumerated.elements; + td->elements_count = asn_DEF_NativeEnumerated.elements_count; + /* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */ } static void @@ -4213,7 +4187,6 @@ enum_c_6_encode_uper(asn_TYPE_descriptor_t *td, static int memb_int1_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { - const Int1_t *st = (const Int1_t *)sptr; long value; if(!sptr) { @@ -4223,12 +4196,7 @@ memb_int1_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, return -1; } - if(asn_INTEGER2long(st, &value)) { - _ASN_CTFAIL(app_key, td, sptr, - "%s: value too large (%s:%d)", - td->name, __FILE__, __LINE__); - return -1; - } + value = *(const long *)sptr; if((value >= -2)) { /* Constraint check succeeded */ @@ -4244,7 +4212,6 @@ memb_int1_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, static int memb_int4_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { - const Int4_t *st = (const Int4_t *)sptr; long value; if(!sptr) { @@ -4254,12 +4221,7 @@ memb_int4_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, return -1; } - if(asn_INTEGER2long(st, &value)) { - _ASN_CTFAIL(app_key, td, sptr, - "%s: value too large (%s:%d)", - td->name, __FILE__, __LINE__); - return -1; - } + value = *(const long *)sptr; if((value >= 5 && value <= 7)) { /* Constraint check succeeded */ @@ -4275,7 +4237,6 @@ memb_int4_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, static int memb_int5_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { - const Int5_t *st = (const Int5_t *)sptr; long value; if(!sptr) { @@ -4285,12 +4246,7 @@ memb_int5_c_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, return -1; } - if(asn_INTEGER2long(st, &value)) { - _ASN_CTFAIL(app_key, td, sptr, - "%s: value too large (%s:%d)", - td->name, __FILE__, __LINE__); - return -1; - } + value = *(const long *)sptr; if((value == 5)) { /* Constraint check succeeded */ @@ -4340,13 +4296,11 @@ static int asn_DFL_2_set_3(int set_value, void **sptr) { if(set_value) { /* Install default value 3 */ - return asn_long2INTEGER(st, 3); + *st = 3; + return 0; } else { /* Test default value 3 */ - long value; - if(asn_INTEGER2long(st, &value)) - return -1; - return (value == 3); + return (*st == 3); } } static int asn_DFL_5_set_1(int set_value, void **sptr) { @@ -4444,7 +4398,7 @@ static asn_TYPE_member_t asn_MBR_Sequence_1[] = { .default_value = 0, .name = "int4-c" }, - { ATF_POINTER, 1, offsetof(struct Sequence, bool), + { ATF_POINTER, 1, offsetof(struct Sequence, Bool), .tag = (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), .tag_mode = 0, .type = &asn_DEF_BOOLEAN, @@ -4613,7 +4567,7 @@ asn_TYPE_descriptor_t asn_DEF_SequenceOf = { /*** <<< INCLUDES [Enum0] >>> ***/ -#include <ENUMERATED.h> +#include <NativeEnumerated.h> /*** <<< DEPS [Enum0] >>> ***/ @@ -4624,7 +4578,7 @@ typedef enum Enum0 { /*** <<< TYPE-DECLS [Enum0] >>> ***/ -typedef ENUMERATED_t Enum0_t; +typedef long Enum0_t; /*** <<< FUNC-DECLS [Enum0] >>> ***/ @@ -4645,29 +4599,29 @@ int Enum0_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ - td->check_constraints = asn_DEF_ENUMERATED.check_constraints; + td->check_constraints = asn_DEF_NativeEnumerated.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* - * This type is implemented using ENUMERATED, + * This type is implemented using NativeEnumerated, * so here we adjust the DEF accordingly. */ static void Enum0_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { - td->free_struct = asn_DEF_ENUMERATED.free_struct; - td->print_struct = asn_DEF_ENUMERATED.print_struct; - td->ber_decoder = asn_DEF_ENUMERATED.ber_decoder; - td->der_encoder = asn_DEF_ENUMERATED.der_encoder; - td->xer_decoder = asn_DEF_ENUMERATED.xer_decoder; - td->xer_encoder = asn_DEF_ENUMERATED.xer_encoder; - td->uper_decoder = asn_DEF_ENUMERATED.uper_decoder; - td->uper_encoder = asn_DEF_ENUMERATED.uper_encoder; + td->free_struct = asn_DEF_NativeEnumerated.free_struct; + td->print_struct = asn_DEF_NativeEnumerated.print_struct; + td->ber_decoder = asn_DEF_NativeEnumerated.ber_decoder; + td->der_encoder = asn_DEF_NativeEnumerated.der_encoder; + td->xer_decoder = asn_DEF_NativeEnumerated.xer_decoder; + td->xer_encoder = asn_DEF_NativeEnumerated.xer_encoder; + td->uper_decoder = asn_DEF_NativeEnumerated.uper_decoder; + td->uper_encoder = asn_DEF_NativeEnumerated.uper_encoder; if(!td->per_constraints) - td->per_constraints = asn_DEF_ENUMERATED.per_constraints; - td->elements = asn_DEF_ENUMERATED.elements; - td->elements_count = asn_DEF_ENUMERATED.elements_count; - /* td->specifics = asn_DEF_ENUMERATED.specifics; // Defined explicitly */ + td->per_constraints = asn_DEF_NativeEnumerated.per_constraints; + td->elements = asn_DEF_NativeEnumerated.elements; + td->elements_count = asn_DEF_NativeEnumerated.elements_count; + /* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */ } void diff --git a/tests/59-choice-extended-OK.asn1.-P b/tests/59-choice-extended-OK.asn1.-Pfwide-types index 3684a91f..3684a91f 100644 --- a/tests/59-choice-extended-OK.asn1.-P +++ b/tests/59-choice-extended-OK.asn1.-Pfwide-types diff --git a/tests/60-any-OK.asn1.-P b/tests/60-any-OK.asn1.-Pfwide-types index 4b507d1a..4b507d1a 100644 --- a/tests/60-any-OK.asn1.-P +++ b/tests/60-any-OK.asn1.-Pfwide-types diff --git a/tests/65-multi-tag-OK.asn1.-P b/tests/65-multi-tag-OK.asn1.-Pfwide-types index 7547825a..7547825a 100644 --- a/tests/65-multi-tag-OK.asn1.-P +++ b/tests/65-multi-tag-OK.asn1.-Pfwide-types diff --git a/tests/66-ref-simple-OK.asn1.-P b/tests/66-ref-simple-OK.asn1.-Pfwide-types index 9d315e24..9d315e24 100644 --- a/tests/66-ref-simple-OK.asn1.-P +++ b/tests/66-ref-simple-OK.asn1.-Pfwide-types diff --git a/tests/69-reserved-words-OK.asn1.-P b/tests/69-reserved-words-OK.asn1.-Pfwide-types index 4ee72ad4..4ee72ad4 100644 --- a/tests/69-reserved-words-OK.asn1.-P +++ b/tests/69-reserved-words-OK.asn1.-Pfwide-types diff --git a/tests/70-xer-test-OK.asn1.-P b/tests/70-xer-test-OK.asn1.-Pfwide-types index e109a8b3..e109a8b3 100644 --- a/tests/70-xer-test-OK.asn1.-P +++ b/tests/70-xer-test-OK.asn1.-Pfwide-types diff --git a/tests/72-same-names-OK.asn1.-P b/tests/72-same-names-OK.asn1.-Pfwide-types index 43b78130..43b78130 100644 --- a/tests/72-same-names-OK.asn1.-P +++ b/tests/72-same-names-OK.asn1.-Pfwide-types diff --git a/tests/73-circular-OK.asn1.-P b/tests/73-circular-OK.asn1.-Pfwide-types index fe581b66..fe581b66 100644 --- a/tests/73-circular-OK.asn1.-P +++ b/tests/73-circular-OK.asn1.-Pfwide-types diff --git a/tests/84-param-tags-OK.asn1.-P b/tests/84-param-tags-OK.asn1.-Pfwide-types index 66749420..66749420 100644 --- a/tests/84-param-tags-OK.asn1.-P +++ b/tests/84-param-tags-OK.asn1.-Pfwide-types diff --git a/tests/88-integer-enum-OK.asn1.-P b/tests/88-integer-enum-OK.asn1.-Pfwide-types index 38c1a799..38c1a799 100644 --- a/tests/88-integer-enum-OK.asn1.-P +++ b/tests/88-integer-enum-OK.asn1.-Pfwide-types diff --git a/tests/89-bit-string-enum-OK.asn1.-P b/tests/89-bit-string-enum-OK.asn1.-Pfwide-types index 663ec3f3..663ec3f3 100644 --- a/tests/89-bit-string-enum-OK.asn1.-P +++ b/tests/89-bit-string-enum-OK.asn1.-Pfwide-types diff --git a/tests/90-cond-int-type-OK.asn1.-P b/tests/90-cond-int-type-OK.asn1.-P index 08f92d4d..f21ce035 100644 --- a/tests/90-cond-int-type-OK.asn1.-P +++ b/tests/90-cond-int-type-OK.asn1.-P @@ -1,11 +1,11 @@ /*** <<< INCLUDES [CN-IntegerUnlimited] >>> ***/ -#include <INTEGER.h> +#include <NativeInteger.h> /*** <<< TYPE-DECLS [CN-IntegerUnlimited] >>> ***/ -typedef INTEGER_t CN_IntegerUnlimited_t; +typedef long CN_IntegerUnlimited_t; /*** <<< FUNC-DECLS [CN-IntegerUnlimited] >>> ***/ @@ -24,29 +24,29 @@ int CN_IntegerUnlimited_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ - td->check_constraints = asn_DEF_INTEGER.check_constraints; + td->check_constraints = asn_DEF_NativeInteger.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* - * This type is implemented using INTEGER, + * This type is implemented using NativeInteger, * so here we adjust the DEF accordingly. */ static void CN_IntegerUnlimited_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { - td->free_struct = asn_DEF_INTEGER.free_struct; - td->print_struct = asn_DEF_INTEGER.print_struct; - td->ber_decoder = asn_DEF_INTEGER.ber_decoder; - td->der_encoder = asn_DEF_INTEGER.der_encoder; - td->xer_decoder = asn_DEF_INTEGER.xer_decoder; - td->xer_encoder = asn_DEF_INTEGER.xer_encoder; - td->uper_decoder = asn_DEF_INTEGER.uper_decoder; - td->uper_encoder = asn_DEF_INTEGER.uper_encoder; + td->free_struct = asn_DEF_NativeInteger.free_struct; + td->print_struct = asn_DEF_NativeInteger.print_struct; + td->ber_decoder = asn_DEF_NativeInteger.ber_decoder; + td->der_encoder = asn_DEF_NativeInteger.der_encoder; + td->xer_decoder = asn_DEF_NativeInteger.xer_decoder; + td->xer_encoder = asn_DEF_NativeInteger.xer_encoder; + td->uper_decoder = asn_DEF_NativeInteger.uper_decoder; + td->uper_encoder = asn_DEF_NativeInteger.uper_encoder; if(!td->per_constraints) - td->per_constraints = asn_DEF_INTEGER.per_constraints; - td->elements = asn_DEF_INTEGER.elements; - td->elements_count = asn_DEF_INTEGER.elements_count; - td->specifics = asn_DEF_INTEGER.specifics; + td->per_constraints = asn_DEF_NativeInteger.per_constraints; + td->elements = asn_DEF_NativeInteger.elements; + td->elements_count = asn_DEF_NativeInteger.elements_count; + td->specifics = asn_DEF_NativeInteger.specifics; } void @@ -125,11 +125,11 @@ asn_TYPE_descriptor_t asn_DEF_CN_IntegerUnlimited = { /*** <<< INCLUDES [CN-IntegerMinMax] >>> ***/ -#include <INTEGER.h> +#include <NativeInteger.h> /*** <<< TYPE-DECLS [CN-IntegerMinMax] >>> ***/ -typedef INTEGER_t CN_IntegerMinMax_t; +typedef long CN_IntegerMinMax_t; /*** <<< FUNC-DECLS [CN-IntegerMinMax] >>> ***/ @@ -147,7 +147,6 @@ xer_type_encoder_f CN_IntegerMinMax_encode_xer; int CN_IntegerMinMax_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { - const INTEGER_t *st = (const INTEGER_t *)sptr; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, @@ -162,29 +161,29 @@ CN_IntegerMinMax_constraint(asn_TYPE_descriptor_t *td, const void *sptr, } /* Replace with underlying type checker */ - td->check_constraints = asn_DEF_INTEGER.check_constraints; + td->check_constraints = asn_DEF_NativeInteger.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* - * This type is implemented using INTEGER, + * This type is implemented using NativeInteger, * so here we adjust the DEF accordingly. */ static void CN_IntegerMinMax_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { - td->free_struct = asn_DEF_INTEGER.free_struct; - td->print_struct = asn_DEF_INTEGER.print_struct; - td->ber_decoder = asn_DEF_INTEGER.ber_decoder; - td->der_encoder = asn_DEF_INTEGER.der_encoder; - td->xer_decoder = asn_DEF_INTEGER.xer_decoder; - td->xer_encoder = asn_DEF_INTEGER.xer_encoder; - td->uper_decoder = asn_DEF_INTEGER.uper_decoder; - td->uper_encoder = asn_DEF_INTEGER.uper_encoder; + td->free_struct = asn_DEF_NativeInteger.free_struct; + td->print_struct = asn_DEF_NativeInteger.print_struct; + td->ber_decoder = asn_DEF_NativeInteger.ber_decoder; + td->der_encoder = asn_DEF_NativeInteger.der_encoder; + td->xer_decoder = asn_DEF_NativeInteger.xer_decoder; + td->xer_encoder = asn_DEF_NativeInteger.xer_encoder; + td->uper_decoder = asn_DEF_NativeInteger.uper_decoder; + td->uper_encoder = asn_DEF_NativeInteger.uper_encoder; if(!td->per_constraints) - td->per_constraints = asn_DEF_INTEGER.per_constraints; - td->elements = asn_DEF_INTEGER.elements; - td->elements_count = asn_DEF_INTEGER.elements_count; - td->specifics = asn_DEF_INTEGER.specifics; + td->per_constraints = asn_DEF_NativeInteger.per_constraints; + td->elements = asn_DEF_NativeInteger.elements; + td->elements_count = asn_DEF_NativeInteger.elements_count; + td->specifics = asn_DEF_NativeInteger.specifics; } void @@ -263,11 +262,11 @@ asn_TYPE_descriptor_t asn_DEF_CN_IntegerMinMax = { /*** <<< INCLUDES [CN-IntegerMinLow] >>> ***/ -#include <INTEGER.h> +#include <NativeInteger.h> /*** <<< TYPE-DECLS [CN-IntegerMinLow] >>> ***/ -typedef INTEGER_t CN_IntegerMinLow_t; +typedef long CN_IntegerMinLow_t; /*** <<< FUNC-DECLS [CN-IntegerMinLow] >>> ***/ @@ -285,7 +284,6 @@ xer_type_encoder_f CN_IntegerMinLow_encode_xer; int CN_IntegerMinLow_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { - const INTEGER_t *st = (const INTEGER_t *)sptr; long value; if(!sptr) { @@ -295,12 +293,7 @@ CN_IntegerMinLow_constraint(asn_TYPE_descriptor_t *td, const void *sptr, return -1; } - if(asn_INTEGER2long(st, &value)) { - _ASN_CTFAIL(app_key, td, sptr, - "%s: value too large (%s:%d)", - td->name, __FILE__, __LINE__); - return -1; - } + value = *(const long *)sptr; if((value <= 1)) { /* Constraint check succeeded */ @@ -314,24 +307,24 @@ CN_IntegerMinLow_constraint(asn_TYPE_descriptor_t *td, const void *sptr, } /* - * This type is implemented using INTEGER, + * This type is implemented using NativeInteger, * so here we adjust the DEF accordingly. */ static void CN_IntegerMinLow_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { - td->free_struct = asn_DEF_INTEGER.free_struct; - td->print_struct = asn_DEF_INTEGER.print_struct; - td->ber_decoder = asn_DEF_INTEGER.ber_decoder; - td->der_encoder = asn_DEF_INTEGER.der_encoder; - td->xer_decoder = asn_DEF_INTEGER.xer_decoder; - td->xer_encoder = asn_DEF_INTEGER.xer_encoder; - td->uper_decoder = asn_DEF_INTEGER.uper_decoder; - td->uper_encoder = asn_DEF_INTEGER.uper_encoder; + td->free_struct = asn_DEF_NativeInteger.free_struct; + td->print_struct = asn_DEF_NativeInteger.print_struct; + td->ber_decoder = asn_DEF_NativeInteger.ber_decoder; + td->der_encoder = asn_DEF_NativeInteger.der_encoder; + td->xer_decoder = asn_DEF_NativeInteger.xer_decoder; + td->xer_encoder = asn_DEF_NativeInteger.xer_encoder; + td->uper_decoder = asn_DEF_NativeInteger.uper_decoder; + td->uper_encoder = asn_DEF_NativeInteger.uper_encoder; if(!td->per_constraints) - td->per_constraints = asn_DEF_INTEGER.per_constraints; - td->elements = asn_DEF_INTEGER.elements; - td->elements_count = asn_DEF_INTEGER.elements_count; - td->specifics = asn_DEF_INTEGER.specifics; + td->per_constraints = asn_DEF_NativeInteger.per_constraints; + td->elements = asn_DEF_NativeInteger.elements; + td->elements_count = asn_DEF_NativeInteger.elements_count; + td->specifics = asn_DEF_NativeInteger.specifics; } void @@ -703,11 +696,11 @@ asn_TYPE_descriptor_t asn_DEF_NO_IntegerLowHigh = { /*** <<< INCLUDES [CN-IntegerLowMax] >>> ***/ -#include <INTEGER.h> +#include <NativeInteger.h> /*** <<< TYPE-DECLS [CN-IntegerLowMax] >>> ***/ -typedef INTEGER_t CN_IntegerLowMax_t; +typedef long CN_IntegerLowMax_t; /*** <<< FUNC-DECLS [CN-IntegerLowMax] >>> ***/ @@ -725,7 +718,6 @@ xer_type_encoder_f CN_IntegerLowMax_encode_xer; int CN_IntegerLowMax_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { - const INTEGER_t *st = (const INTEGER_t *)sptr; long value; if(!sptr) { @@ -735,12 +727,7 @@ CN_IntegerLowMax_constraint(asn_TYPE_descriptor_t *td, const void *sptr, return -1; } - if(asn_INTEGER2long(st, &value)) { - _ASN_CTFAIL(app_key, td, sptr, - "%s: value too large (%s:%d)", - td->name, __FILE__, __LINE__); - return -1; - } + value = *(const long *)sptr; if((value >= 1)) { /* Constraint check succeeded */ @@ -754,24 +741,24 @@ CN_IntegerLowMax_constraint(asn_TYPE_descriptor_t *td, const void *sptr, } /* - * This type is implemented using INTEGER, + * This type is implemented using NativeInteger, * so here we adjust the DEF accordingly. */ static void CN_IntegerLowMax_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { - td->free_struct = asn_DEF_INTEGER.free_struct; - td->print_struct = asn_DEF_INTEGER.print_struct; - td->ber_decoder = asn_DEF_INTEGER.ber_decoder; - td->der_encoder = asn_DEF_INTEGER.der_encoder; - td->xer_decoder = asn_DEF_INTEGER.xer_decoder; - td->xer_encoder = asn_DEF_INTEGER.xer_encoder; - td->uper_decoder = asn_DEF_INTEGER.uper_decoder; - td->uper_encoder = asn_DEF_INTEGER.uper_encoder; + td->free_struct = asn_DEF_NativeInteger.free_struct; + td->print_struct = asn_DEF_NativeInteger.print_struct; + td->ber_decoder = asn_DEF_NativeInteger.ber_decoder; + td->der_encoder = asn_DEF_NativeInteger.der_encoder; + td->xer_decoder = asn_DEF_NativeInteger.xer_decoder; + td->xer_encoder = asn_DEF_NativeInteger.xer_encoder; + td->uper_decoder = asn_DEF_NativeInteger.uper_decoder; + td->uper_encoder = asn_DEF_NativeInteger.uper_encoder; if(!td->per_constraints) - td->per_constraints = asn_DEF_INTEGER.per_constraints; - td->elements = asn_DEF_INTEGER.elements; - td->elements_count = asn_DEF_INTEGER.elements_count; - td->specifics = asn_DEF_INTEGER.specifics; + td->per_constraints = asn_DEF_NativeInteger.per_constraints; + td->elements = asn_DEF_NativeInteger.elements; + td->elements_count = asn_DEF_NativeInteger.elements_count; + td->specifics = asn_DEF_NativeInteger.specifics; } void @@ -2000,11 +1987,11 @@ asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange4 = { /*** <<< INCLUDES [OK-IntegerInRange5] >>> ***/ -#include <INTEGER.h> +#include <NativeInteger.h> /*** <<< TYPE-DECLS [OK-IntegerInRange5] >>> ***/ -typedef INTEGER_t OK_IntegerInRange5_t; +typedef long OK_IntegerInRange5_t; /*** <<< FUNC-DECLS [OK-IntegerInRange5] >>> ***/ @@ -2022,7 +2009,6 @@ xer_type_encoder_f OK_IntegerInRange5_encode_xer; int OK_IntegerInRange5_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { - const INTEGER_t *st = (const INTEGER_t *)sptr; long value; if(!sptr) { @@ -2032,12 +2018,7 @@ OK_IntegerInRange5_constraint(asn_TYPE_descriptor_t *td, const void *sptr, return -1; } - if(asn_INTEGER2long(st, &value)) { - _ASN_CTFAIL(app_key, td, sptr, - "%s: value too large (%s:%d)", - td->name, __FILE__, __LINE__); - return -1; - } + value = *(const long *)sptr; if(((value == (-2147483647L - 1)) || (value == 2147483647))) { /* Constraint check succeeded */ @@ -2051,24 +2032,24 @@ OK_IntegerInRange5_constraint(asn_TYPE_descriptor_t *td, const void *sptr, } /* - * This type is implemented using INTEGER, + * This type is implemented using NativeInteger, * so here we adjust the DEF accordingly. */ static void OK_IntegerInRange5_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { - td->free_struct = asn_DEF_INTEGER.free_struct; - td->print_struct = asn_DEF_INTEGER.print_struct; - td->ber_decoder = asn_DEF_INTEGER.ber_decoder; - td->der_encoder = asn_DEF_INTEGER.der_encoder; - td->xer_decoder = asn_DEF_INTEGER.xer_decoder; - td->xer_encoder = asn_DEF_INTEGER.xer_encoder; - td->uper_decoder = asn_DEF_INTEGER.uper_decoder; - td->uper_encoder = asn_DEF_INTEGER.uper_encoder; + td->free_struct = asn_DEF_NativeInteger.free_struct; + td->print_struct = asn_DEF_NativeInteger.print_struct; + td->ber_decoder = asn_DEF_NativeInteger.ber_decoder; + td->der_encoder = asn_DEF_NativeInteger.der_encoder; + td->xer_decoder = asn_DEF_NativeInteger.xer_decoder; + td->xer_encoder = asn_DEF_NativeInteger.xer_encoder; + td->uper_decoder = asn_DEF_NativeInteger.uper_decoder; + td->uper_encoder = asn_DEF_NativeInteger.uper_encoder; if(!td->per_constraints) - td->per_constraints = asn_DEF_INTEGER.per_constraints; - td->elements = asn_DEF_INTEGER.elements; - td->elements_count = asn_DEF_INTEGER.elements_count; - td->specifics = asn_DEF_INTEGER.specifics; + td->per_constraints = asn_DEF_NativeInteger.per_constraints; + td->elements = asn_DEF_NativeInteger.elements; + td->elements_count = asn_DEF_NativeInteger.elements_count; + td->specifics = asn_DEF_NativeInteger.specifics; } void @@ -2169,7 +2150,6 @@ xer_type_encoder_f NO_IntegerInRange6_encode_xer; int NO_IntegerInRange6_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { - unsigned long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, @@ -2178,7 +2158,6 @@ NO_IntegerInRange6_constraint(asn_TYPE_descriptor_t *td, const void *sptr, return -1; } - value = *(const unsigned long *)sptr; /* Constraint check succeeded */ return 0; @@ -2286,7 +2265,7 @@ asn_TYPE_descriptor_t asn_DEF_NO_IntegerInRange6 = { /*** <<< INCLUDES [CN-IntegerEnumerated1] >>> ***/ -#include <INTEGER.h> +#include <NativeInteger.h> /*** <<< DEPS [CN-IntegerEnumerated1] >>> ***/ @@ -2297,7 +2276,7 @@ typedef enum CN_IntegerEnumerated1 { /*** <<< TYPE-DECLS [CN-IntegerEnumerated1] >>> ***/ -typedef INTEGER_t CN_IntegerEnumerated1_t; +typedef long CN_IntegerEnumerated1_t; /*** <<< FUNC-DECLS [CN-IntegerEnumerated1] >>> ***/ @@ -2316,29 +2295,29 @@ int CN_IntegerEnumerated1_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ - td->check_constraints = asn_DEF_INTEGER.check_constraints; + td->check_constraints = asn_DEF_NativeInteger.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* - * This type is implemented using INTEGER, + * This type is implemented using NativeInteger, * so here we adjust the DEF accordingly. */ static void CN_IntegerEnumerated1_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { - td->free_struct = asn_DEF_INTEGER.free_struct; - td->print_struct = asn_DEF_INTEGER.print_struct; - td->ber_decoder = asn_DEF_INTEGER.ber_decoder; - td->der_encoder = asn_DEF_INTEGER.der_encoder; - td->xer_decoder = asn_DEF_INTEGER.xer_decoder; - td->xer_encoder = asn_DEF_INTEGER.xer_encoder; - td->uper_decoder = asn_DEF_INTEGER.uper_decoder; - td->uper_encoder = asn_DEF_INTEGER.uper_encoder; + td->free_struct = asn_DEF_NativeInteger.free_struct; + td->print_struct = asn_DEF_NativeInteger.print_struct; + td->ber_decoder = asn_DEF_NativeInteger.ber_decoder; + td->der_encoder = asn_DEF_NativeInteger.der_encoder; + td->xer_decoder = asn_DEF_NativeInteger.xer_decoder; + td->xer_encoder = asn_DEF_NativeInteger.xer_encoder; + td->uper_decoder = asn_DEF_NativeInteger.uper_decoder; + td->uper_encoder = asn_DEF_NativeInteger.uper_encoder; if(!td->per_constraints) - td->per_constraints = asn_DEF_INTEGER.per_constraints; - td->elements = asn_DEF_INTEGER.elements; - td->elements_count = asn_DEF_INTEGER.elements_count; - td->specifics = asn_DEF_INTEGER.specifics; + td->per_constraints = asn_DEF_NativeInteger.per_constraints; + td->elements = asn_DEF_NativeInteger.elements; + td->elements_count = asn_DEF_NativeInteger.elements_count; + td->specifics = asn_DEF_NativeInteger.specifics; } void diff --git a/tests/90-cond-int-type-OK.asn1.-Pfnative-types b/tests/90-cond-int-type-OK.asn1.-Pfwide-types index 4c898f8f..29edfe00 100644 --- a/tests/90-cond-int-type-OK.asn1.-Pfnative-types +++ b/tests/90-cond-int-type-OK.asn1.-Pfwide-types @@ -1,11 +1,11 @@ /*** <<< INCLUDES [CN-IntegerUnlimited] >>> ***/ -#include <NativeInteger.h> +#include <INTEGER.h> /*** <<< TYPE-DECLS [CN-IntegerUnlimited] >>> ***/ -typedef long CN_IntegerUnlimited_t; +typedef INTEGER_t CN_IntegerUnlimited_t; /*** <<< FUNC-DECLS [CN-IntegerUnlimited] >>> ***/ @@ -24,29 +24,29 @@ int CN_IntegerUnlimited_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ - td->check_constraints = asn_DEF_NativeInteger.check_constraints; + td->check_constraints = asn_DEF_INTEGER.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* - * This type is implemented using NativeInteger, + * This type is implemented using INTEGER, * so here we adjust the DEF accordingly. */ static void CN_IntegerUnlimited_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { - td->free_struct = asn_DEF_NativeInteger.free_struct; - td->print_struct = asn_DEF_NativeInteger.print_struct; - td->ber_decoder = asn_DEF_NativeInteger.ber_decoder; - td->der_encoder = asn_DEF_NativeInteger.der_encoder; - td->xer_decoder = asn_DEF_NativeInteger.xer_decoder; - td->xer_encoder = asn_DEF_NativeInteger.xer_encoder; - td->uper_decoder = asn_DEF_NativeInteger.uper_decoder; - td->uper_encoder = asn_DEF_NativeInteger.uper_encoder; + td->free_struct = asn_DEF_INTEGER.free_struct; + td->print_struct = asn_DEF_INTEGER.print_struct; + td->ber_decoder = asn_DEF_INTEGER.ber_decoder; + td->der_encoder = asn_DEF_INTEGER.der_encoder; + td->xer_decoder = asn_DEF_INTEGER.xer_decoder; + td->xer_encoder = asn_DEF_INTEGER.xer_encoder; + td->uper_decoder = asn_DEF_INTEGER.uper_decoder; + td->uper_encoder = asn_DEF_INTEGER.uper_encoder; if(!td->per_constraints) - td->per_constraints = asn_DEF_NativeInteger.per_constraints; - td->elements = asn_DEF_NativeInteger.elements; - td->elements_count = asn_DEF_NativeInteger.elements_count; - td->specifics = asn_DEF_NativeInteger.specifics; + td->per_constraints = asn_DEF_INTEGER.per_constraints; + td->elements = asn_DEF_INTEGER.elements; + td->elements_count = asn_DEF_INTEGER.elements_count; + td->specifics = asn_DEF_INTEGER.specifics; } void @@ -125,11 +125,11 @@ asn_TYPE_descriptor_t asn_DEF_CN_IntegerUnlimited = { /*** <<< INCLUDES [CN-IntegerMinMax] >>> ***/ -#include <NativeInteger.h> +#include <INTEGER.h> /*** <<< TYPE-DECLS [CN-IntegerMinMax] >>> ***/ -typedef long CN_IntegerMinMax_t; +typedef INTEGER_t CN_IntegerMinMax_t; /*** <<< FUNC-DECLS [CN-IntegerMinMax] >>> ***/ @@ -147,6 +147,7 @@ xer_type_encoder_f CN_IntegerMinMax_encode_xer; int CN_IntegerMinMax_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { + const INTEGER_t *st = (const INTEGER_t *)sptr; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, @@ -161,29 +162,29 @@ CN_IntegerMinMax_constraint(asn_TYPE_descriptor_t *td, const void *sptr, } /* Replace with underlying type checker */ - td->check_constraints = asn_DEF_NativeInteger.check_constraints; + td->check_constraints = asn_DEF_INTEGER.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* - * This type is implemented using NativeInteger, + * This type is implemented using INTEGER, * so here we adjust the DEF accordingly. */ static void CN_IntegerMinMax_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { - td->free_struct = asn_DEF_NativeInteger.free_struct; - td->print_struct = asn_DEF_NativeInteger.print_struct; - td->ber_decoder = asn_DEF_NativeInteger.ber_decoder; - td->der_encoder = asn_DEF_NativeInteger.der_encoder; - td->xer_decoder = asn_DEF_NativeInteger.xer_decoder; - td->xer_encoder = asn_DEF_NativeInteger.xer_encoder; - td->uper_decoder = asn_DEF_NativeInteger.uper_decoder; - td->uper_encoder = asn_DEF_NativeInteger.uper_encoder; + td->free_struct = asn_DEF_INTEGER.free_struct; + td->print_struct = asn_DEF_INTEGER.print_struct; + td->ber_decoder = asn_DEF_INTEGER.ber_decoder; + td->der_encoder = asn_DEF_INTEGER.der_encoder; + td->xer_decoder = asn_DEF_INTEGER.xer_decoder; + td->xer_encoder = asn_DEF_INTEGER.xer_encoder; + td->uper_decoder = asn_DEF_INTEGER.uper_decoder; + td->uper_encoder = asn_DEF_INTEGER.uper_encoder; if(!td->per_constraints) - td->per_constraints = asn_DEF_NativeInteger.per_constraints; - td->elements = asn_DEF_NativeInteger.elements; - td->elements_count = asn_DEF_NativeInteger.elements_count; - td->specifics = asn_DEF_NativeInteger.specifics; + td->per_constraints = asn_DEF_INTEGER.per_constraints; + td->elements = asn_DEF_INTEGER.elements; + td->elements_count = asn_DEF_INTEGER.elements_count; + td->specifics = asn_DEF_INTEGER.specifics; } void @@ -262,11 +263,11 @@ asn_TYPE_descriptor_t asn_DEF_CN_IntegerMinMax = { /*** <<< INCLUDES [CN-IntegerMinLow] >>> ***/ -#include <NativeInteger.h> +#include <INTEGER.h> /*** <<< TYPE-DECLS [CN-IntegerMinLow] >>> ***/ -typedef long CN_IntegerMinLow_t; +typedef INTEGER_t CN_IntegerMinLow_t; /*** <<< FUNC-DECLS [CN-IntegerMinLow] >>> ***/ @@ -284,6 +285,7 @@ xer_type_encoder_f CN_IntegerMinLow_encode_xer; int CN_IntegerMinLow_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { + const INTEGER_t *st = (const INTEGER_t *)sptr; long value; if(!sptr) { @@ -293,7 +295,12 @@ CN_IntegerMinLow_constraint(asn_TYPE_descriptor_t *td, const void *sptr, return -1; } - value = *(const long *)sptr; + if(asn_INTEGER2long(st, &value)) { + _ASN_CTFAIL(app_key, td, sptr, + "%s: value too large (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } if((value <= 1)) { /* Constraint check succeeded */ @@ -307,24 +314,24 @@ CN_IntegerMinLow_constraint(asn_TYPE_descriptor_t *td, const void *sptr, } /* - * This type is implemented using NativeInteger, + * This type is implemented using INTEGER, * so here we adjust the DEF accordingly. */ static void CN_IntegerMinLow_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { - td->free_struct = asn_DEF_NativeInteger.free_struct; - td->print_struct = asn_DEF_NativeInteger.print_struct; - td->ber_decoder = asn_DEF_NativeInteger.ber_decoder; - td->der_encoder = asn_DEF_NativeInteger.der_encoder; - td->xer_decoder = asn_DEF_NativeInteger.xer_decoder; - td->xer_encoder = asn_DEF_NativeInteger.xer_encoder; - td->uper_decoder = asn_DEF_NativeInteger.uper_decoder; - td->uper_encoder = asn_DEF_NativeInteger.uper_encoder; + td->free_struct = asn_DEF_INTEGER.free_struct; + td->print_struct = asn_DEF_INTEGER.print_struct; + td->ber_decoder = asn_DEF_INTEGER.ber_decoder; + td->der_encoder = asn_DEF_INTEGER.der_encoder; + td->xer_decoder = asn_DEF_INTEGER.xer_decoder; + td->xer_encoder = asn_DEF_INTEGER.xer_encoder; + td->uper_decoder = asn_DEF_INTEGER.uper_decoder; + td->uper_encoder = asn_DEF_INTEGER.uper_encoder; if(!td->per_constraints) - td->per_constraints = asn_DEF_NativeInteger.per_constraints; - td->elements = asn_DEF_NativeInteger.elements; - td->elements_count = asn_DEF_NativeInteger.elements_count; - td->specifics = asn_DEF_NativeInteger.specifics; + td->per_constraints = asn_DEF_INTEGER.per_constraints; + td->elements = asn_DEF_INTEGER.elements; + td->elements_count = asn_DEF_INTEGER.elements_count; + td->specifics = asn_DEF_INTEGER.specifics; } void @@ -696,11 +703,11 @@ asn_TYPE_descriptor_t asn_DEF_NO_IntegerLowHigh = { /*** <<< INCLUDES [CN-IntegerLowMax] >>> ***/ -#include <NativeInteger.h> +#include <INTEGER.h> /*** <<< TYPE-DECLS [CN-IntegerLowMax] >>> ***/ -typedef long CN_IntegerLowMax_t; +typedef INTEGER_t CN_IntegerLowMax_t; /*** <<< FUNC-DECLS [CN-IntegerLowMax] >>> ***/ @@ -718,6 +725,7 @@ xer_type_encoder_f CN_IntegerLowMax_encode_xer; int CN_IntegerLowMax_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { + const INTEGER_t *st = (const INTEGER_t *)sptr; long value; if(!sptr) { @@ -727,7 +735,12 @@ CN_IntegerLowMax_constraint(asn_TYPE_descriptor_t *td, const void *sptr, return -1; } - value = *(const long *)sptr; + if(asn_INTEGER2long(st, &value)) { + _ASN_CTFAIL(app_key, td, sptr, + "%s: value too large (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } if((value >= 1)) { /* Constraint check succeeded */ @@ -741,24 +754,24 @@ CN_IntegerLowMax_constraint(asn_TYPE_descriptor_t *td, const void *sptr, } /* - * This type is implemented using NativeInteger, + * This type is implemented using INTEGER, * so here we adjust the DEF accordingly. */ static void CN_IntegerLowMax_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { - td->free_struct = asn_DEF_NativeInteger.free_struct; - td->print_struct = asn_DEF_NativeInteger.print_struct; - td->ber_decoder = asn_DEF_NativeInteger.ber_decoder; - td->der_encoder = asn_DEF_NativeInteger.der_encoder; - td->xer_decoder = asn_DEF_NativeInteger.xer_decoder; - td->xer_encoder = asn_DEF_NativeInteger.xer_encoder; - td->uper_decoder = asn_DEF_NativeInteger.uper_decoder; - td->uper_encoder = asn_DEF_NativeInteger.uper_encoder; + td->free_struct = asn_DEF_INTEGER.free_struct; + td->print_struct = asn_DEF_INTEGER.print_struct; + td->ber_decoder = asn_DEF_INTEGER.ber_decoder; + td->der_encoder = asn_DEF_INTEGER.der_encoder; + td->xer_decoder = asn_DEF_INTEGER.xer_decoder; + td->xer_encoder = asn_DEF_INTEGER.xer_encoder; + td->uper_decoder = asn_DEF_INTEGER.uper_decoder; + td->uper_encoder = asn_DEF_INTEGER.uper_encoder; if(!td->per_constraints) - td->per_constraints = asn_DEF_NativeInteger.per_constraints; - td->elements = asn_DEF_NativeInteger.elements; - td->elements_count = asn_DEF_NativeInteger.elements_count; - td->specifics = asn_DEF_NativeInteger.specifics; + td->per_constraints = asn_DEF_INTEGER.per_constraints; + td->elements = asn_DEF_INTEGER.elements; + td->elements_count = asn_DEF_INTEGER.elements_count; + td->specifics = asn_DEF_INTEGER.specifics; } void @@ -1987,11 +2000,11 @@ asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange4 = { /*** <<< INCLUDES [OK-IntegerInRange5] >>> ***/ -#include <NativeInteger.h> +#include <INTEGER.h> /*** <<< TYPE-DECLS [OK-IntegerInRange5] >>> ***/ -typedef long OK_IntegerInRange5_t; +typedef INTEGER_t OK_IntegerInRange5_t; /*** <<< FUNC-DECLS [OK-IntegerInRange5] >>> ***/ @@ -2009,6 +2022,7 @@ xer_type_encoder_f OK_IntegerInRange5_encode_xer; int OK_IntegerInRange5_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { + const INTEGER_t *st = (const INTEGER_t *)sptr; long value; if(!sptr) { @@ -2018,7 +2032,12 @@ OK_IntegerInRange5_constraint(asn_TYPE_descriptor_t *td, const void *sptr, return -1; } - value = *(const long *)sptr; + if(asn_INTEGER2long(st, &value)) { + _ASN_CTFAIL(app_key, td, sptr, + "%s: value too large (%s:%d)", + td->name, __FILE__, __LINE__); + return -1; + } if(((value == (-2147483647L - 1)) || (value == 2147483647))) { /* Constraint check succeeded */ @@ -2032,24 +2051,24 @@ OK_IntegerInRange5_constraint(asn_TYPE_descriptor_t *td, const void *sptr, } /* - * This type is implemented using NativeInteger, + * This type is implemented using INTEGER, * so here we adjust the DEF accordingly. */ static void OK_IntegerInRange5_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { - td->free_struct = asn_DEF_NativeInteger.free_struct; - td->print_struct = asn_DEF_NativeInteger.print_struct; - td->ber_decoder = asn_DEF_NativeInteger.ber_decoder; - td->der_encoder = asn_DEF_NativeInteger.der_encoder; - td->xer_decoder = asn_DEF_NativeInteger.xer_decoder; - td->xer_encoder = asn_DEF_NativeInteger.xer_encoder; - td->uper_decoder = asn_DEF_NativeInteger.uper_decoder; - td->uper_encoder = asn_DEF_NativeInteger.uper_encoder; + td->free_struct = asn_DEF_INTEGER.free_struct; + td->print_struct = asn_DEF_INTEGER.print_struct; + td->ber_decoder = asn_DEF_INTEGER.ber_decoder; + td->der_encoder = asn_DEF_INTEGER.der_encoder; + td->xer_decoder = asn_DEF_INTEGER.xer_decoder; + td->xer_encoder = asn_DEF_INTEGER.xer_encoder; + td->uper_decoder = asn_DEF_INTEGER.uper_decoder; + td->uper_encoder = asn_DEF_INTEGER.uper_encoder; if(!td->per_constraints) - td->per_constraints = asn_DEF_NativeInteger.per_constraints; - td->elements = asn_DEF_NativeInteger.elements; - td->elements_count = asn_DEF_NativeInteger.elements_count; - td->specifics = asn_DEF_NativeInteger.specifics; + td->per_constraints = asn_DEF_INTEGER.per_constraints; + td->elements = asn_DEF_INTEGER.elements; + td->elements_count = asn_DEF_INTEGER.elements_count; + td->specifics = asn_DEF_INTEGER.specifics; } void @@ -2150,7 +2169,6 @@ xer_type_encoder_f NO_IntegerInRange6_encode_xer; int NO_IntegerInRange6_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { - unsigned long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, @@ -2159,7 +2177,6 @@ NO_IntegerInRange6_constraint(asn_TYPE_descriptor_t *td, const void *sptr, return -1; } - value = *(const unsigned long *)sptr; /* Constraint check succeeded */ return 0; @@ -2267,7 +2284,7 @@ asn_TYPE_descriptor_t asn_DEF_NO_IntegerInRange6 = { /*** <<< INCLUDES [CN-IntegerEnumerated1] >>> ***/ -#include <NativeInteger.h> +#include <INTEGER.h> /*** <<< DEPS [CN-IntegerEnumerated1] >>> ***/ @@ -2278,7 +2295,7 @@ typedef enum CN_IntegerEnumerated1 { /*** <<< TYPE-DECLS [CN-IntegerEnumerated1] >>> ***/ -typedef long CN_IntegerEnumerated1_t; +typedef INTEGER_t CN_IntegerEnumerated1_t; /*** <<< FUNC-DECLS [CN-IntegerEnumerated1] >>> ***/ @@ -2297,29 +2314,29 @@ int CN_IntegerEnumerated1_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ - td->check_constraints = asn_DEF_NativeInteger.check_constraints; + td->check_constraints = asn_DEF_INTEGER.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* - * This type is implemented using NativeInteger, + * This type is implemented using INTEGER, * so here we adjust the DEF accordingly. */ static void CN_IntegerEnumerated1_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { - td->free_struct = asn_DEF_NativeInteger.free_struct; - td->print_struct = asn_DEF_NativeInteger.print_struct; - td->ber_decoder = asn_DEF_NativeInteger.ber_decoder; - td->der_encoder = asn_DEF_NativeInteger.der_encoder; - td->xer_decoder = asn_DEF_NativeInteger.xer_decoder; - td->xer_encoder = asn_DEF_NativeInteger.xer_encoder; - td->uper_decoder = asn_DEF_NativeInteger.uper_decoder; - td->uper_encoder = asn_DEF_NativeInteger.uper_encoder; + td->free_struct = asn_DEF_INTEGER.free_struct; + td->print_struct = asn_DEF_INTEGER.print_struct; + td->ber_decoder = asn_DEF_INTEGER.ber_decoder; + td->der_encoder = asn_DEF_INTEGER.der_encoder; + td->xer_decoder = asn_DEF_INTEGER.xer_decoder; + td->xer_encoder = asn_DEF_INTEGER.xer_encoder; + td->uper_decoder = asn_DEF_INTEGER.uper_decoder; + td->uper_encoder = asn_DEF_INTEGER.uper_encoder; if(!td->per_constraints) - td->per_constraints = asn_DEF_NativeInteger.per_constraints; - td->elements = asn_DEF_NativeInteger.elements; - td->elements_count = asn_DEF_NativeInteger.elements_count; - td->specifics = asn_DEF_NativeInteger.specifics; + td->per_constraints = asn_DEF_INTEGER.per_constraints; + td->elements = asn_DEF_INTEGER.elements; + td->elements_count = asn_DEF_INTEGER.elements_count; + td->specifics = asn_DEF_INTEGER.specifics; } void diff --git a/tests/90-cond-int-type-OK.asn1.-Pgen-PER b/tests/90-cond-int-type-OK.asn1.-Pgen-PER index 5b16f460..01b0abc9 100644 --- a/tests/90-cond-int-type-OK.asn1.-Pgen-PER +++ b/tests/90-cond-int-type-OK.asn1.-Pgen-PER @@ -1,11 +1,11 @@ /*** <<< INCLUDES [CN-IntegerUnlimited] >>> ***/ -#include <INTEGER.h> +#include <NativeInteger.h> /*** <<< TYPE-DECLS [CN-IntegerUnlimited] >>> ***/ -typedef INTEGER_t CN_IntegerUnlimited_t; +typedef long CN_IntegerUnlimited_t; /*** <<< FUNC-DECLS [CN-IntegerUnlimited] >>> ***/ @@ -26,29 +26,29 @@ int CN_IntegerUnlimited_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ - td->check_constraints = asn_DEF_INTEGER.check_constraints; + td->check_constraints = asn_DEF_NativeInteger.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* - * This type is implemented using INTEGER, + * This type is implemented using NativeInteger, * so here we adjust the DEF accordingly. */ static void CN_IntegerUnlimited_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { - td->free_struct = asn_DEF_INTEGER.free_struct; - td->print_struct = asn_DEF_INTEGER.print_struct; - td->ber_decoder = asn_DEF_INTEGER.ber_decoder; - td->der_encoder = asn_DEF_INTEGER.der_encoder; - td->xer_decoder = asn_DEF_INTEGER.xer_decoder; - td->xer_encoder = asn_DEF_INTEGER.xer_encoder; - td->uper_decoder = asn_DEF_INTEGER.uper_decoder; - td->uper_encoder = asn_DEF_INTEGER.uper_encoder; + td->free_struct = asn_DEF_NativeInteger.free_struct; + td->print_struct = asn_DEF_NativeInteger.print_struct; + td->ber_decoder = asn_DEF_NativeInteger.ber_decoder; + td->der_encoder = asn_DEF_NativeInteger.der_encoder; + td->xer_decoder = asn_DEF_NativeInteger.xer_decoder; + td->xer_encoder = asn_DEF_NativeInteger.xer_encoder; + td->uper_decoder = asn_DEF_NativeInteger.uper_decoder; + td->uper_encoder = asn_DEF_NativeInteger.uper_encoder; if(!td->per_constraints) - td->per_constraints = asn_DEF_INTEGER.per_constraints; - td->elements = asn_DEF_INTEGER.elements; - td->elements_count = asn_DEF_INTEGER.elements_count; - td->specifics = asn_DEF_INTEGER.specifics; + td->per_constraints = asn_DEF_NativeInteger.per_constraints; + td->elements = asn_DEF_NativeInteger.elements; + td->elements_count = asn_DEF_NativeInteger.elements_count; + td->specifics = asn_DEF_NativeInteger.specifics; } void @@ -143,11 +143,11 @@ asn_TYPE_descriptor_t asn_DEF_CN_IntegerUnlimited = { /*** <<< INCLUDES [CN-IntegerMinMax] >>> ***/ -#include <INTEGER.h> +#include <NativeInteger.h> /*** <<< TYPE-DECLS [CN-IntegerMinMax] >>> ***/ -typedef INTEGER_t CN_IntegerMinMax_t; +typedef long CN_IntegerMinMax_t; /*** <<< FUNC-DECLS [CN-IntegerMinMax] >>> ***/ @@ -167,7 +167,6 @@ per_type_encoder_f CN_IntegerMinMax_encode_uper; int CN_IntegerMinMax_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { - const INTEGER_t *st = (const INTEGER_t *)sptr; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, @@ -182,29 +181,29 @@ CN_IntegerMinMax_constraint(asn_TYPE_descriptor_t *td, const void *sptr, } /* Replace with underlying type checker */ - td->check_constraints = asn_DEF_INTEGER.check_constraints; + td->check_constraints = asn_DEF_NativeInteger.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* - * This type is implemented using INTEGER, + * This type is implemented using NativeInteger, * so here we adjust the DEF accordingly. */ static void CN_IntegerMinMax_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { - td->free_struct = asn_DEF_INTEGER.free_struct; - td->print_struct = asn_DEF_INTEGER.print_struct; - td->ber_decoder = asn_DEF_INTEGER.ber_decoder; - td->der_encoder = asn_DEF_INTEGER.der_encoder; - td->xer_decoder = asn_DEF_INTEGER.xer_decoder; - td->xer_encoder = asn_DEF_INTEGER.xer_encoder; - td->uper_decoder = asn_DEF_INTEGER.uper_decoder; - td->uper_encoder = asn_DEF_INTEGER.uper_encoder; + td->free_struct = asn_DEF_NativeInteger.free_struct; + td->print_struct = asn_DEF_NativeInteger.print_struct; + td->ber_decoder = asn_DEF_NativeInteger.ber_decoder; + td->der_encoder = asn_DEF_NativeInteger.der_encoder; + td->xer_decoder = asn_DEF_NativeInteger.xer_decoder; + td->xer_encoder = asn_DEF_NativeInteger.xer_encoder; + td->uper_decoder = asn_DEF_NativeInteger.uper_decoder; + td->uper_encoder = asn_DEF_NativeInteger.uper_encoder; if(!td->per_constraints) - td->per_constraints = asn_DEF_INTEGER.per_constraints; - td->elements = asn_DEF_INTEGER.elements; - td->elements_count = asn_DEF_INTEGER.elements_count; - td->specifics = asn_DEF_INTEGER.specifics; + td->per_constraints = asn_DEF_NativeInteger.per_constraints; + td->elements = asn_DEF_NativeInteger.elements; + td->elements_count = asn_DEF_NativeInteger.elements_count; + td->specifics = asn_DEF_NativeInteger.specifics; } void @@ -307,11 +306,11 @@ asn_TYPE_descriptor_t asn_DEF_CN_IntegerMinMax = { /*** <<< INCLUDES [CN-IntegerMinLow] >>> ***/ -#include <INTEGER.h> +#include <NativeInteger.h> /*** <<< TYPE-DECLS [CN-IntegerMinLow] >>> ***/ -typedef INTEGER_t CN_IntegerMinLow_t; +typedef long CN_IntegerMinLow_t; /*** <<< FUNC-DECLS [CN-IntegerMinLow] >>> ***/ @@ -331,7 +330,6 @@ per_type_encoder_f CN_IntegerMinLow_encode_uper; int CN_IntegerMinLow_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { - const INTEGER_t *st = (const INTEGER_t *)sptr; long value; if(!sptr) { @@ -341,12 +339,7 @@ CN_IntegerMinLow_constraint(asn_TYPE_descriptor_t *td, const void *sptr, return -1; } - if(asn_INTEGER2long(st, &value)) { - _ASN_CTFAIL(app_key, td, sptr, - "%s: value too large (%s:%d)", - td->name, __FILE__, __LINE__); - return -1; - } + value = *(const long *)sptr; if((value <= 1)) { /* Constraint check succeeded */ @@ -360,24 +353,24 @@ CN_IntegerMinLow_constraint(asn_TYPE_descriptor_t *td, const void *sptr, } /* - * This type is implemented using INTEGER, + * This type is implemented using NativeInteger, * so here we adjust the DEF accordingly. */ static void CN_IntegerMinLow_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { - td->free_struct = asn_DEF_INTEGER.free_struct; - td->print_struct = asn_DEF_INTEGER.print_struct; - td->ber_decoder = asn_DEF_INTEGER.ber_decoder; - td->der_encoder = asn_DEF_INTEGER.der_encoder; - td->xer_decoder = asn_DEF_INTEGER.xer_decoder; - td->xer_encoder = asn_DEF_INTEGER.xer_encoder; - td->uper_decoder = asn_DEF_INTEGER.uper_decoder; - td->uper_encoder = asn_DEF_INTEGER.uper_encoder; + td->free_struct = asn_DEF_NativeInteger.free_struct; + td->print_struct = asn_DEF_NativeInteger.print_struct; + td->ber_decoder = asn_DEF_NativeInteger.ber_decoder; + td->der_encoder = asn_DEF_NativeInteger.der_encoder; + td->xer_decoder = asn_DEF_NativeInteger.xer_decoder; + td->xer_encoder = asn_DEF_NativeInteger.xer_encoder; + td->uper_decoder = asn_DEF_NativeInteger.uper_decoder; + td->uper_encoder = asn_DEF_NativeInteger.uper_encoder; if(!td->per_constraints) - td->per_constraints = asn_DEF_INTEGER.per_constraints; - td->elements = asn_DEF_INTEGER.elements; - td->elements_count = asn_DEF_INTEGER.elements_count; - td->specifics = asn_DEF_INTEGER.specifics; + td->per_constraints = asn_DEF_NativeInteger.per_constraints; + td->elements = asn_DEF_NativeInteger.elements; + td->elements_count = asn_DEF_NativeInteger.elements_count; + td->specifics = asn_DEF_NativeInteger.specifics; } void @@ -825,11 +818,11 @@ asn_TYPE_descriptor_t asn_DEF_NO_IntegerLowHigh = { /*** <<< INCLUDES [CN-IntegerLowMax] >>> ***/ -#include <INTEGER.h> +#include <NativeInteger.h> /*** <<< TYPE-DECLS [CN-IntegerLowMax] >>> ***/ -typedef INTEGER_t CN_IntegerLowMax_t; +typedef long CN_IntegerLowMax_t; /*** <<< FUNC-DECLS [CN-IntegerLowMax] >>> ***/ @@ -849,7 +842,6 @@ per_type_encoder_f CN_IntegerLowMax_encode_uper; int CN_IntegerLowMax_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { - const INTEGER_t *st = (const INTEGER_t *)sptr; long value; if(!sptr) { @@ -859,12 +851,7 @@ CN_IntegerLowMax_constraint(asn_TYPE_descriptor_t *td, const void *sptr, return -1; } - if(asn_INTEGER2long(st, &value)) { - _ASN_CTFAIL(app_key, td, sptr, - "%s: value too large (%s:%d)", - td->name, __FILE__, __LINE__); - return -1; - } + value = *(const long *)sptr; if((value >= 1)) { /* Constraint check succeeded */ @@ -878,24 +865,24 @@ CN_IntegerLowMax_constraint(asn_TYPE_descriptor_t *td, const void *sptr, } /* - * This type is implemented using INTEGER, + * This type is implemented using NativeInteger, * so here we adjust the DEF accordingly. */ static void CN_IntegerLowMax_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { - td->free_struct = asn_DEF_INTEGER.free_struct; - td->print_struct = asn_DEF_INTEGER.print_struct; - td->ber_decoder = asn_DEF_INTEGER.ber_decoder; - td->der_encoder = asn_DEF_INTEGER.der_encoder; - td->xer_decoder = asn_DEF_INTEGER.xer_decoder; - td->xer_encoder = asn_DEF_INTEGER.xer_encoder; - td->uper_decoder = asn_DEF_INTEGER.uper_decoder; - td->uper_encoder = asn_DEF_INTEGER.uper_encoder; + td->free_struct = asn_DEF_NativeInteger.free_struct; + td->print_struct = asn_DEF_NativeInteger.print_struct; + td->ber_decoder = asn_DEF_NativeInteger.ber_decoder; + td->der_encoder = asn_DEF_NativeInteger.der_encoder; + td->xer_decoder = asn_DEF_NativeInteger.xer_decoder; + td->xer_encoder = asn_DEF_NativeInteger.xer_encoder; + td->uper_decoder = asn_DEF_NativeInteger.uper_decoder; + td->uper_encoder = asn_DEF_NativeInteger.uper_encoder; if(!td->per_constraints) - td->per_constraints = asn_DEF_INTEGER.per_constraints; - td->elements = asn_DEF_INTEGER.elements; - td->elements_count = asn_DEF_INTEGER.elements_count; - td->specifics = asn_DEF_INTEGER.specifics; + td->per_constraints = asn_DEF_NativeInteger.per_constraints; + td->elements = asn_DEF_NativeInteger.elements; + td->elements_count = asn_DEF_NativeInteger.elements_count; + td->specifics = asn_DEF_NativeInteger.specifics; } void @@ -2356,11 +2343,11 @@ asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange4 = { /*** <<< INCLUDES [OK-IntegerInRange5] >>> ***/ -#include <INTEGER.h> +#include <NativeInteger.h> /*** <<< TYPE-DECLS [OK-IntegerInRange5] >>> ***/ -typedef INTEGER_t OK_IntegerInRange5_t; +typedef long OK_IntegerInRange5_t; /*** <<< FUNC-DECLS [OK-IntegerInRange5] >>> ***/ @@ -2380,7 +2367,6 @@ per_type_encoder_f OK_IntegerInRange5_encode_uper; int OK_IntegerInRange5_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { - const INTEGER_t *st = (const INTEGER_t *)sptr; long value; if(!sptr) { @@ -2390,12 +2376,7 @@ OK_IntegerInRange5_constraint(asn_TYPE_descriptor_t *td, const void *sptr, return -1; } - if(asn_INTEGER2long(st, &value)) { - _ASN_CTFAIL(app_key, td, sptr, - "%s: value too large (%s:%d)", - td->name, __FILE__, __LINE__); - return -1; - } + value = *(const long *)sptr; if(((value == (-2147483647L - 1)) || (value == 2147483647))) { /* Constraint check succeeded */ @@ -2409,24 +2390,24 @@ OK_IntegerInRange5_constraint(asn_TYPE_descriptor_t *td, const void *sptr, } /* - * This type is implemented using INTEGER, + * This type is implemented using NativeInteger, * so here we adjust the DEF accordingly. */ static void OK_IntegerInRange5_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { - td->free_struct = asn_DEF_INTEGER.free_struct; - td->print_struct = asn_DEF_INTEGER.print_struct; - td->ber_decoder = asn_DEF_INTEGER.ber_decoder; - td->der_encoder = asn_DEF_INTEGER.der_encoder; - td->xer_decoder = asn_DEF_INTEGER.xer_decoder; - td->xer_encoder = asn_DEF_INTEGER.xer_encoder; - td->uper_decoder = asn_DEF_INTEGER.uper_decoder; - td->uper_encoder = asn_DEF_INTEGER.uper_encoder; + td->free_struct = asn_DEF_NativeInteger.free_struct; + td->print_struct = asn_DEF_NativeInteger.print_struct; + td->ber_decoder = asn_DEF_NativeInteger.ber_decoder; + td->der_encoder = asn_DEF_NativeInteger.der_encoder; + td->xer_decoder = asn_DEF_NativeInteger.xer_decoder; + td->xer_encoder = asn_DEF_NativeInteger.xer_encoder; + td->uper_decoder = asn_DEF_NativeInteger.uper_decoder; + td->uper_encoder = asn_DEF_NativeInteger.uper_encoder; if(!td->per_constraints) - td->per_constraints = asn_DEF_INTEGER.per_constraints; - td->elements = asn_DEF_INTEGER.elements; - td->elements_count = asn_DEF_INTEGER.elements_count; - td->specifics = asn_DEF_INTEGER.specifics; + td->per_constraints = asn_DEF_NativeInteger.per_constraints; + td->elements = asn_DEF_NativeInteger.elements; + td->elements_count = asn_DEF_NativeInteger.elements_count; + td->specifics = asn_DEF_NativeInteger.specifics; } void @@ -2553,7 +2534,6 @@ per_type_encoder_f NO_IntegerInRange6_encode_uper; int NO_IntegerInRange6_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { - unsigned long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, @@ -2562,7 +2542,6 @@ NO_IntegerInRange6_constraint(asn_TYPE_descriptor_t *td, const void *sptr, return -1; } - value = *(const unsigned long *)sptr; /* Constraint check succeeded */ return 0; @@ -2694,7 +2673,7 @@ asn_TYPE_descriptor_t asn_DEF_NO_IntegerInRange6 = { /*** <<< INCLUDES [CN-IntegerEnumerated1] >>> ***/ -#include <INTEGER.h> +#include <NativeInteger.h> /*** <<< DEPS [CN-IntegerEnumerated1] >>> ***/ @@ -2705,7 +2684,7 @@ typedef enum CN_IntegerEnumerated1 { /*** <<< TYPE-DECLS [CN-IntegerEnumerated1] >>> ***/ -typedef INTEGER_t CN_IntegerEnumerated1_t; +typedef long CN_IntegerEnumerated1_t; /*** <<< FUNC-DECLS [CN-IntegerEnumerated1] >>> ***/ @@ -2726,29 +2705,29 @@ int CN_IntegerEnumerated1_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { /* Replace with underlying type checker */ - td->check_constraints = asn_DEF_INTEGER.check_constraints; + td->check_constraints = asn_DEF_NativeInteger.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* - * This type is implemented using INTEGER, + * This type is implemented using NativeInteger, * so here we adjust the DEF accordingly. */ static void CN_IntegerEnumerated1_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { - td->free_struct = asn_DEF_INTEGER.free_struct; - td->print_struct = asn_DEF_INTEGER.print_struct; - td->ber_decoder = asn_DEF_INTEGER.ber_decoder; - td->der_encoder = asn_DEF_INTEGER.der_encoder; - td->xer_decoder = asn_DEF_INTEGER.xer_decoder; - td->xer_encoder = asn_DEF_INTEGER.xer_encoder; - td->uper_decoder = asn_DEF_INTEGER.uper_decoder; - td->uper_encoder = asn_DEF_INTEGER.uper_encoder; + td->free_struct = asn_DEF_NativeInteger.free_struct; + td->print_struct = asn_DEF_NativeInteger.print_struct; + td->ber_decoder = asn_DEF_NativeInteger.ber_decoder; + td->der_encoder = asn_DEF_NativeInteger.der_encoder; + td->xer_decoder = asn_DEF_NativeInteger.xer_decoder; + td->xer_encoder = asn_DEF_NativeInteger.xer_encoder; + td->uper_decoder = asn_DEF_NativeInteger.uper_decoder; + td->uper_encoder = asn_DEF_NativeInteger.uper_encoder; if(!td->per_constraints) - td->per_constraints = asn_DEF_INTEGER.per_constraints; - td->elements = asn_DEF_INTEGER.elements; - td->elements_count = asn_DEF_INTEGER.elements_count; - td->specifics = asn_DEF_INTEGER.specifics; + td->per_constraints = asn_DEF_NativeInteger.per_constraints; + td->elements = asn_DEF_NativeInteger.elements; + td->elements_count = asn_DEF_NativeInteger.elements_count; + td->specifics = asn_DEF_NativeInteger.specifics; } void diff --git a/tests/91-cond-int-blessSize-OK.asn1.-Pfbless-SIZE b/tests/91-cond-int-blessSize-OK.asn1.-Pfbless-SIZE index 27b3dc2a..a917aca3 100644 --- a/tests/91-cond-int-blessSize-OK.asn1.-Pfbless-SIZE +++ b/tests/91-cond-int-blessSize-OK.asn1.-Pfbless-SIZE @@ -549,11 +549,11 @@ asn_TYPE_descriptor_t asn_DEF_OK_Integer4 = { /*** <<< INCLUDES [NO-Integer5] >>> ***/ -#include <INTEGER.h> +#include <NativeInteger.h> /*** <<< TYPE-DECLS [NO-Integer5] >>> ***/ -typedef INTEGER_t NO_Integer5_t; +typedef long NO_Integer5_t; /*** <<< FUNC-DECLS [NO-Integer5] >>> ***/ @@ -571,7 +571,6 @@ xer_type_encoder_f NO_Integer5_encode_xer; int NO_Integer5_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { - const INTEGER_t *st = (const INTEGER_t *)sptr; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, @@ -586,29 +585,29 @@ NO_Integer5_constraint(asn_TYPE_descriptor_t *td, const void *sptr, } /* Replace with underlying type checker */ - td->check_constraints = asn_DEF_INTEGER.check_constraints; + td->check_constraints = asn_DEF_NativeInteger.check_constraints; return td->check_constraints(td, sptr, ctfailcb, app_key); } /* - * This type is implemented using INTEGER, + * This type is implemented using NativeInteger, * so here we adjust the DEF accordingly. */ static void NO_Integer5_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { - td->free_struct = asn_DEF_INTEGER.free_struct; - td->print_struct = asn_DEF_INTEGER.print_struct; - td->ber_decoder = asn_DEF_INTEGER.ber_decoder; - td->der_encoder = asn_DEF_INTEGER.der_encoder; - td->xer_decoder = asn_DEF_INTEGER.xer_decoder; - td->xer_encoder = asn_DEF_INTEGER.xer_encoder; - td->uper_decoder = asn_DEF_INTEGER.uper_decoder; - td->uper_encoder = asn_DEF_INTEGER.uper_encoder; + td->free_struct = asn_DEF_NativeInteger.free_struct; + td->print_struct = asn_DEF_NativeInteger.print_struct; + td->ber_decoder = asn_DEF_NativeInteger.ber_decoder; + td->der_encoder = asn_DEF_NativeInteger.der_encoder; + td->xer_decoder = asn_DEF_NativeInteger.xer_decoder; + td->xer_encoder = asn_DEF_NativeInteger.xer_encoder; + td->uper_decoder = asn_DEF_NativeInteger.uper_decoder; + td->uper_encoder = asn_DEF_NativeInteger.uper_encoder; if(!td->per_constraints) - td->per_constraints = asn_DEF_INTEGER.per_constraints; - td->elements = asn_DEF_INTEGER.elements; - td->elements_count = asn_DEF_INTEGER.elements_count; - td->specifics = asn_DEF_INTEGER.specifics; + td->per_constraints = asn_DEF_NativeInteger.per_constraints; + td->elements = asn_DEF_NativeInteger.elements; + td->elements_count = asn_DEF_NativeInteger.elements_count; + td->specifics = asn_DEF_NativeInteger.specifics; } void diff --git a/tests/92-circular-loops-OK.asn1.-Pfindirect-choice b/tests/92-circular-loops-OK.asn1.-Pfindirect-choice index 939056ec..94dfbb9c 100644 --- a/tests/92-circular-loops-OK.asn1.-Pfindirect-choice +++ b/tests/92-circular-loops-OK.asn1.-Pfindirect-choice @@ -614,7 +614,7 @@ asn_TYPE_descriptor_t asn_DEF_Choice3 = { /*** <<< INCLUDES [Set] >>> ***/ #include <asn_SET_OF.h> -#include <INTEGER.h> +#include <NativeInteger.h> #include <constr_SEQUENCE.h> #include <constr_SET_OF.h> @@ -627,7 +627,7 @@ struct Sequence; typedef struct Set { A_SET_OF(struct Member { - INTEGER_t Int; + long Int; struct Set *set; struct Sequence *seq; struct Set *set2 /* OPTIONAL */; @@ -660,7 +660,7 @@ static asn_TYPE_member_t asn_MBR_Member_2[] = { { ATF_NOFLAGS, 0, offsetof(struct Member, Int), .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ - .type = &asn_DEF_INTEGER, + .type = &asn_DEF_NativeInteger, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, @@ -793,7 +793,7 @@ asn_TYPE_descriptor_t asn_DEF_Set = { /*** <<< INCLUDES [Sequence] >>> ***/ -#include <INTEGER.h> +#include <NativeInteger.h> #include <constr_SEQUENCE.h> /*** <<< FWD-DECLS [Sequence] >>> ***/ @@ -804,13 +804,13 @@ struct Set; /*** <<< TYPE-DECLS [Sequence] >>> ***/ typedef struct Sequence { - INTEGER_t a; + long a; struct Sequence *seq /* OPTIONAL */; /* * This type is extensible, * possible extensions are below. */ - INTEGER_t *b; + long *b; struct Set *set /* OPTIONAL */; /* Context for parsing across buffer boundaries */ @@ -832,7 +832,7 @@ static asn_TYPE_member_t asn_MBR_Sequence_1[] = { { ATF_NOFLAGS, 0, offsetof(struct Sequence, a), .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ - .type = &asn_DEF_INTEGER, + .type = &asn_DEF_NativeInteger, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, @@ -850,7 +850,7 @@ static asn_TYPE_member_t asn_MBR_Sequence_1[] = { { ATF_POINTER, 2, offsetof(struct Sequence, b), .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)), .tag_mode = -1, /* IMPLICIT tag at current level */ - .type = &asn_DEF_INTEGER, + .type = &asn_DEF_NativeInteger, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* PER is not compiled, use -gen-PER */ .default_value = 0, diff --git a/tests/92-circular-loops-OK.asn1.-P b/tests/92-circular-loops-OK.asn1.-Pfwide-types index e479edc8..e479edc8 100644 --- a/tests/92-circular-loops-OK.asn1.-P +++ b/tests/92-circular-loops-OK.asn1.-Pfwide-types diff --git a/tests/93-asn1c-controls-OK.asn1.-P b/tests/93-asn1c-controls-OK.asn1.-Pfwide-types index 429b41b4..429b41b4 100644 --- a/tests/93-asn1c-controls-OK.asn1.-P +++ b/tests/93-asn1c-controls-OK.asn1.-Pfwide-types diff --git a/tests/95-choice-per-order-OK.asn1.-P b/tests/95-choice-per-order-OK.asn1.-Pfwide-types index ba97bb8e..e6cb70e1 100644 --- a/tests/95-choice-per-order-OK.asn1.-P +++ b/tests/95-choice-per-order-OK.asn1.-Pfwide-types @@ -45,7 +45,7 @@ typedef struct Choice { * This type is extensible, * possible extensions are below. */ - BOOLEAN_t bool; + BOOLEAN_t Bool; } choice; /* Context for parsing across buffer boundaries */ @@ -143,7 +143,7 @@ static asn_TYPE_member_t asn_MBR_Choice_1[] = { .default_value = 0, .name = "ch" }, - { ATF_NOFLAGS, 0, offsetof(struct Choice, choice.bool), + { ATF_NOFLAGS, 0, offsetof(struct Choice, choice.Bool), .tag = (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), .tag_mode = 0, .type = &asn_DEF_BOOLEAN, diff --git a/tests/95-choice-per-order-OK.asn1.-Pgen-PER b/tests/95-choice-per-order-OK.asn1.-Pgen-PER index 515e65b9..f90a8132 100644 --- a/tests/95-choice-per-order-OK.asn1.-Pgen-PER +++ b/tests/95-choice-per-order-OK.asn1.-Pgen-PER @@ -5,7 +5,7 @@ #include <BIT_STRING.h> #include <BOOLEAN.h> #include <NULL.h> -#include <INTEGER.h> +#include <NativeInteger.h> #include <constr_CHOICE.h> /*** <<< DEPS [Choice] >>> ***/ @@ -35,7 +35,7 @@ typedef struct Choice { ch_PR present; union Choice__ch_u { NULL_t null; - INTEGER_t Int; + long Int; } choice; /* Context for parsing across buffer boundaries */ @@ -45,7 +45,7 @@ typedef struct Choice { * This type is extensible, * possible extensions are below. */ - BOOLEAN_t bool; + BOOLEAN_t Bool; } choice; /* Context for parsing across buffer boundaries */ @@ -84,7 +84,7 @@ static asn_TYPE_member_t asn_MBR_ch_4[] = { { ATF_NOFLAGS, 0, offsetof(struct ch, choice.Int), .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), .tag_mode = 0, - .type = &asn_DEF_INTEGER, + .type = &asn_DEF_NativeInteger, .memb_constraints = 0, /* Defer constraints checking to the member type */ .per_constraints = 0, /* No PER visible constraints */ .default_value = 0, @@ -158,7 +158,7 @@ static asn_TYPE_member_t asn_MBR_Choice_1[] = { .default_value = 0, .name = "ch" }, - { ATF_NOFLAGS, 0, offsetof(struct Choice, choice.bool), + { ATF_NOFLAGS, 0, offsetof(struct Choice, choice.Bool), .tag = (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), .tag_mode = 0, .type = &asn_DEF_BOOLEAN, |