Commit 18c2ec9f authored by Wim Lewis's avatar Wim Lewis

Declare the tags[] tables in skeletons as const.

Constify the PER support structure.
Constify a few other private tables in the skeleton code.
parent fb6344ef
......@@ -9,7 +9,7 @@
/*
* BIT STRING basic type description.
*/
static ber_tlv_tag_t asn_DEF_BIT_STRING_tags[] = {
static const ber_tlv_tag_t asn_DEF_BIT_STRING_tags[] = {
(ASN_TAG_CLASS_UNIVERSAL | (3 << 2))
};
static asn_OCTET_STRING_specifics_t asn_DEF_BIT_STRING_specs = {
......
......@@ -9,7 +9,7 @@
/*
* BMPString basic type description.
*/
static ber_tlv_tag_t asn_DEF_BMPString_tags[] = {
static const ber_tlv_tag_t asn_DEF_BMPString_tags[] = {
(ASN_TAG_CLASS_UNIVERSAL | (30 << 2)), /* [UNIVERSAL 30] IMPLICIT ...*/
(ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) /* ... OCTET STRING */
};
......
......@@ -9,7 +9,7 @@
/*
* BOOLEAN basic type description.
*/
static ber_tlv_tag_t asn_DEF_BOOLEAN_tags[] = {
static const ber_tlv_tag_t asn_DEF_BOOLEAN_tags[] = {
(ASN_TAG_CLASS_UNIVERSAL | (1 << 2))
};
asn_TYPE_descriptor_t asn_DEF_BOOLEAN = {
......
......@@ -11,7 +11,7 @@
/*
* ENUMERATED basic type description.
*/
static ber_tlv_tag_t asn_DEF_ENUMERATED_tags[] = {
static const ber_tlv_tag_t asn_DEF_ENUMERATED_tags[] = {
(ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
};
asn_TYPE_descriptor_t asn_DEF_ENUMERATED = {
......
......@@ -8,7 +8,7 @@
/*
* GeneralString basic type description.
*/
static ber_tlv_tag_t asn_DEF_GeneralString_tags[] = {
static const ber_tlv_tag_t asn_DEF_GeneralString_tags[] = {
(ASN_TAG_CLASS_UNIVERSAL | (27 << 2)), /* [UNIVERSAL 27] IMPLICIT ...*/
(ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) /* ... OCTET STRING */
};
......
......@@ -145,7 +145,7 @@ static time_t timegm(struct tm *tm) {
/*
* GeneralizedTime basic type description.
*/
static ber_tlv_tag_t asn_DEF_GeneralizedTime_tags[] = {
static const ber_tlv_tag_t asn_DEF_GeneralizedTime_tags[] = {
(ASN_TAG_CLASS_UNIVERSAL | (24 << 2)), /* [UNIVERSAL 24] IMPLICIT ...*/
(ASN_TAG_CLASS_UNIVERSAL | (26 << 2)), /* [UNIVERSAL 26] IMPLICIT ...*/
(ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) /* ... OCTET STRING */
......
......@@ -8,7 +8,7 @@
/*
* GraphicString basic type description.
*/
static ber_tlv_tag_t asn_DEF_GraphicString_tags[] = {
static const ber_tlv_tag_t asn_DEF_GraphicString_tags[] = {
(ASN_TAG_CLASS_UNIVERSAL | (25 << 2)), /* [UNIVERSAL 25] IMPLICIT ...*/
(ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) /* ... OCTET STRING */
};
......
......@@ -8,7 +8,7 @@
/*
* IA5String basic type description.
*/
static ber_tlv_tag_t asn_DEF_IA5String_tags[] = {
static const ber_tlv_tag_t asn_DEF_IA5String_tags[] = {
(ASN_TAG_CLASS_UNIVERSAL | (22 << 2)), /* [UNIVERSAL 22] IMPLICIT ...*/
(ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) /* ... OCTET STRING */
};
......
......@@ -11,7 +11,7 @@
/*
* INTEGER basic type description.
*/
static ber_tlv_tag_t asn_DEF_INTEGER_tags[] = {
static const ber_tlv_tag_t asn_DEF_INTEGER_tags[] = {
(ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
};
asn_TYPE_descriptor_t asn_DEF_INTEGER = {
......
......@@ -8,7 +8,7 @@
/*
* ISO646String basic type description.
*/
static ber_tlv_tag_t asn_DEF_ISO646String_tags[] = {
static const ber_tlv_tag_t asn_DEF_ISO646String_tags[] = {
(ASN_TAG_CLASS_UNIVERSAL | (26 << 2)), /* [UNIVERSAL 26] IMPLICIT ...*/
(ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) /* ... OCTET STRING */
};
......
......@@ -10,7 +10,7 @@
/*
* NULL basic type description.
*/
static ber_tlv_tag_t asn_DEF_NULL_tags[] = {
static const ber_tlv_tag_t asn_DEF_NULL_tags[] = {
(ASN_TAG_CLASS_UNIVERSAL | (5 << 2))
};
asn_TYPE_descriptor_t asn_DEF_NULL = {
......
......@@ -15,7 +15,7 @@
/*
* NativeEnumerated basic type description.
*/
static ber_tlv_tag_t asn_DEF_NativeEnumerated_tags[] = {
static const ber_tlv_tag_t asn_DEF_NativeEnumerated_tags[] = {
(ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
};
asn_TYPE_descriptor_t asn_DEF_NativeEnumerated = {
......
......@@ -16,7 +16,7 @@
/*
* NativeInteger basic type description.
*/
static ber_tlv_tag_t asn_DEF_NativeInteger_tags[] = {
static const ber_tlv_tag_t asn_DEF_NativeInteger_tags[] = {
(ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
};
asn_TYPE_descriptor_t asn_DEF_NativeInteger = {
......
......@@ -17,7 +17,7 @@
/*
* NativeReal basic type description.
*/
static ber_tlv_tag_t asn_DEF_NativeReal_tags[] = {
static const ber_tlv_tag_t asn_DEF_NativeReal_tags[] = {
(ASN_TAG_CLASS_UNIVERSAL | (9 << 2))
};
asn_TYPE_descriptor_t asn_DEF_NativeReal = {
......
......@@ -8,7 +8,7 @@
/*
* NumericString basic type description.
*/
static ber_tlv_tag_t asn_DEF_NumericString_tags[] = {
static const ber_tlv_tag_t asn_DEF_NumericString_tags[] = {
(ASN_TAG_CLASS_UNIVERSAL | (18 << 2)), /* [UNIVERSAL 18] IMPLICIT ...*/
(ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) /* ... OCTET STRING */
};
......
......@@ -12,7 +12,7 @@
/*
* OBJECT IDENTIFIER basic type description.
*/
static ber_tlv_tag_t asn_DEF_OBJECT_IDENTIFIER_tags[] = {
static const ber_tlv_tag_t asn_DEF_OBJECT_IDENTIFIER_tags[] = {
(ASN_TAG_CLASS_UNIVERSAL | (6 << 2))
};
asn_TYPE_descriptor_t asn_DEF_OBJECT_IDENTIFIER = {
......
......@@ -11,15 +11,15 @@
/*
* OCTET STRING basic type description.
*/
static ber_tlv_tag_t asn_DEF_OCTET_STRING_tags[] = {
static const ber_tlv_tag_t asn_DEF_OCTET_STRING_tags[] = {
(ASN_TAG_CLASS_UNIVERSAL | (4 << 2))
};
static asn_OCTET_STRING_specifics_t asn_DEF_OCTET_STRING_specs = {
static const asn_OCTET_STRING_specifics_t asn_DEF_OCTET_STRING_specs = {
sizeof(OCTET_STRING_t),
offsetof(OCTET_STRING_t, _asn_ctx),
ASN_OSUBV_STR
};
static asn_per_constraints_t asn_DEF_OCTET_STRING_constraints = {
static const asn_per_constraints_t asn_DEF_OCTET_STRING_constraints = {
{ APC_CONSTRAINED, 8, 8, 0, 255 },
{ APC_SEMI_CONSTRAINED, -1, -1, 0, 0 },
0, 0
......@@ -639,8 +639,8 @@ cb_failed:
_ASN_ENCODE_FAILED;
}
static struct OCTET_STRING__xer_escape_table_s {
char *string;
static const struct OCTET_STRING__xer_escape_table_s {
const char *string;
int size;
} OCTET_STRING__xer_escape_table[] = {
#define OSXET(s) { s, sizeof(s) - 1 }
......@@ -702,7 +702,7 @@ OS__check_escaped_control_char(const void *buf, int size) {
* nested table lookups).
*/
for(i = 0; i < 32 /* Don't spend time on the bottom half */; i++) {
struct OCTET_STRING__xer_escape_table_s *el;
const struct OCTET_STRING__xer_escape_table_s *el;
el = &OCTET_STRING__xer_escape_table[i];
if(el->size == size && memcmp(buf, el->string, size) == 0)
return i;
......
......@@ -8,7 +8,7 @@
/*
* ObjectDescriptor basic type description.
*/
static ber_tlv_tag_t asn_DEF_ObjectDescriptor_tags[] = {
static const ber_tlv_tag_t asn_DEF_ObjectDescriptor_tags[] = {
(ASN_TAG_CLASS_UNIVERSAL | (7 << 2)), /* [UNIVERSAL 7] IMPLICIT ... */
(ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) /* ... OCTET STRING */
};
......
......@@ -9,7 +9,7 @@
/*
* ASN.1:1984 (X.409)
*/
static int _PrintableString_alphabet[256] = {
static const int _PrintableString_alphabet[256] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */
1, 0, 0, 0, 0, 0, 0, 2, 3, 4, 0, 5, 6, 7, 8, 9, /* . '() +,-./ */
......@@ -19,7 +19,7 @@ static int _PrintableString_alphabet[256] = {
0,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63, /* abcdefghijklmno */
64,65,66,67,68,69,70,71,72,73,74, 0, 0, 0, 0, 0, /* pqrstuvwxyz */
};
static int _PrintableString_code2value[74] = {
static const int _PrintableString_code2value[74] = {
32,39,40,41,43,44,45,46,47,48,49,50,51,52,53,54,
55,56,57,58,61,63,65,66,67,68,69,70,71,72,73,74,
75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,
......@@ -29,7 +29,7 @@ static int _PrintableString_code2value[74] = {
/*
* PrintableString basic type description.
*/
static ber_tlv_tag_t asn_DEF_PrintableString_tags[] = {
static const ber_tlv_tag_t asn_DEF_PrintableString_tags[] = {
(ASN_TAG_CLASS_UNIVERSAL | (19 << 2)), /* [UNIVERSAL 19] IMPLICIT ...*/
(ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) /* ... OCTET STRING */
};
......@@ -41,7 +41,7 @@ static int asn_DEF_PrintableString_c2v(unsigned int code) {
return _PrintableString_code2value[code];
return -1;
}
static asn_per_constraints_t asn_DEF_PrintableString_constraints = {
static const asn_per_constraints_t asn_DEF_PrintableString_constraints = {
{ APC_CONSTRAINED, 4, 4, 0x20, 0x39 }, /* Value */
{ APC_SEMI_CONSTRAINED, -1, -1, 0, 0 }, /* Size */
asn_DEF_PrintableString_v2c,
......
......@@ -36,7 +36,7 @@ static volatile double real_zero GCC_NOTUSED = 0.0;
/*
* REAL basic type description.
*/
static ber_tlv_tag_t asn_DEF_REAL_tags[] = {
static const ber_tlv_tag_t asn_DEF_REAL_tags[] = {
(ASN_TAG_CLASS_UNIVERSAL | (9 << 2))
};
asn_TYPE_descriptor_t asn_DEF_REAL = {
......
......@@ -13,7 +13,7 @@
/*
* RELATIVE-OID basic type description.
*/
static ber_tlv_tag_t asn_DEF_RELATIVE_OID_tags[] = {
static const ber_tlv_tag_t asn_DEF_RELATIVE_OID_tags[] = {
(ASN_TAG_CLASS_UNIVERSAL | (13 << 2))
};
asn_TYPE_descriptor_t asn_DEF_RELATIVE_OID = {
......
......@@ -8,7 +8,7 @@
/*
* T61String basic type description.
*/
static ber_tlv_tag_t asn_DEF_T61String_tags[] = {
static const ber_tlv_tag_t asn_DEF_T61String_tags[] = {
(ASN_TAG_CLASS_UNIVERSAL | (20 << 2)), /* [UNIVERSAL 20] IMPLICIT ...*/
(ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) /* ... OCTET STRING */
};
......
......@@ -8,7 +8,7 @@
/*
* TeletexString basic type description.
*/
static ber_tlv_tag_t asn_DEF_TeletexString_tags[] = {
static const ber_tlv_tag_t asn_DEF_TeletexString_tags[] = {
(ASN_TAG_CLASS_UNIVERSAL | (20 << 2)), /* [UNIVERSAL 20] IMPLICIT ...*/
(ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), /* ... OCTET STRING */
};
......
......@@ -18,7 +18,7 @@
/*
* UTCTime basic type description.
*/
static ber_tlv_tag_t asn_DEF_UTCTime_tags[] = {
static const ber_tlv_tag_t asn_DEF_UTCTime_tags[] = {
(ASN_TAG_CLASS_UNIVERSAL | (23 << 2)), /* [UNIVERSAL 23] IMPLICIT ...*/
(ASN_TAG_CLASS_UNIVERSAL | (26 << 2)), /* [UNIVERSAL 26] IMPLICIT ...*/
(ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) /* ... OCTET STRING */
......
......@@ -9,7 +9,7 @@
/*
* UTF8String basic type description.
*/
static ber_tlv_tag_t asn_DEF_UTF8String_tags[] = {
static const ber_tlv_tag_t asn_DEF_UTF8String_tags[] = {
(ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), /* [UNIVERSAL 12] IMPLICIT ...*/
(ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), /* ... OCTET STRING */
};
......@@ -41,7 +41,7 @@ asn_TYPE_descriptor_t asn_DEF_UTF8String = {
* This is the table of length expectations.
* The second half of this table is only applicable to the long sequences.
*/
static int UTF8String_ht[2][16] = {
static const int UTF8String_ht[2][16] = {
{ /* 0x0 ... 0x7 */
/* 0000..0111 */
1, 1, 1, 1, 1, 1, 1, 1,
......@@ -52,7 +52,7 @@ static int UTF8String_ht[2][16] = {
4, 4, 4, 4, 4, 4, 4, 4,
5, 5, 5, 5, 6, 6, -1, -1 }
};
static int32_t UTF8String_mv[7] = { 0, 0,
static const int32_t UTF8String_mv[7] = { 0, 0,
0x00000080,
0x00000800,
0x00010000,
......
......@@ -9,7 +9,7 @@
/*
* UniversalString basic type description.
*/
static ber_tlv_tag_t asn_DEF_UniversalString_tags[] = {
static const ber_tlv_tag_t asn_DEF_UniversalString_tags[] = {
(ASN_TAG_CLASS_UNIVERSAL | (28 << 2)), /* [UNIVERSAL 28] IMPLICIT ...*/
(ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) /* ... OCTET STRING */
};
......
......@@ -8,7 +8,7 @@
/*
* VideotexString basic type description.
*/
static ber_tlv_tag_t asn_DEF_VideotexString_tags[] = {
static const ber_tlv_tag_t asn_DEF_VideotexString_tags[] = {
(ASN_TAG_CLASS_UNIVERSAL | (21 << 2)), /* [UNIVERSAL 21] IMPLICIT */
(ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) /* ... OCTET STRING */
};
......
......@@ -8,7 +8,7 @@
/*
* VisibleString basic type description.
*/
static ber_tlv_tag_t asn_DEF_VisibleString_tags[] = {
static const ber_tlv_tag_t asn_DEF_VisibleString_tags[] = {
(ASN_TAG_CLASS_UNIVERSAL | (26 << 2)), /* [UNIVERSAL 26] IMPLICIT ...*/
(ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) /* ... OCTET STRING */
};
......
......@@ -15,7 +15,7 @@ extern "C" {
/*
* Pre-computed PER constraints.
*/
typedef struct asn_per_constraint_s {
typedef const struct asn_per_constraint_s {
enum asn_per_constraint_flags {
APC_UNCONSTRAINED = 0x0, /* No PER visible constraints */
APC_SEMI_CONSTRAINED = 0x1, /* Constrained at "lb" */
......@@ -27,9 +27,9 @@ typedef struct asn_per_constraint_s {
long lower_bound; /* "lb" value */
long upper_bound; /* "ub" value */
} asn_per_constraint_t;
typedef struct asn_per_constraints_s {
asn_per_constraint_t value;
asn_per_constraint_t size;
typedef const struct asn_per_constraints_s {
struct asn_per_constraint_s value;
struct asn_per_constraint_s size;
int (*value2code)(unsigned int value);
int (*code2value)(unsigned int code);
} asn_per_constraints_t;
......
......@@ -25,7 +25,7 @@ check_per_encode_constrained(int lineno, int unsigned_, long value, long lbound,
INTEGER_t st;
INTEGER_t *reconstructed_st = 0;
struct asn_INTEGER_specifics_s specs;
asn_per_constraints_t cts;
struct asn_per_constraints_s cts;
asn_enc_rval_t enc_rval;
asn_dec_rval_t dec_rval;
asn_per_outp_t po;
......
......@@ -31,7 +31,7 @@ static pxml_chunk_type_e final_chunk_type[] = {
};
static int
static const int
_charclass[256] = {
0,0,0,0,0,0,0,0, 0,1,1,0,1,1,0,0,
0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment