Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Arpad Lovassy
titan.core
Commits
8cdabe89
Commit
8cdabe89
authored
Nov 23, 2016
by
Kristof Szabados
Browse files
more consistent boolean usage in the runtime parts
Signed-off-by:
Kristof Szabados
<
Kristof.Szabados@ericsson.com
>
parent
a754934a
Changes
71
Expand all
Hide whitespace changes
Inline
Side-by-side
compiler2/encdec.c
View file @
8cdabe89
...
...
@@ -242,7 +242,7 @@ void def_encdec(const char *p_classname,
" TTCN_EncDec_ErrorContext::error_internal
\n
"
" (
\"
No JSON descriptor available for type '%%s'.
\"
, p_td.name);
\n
"
" JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
\n
"
" if(JSON_decode(p_td, tok,
false
)<0)
\n
"
" if(JSON_decode(p_td, tok,
FALSE
)<0)
\n
"
" ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"
"
\"
Can not decode type '%%s', because invalid or incomplete"
" message was received
\"
, p_td.name);
\n
"
...
...
compiler2/enum.c
View file @
8cdabe89
...
...
@@ -241,7 +241,7 @@ void defEnumClass(const enum_def *edef, output_struct *output)
/* Conversion function: enum_to_str */
def
=
mputprintf
(
def
,
"static const char *enum_to_str(%s enum_par%s);
\n
"
,
enum_type
,
edef
->
xerText
?
", boolean txt =
false
"
:
""
);
edef
->
xerText
?
", boolean txt =
FALSE
"
:
""
);
src
=
mputprintf
(
src
,
"const char *%s::enum_to_str(%s enum_par%s)
\n
"
"{
\n
"
"switch (enum_par) {
\n
"
,
name
,
enum_type
,
...
...
@@ -669,7 +669,7 @@ void defEnumClass(const enum_def *edef, output_struct *output)
" int encoded_length=(int)p_buf.get_len();
\n
"
" const boolean e_xer = is_exer(p_flavor);
\n
"
" p_flavor |= (SIMPLE_TYPE | BXER_EMPTY_ELEM);
\n
"
" if (begin_xml(p_td, p_buf, p_flavor, p_indent,
false
) == -1) "
" if (begin_xml(p_td, p_buf, p_flavor, p_indent,
FALSE
) == -1) "
"--encoded_length;
\n
"
" if (!e_xer) p_buf.put_c('<');
\n
"
,
name
...
...
@@ -690,7 +690,7 @@ void defEnumClass(const enum_def *edef, output_struct *output)
" p_buf.put_s(strlen(enumval), (const unsigned char*)enumval);
\n
"
" }
\n
"
" if (!e_xer) p_buf.put_s(2, (const unsigned char*)
\"
/>
\"
);
\n
"
" end_xml(p_td, p_buf, p_flavor, p_indent,
false
);
\n
"
" end_xml(p_td, p_buf, p_flavor, p_indent,
FALSE
);
\n
"
,
edef
->
xerText
?
", e_xer"
:
""
);
src
=
mputstr
(
src
,
...
...
@@ -809,7 +809,7 @@ void defEnumClass(const enum_def *edef, output_struct *output)
" json_token_t token = JSON_TOKEN_NONE;
\n
"
" char* value = 0;
\n
"
" size_t value_len = 0;
\n
"
" boolean error =
false
;
\n
"
" boolean error =
FALSE
;
\n
"
" int dec_len = 0;
\n
"
" boolean use_default = p_td.json->default_value && 0 == p_tok.get_buffer_length();
\n
"
" if (use_default) {
\n
"
...
...
@@ -829,10 +829,10 @@ void defEnumClass(const enum_def *edef, output_struct *output)
" enum_value = str_to_enum(value + (use_default ? 0 : 1));
\n
"
" if (!use_default) value[value_len - 1] = '
\\\"
';
\n
"
" if (%s == enum_value) {
\n
"
" error =
true
;
\n
"
" error =
TRUE
;
\n
"
" }
\n
"
" } else {
\n
"
" error =
true
;
\n
"
" error =
TRUE
;
\n
"
" }
\n
"
" } else {
\n
"
" enum_value = %s;
\n
"
...
...
compiler2/record.c
View file @
8cdabe89
This diff is collapsed.
Click to expand it.
compiler2/record_of.c
View file @
8cdabe89
...
...
@@ -540,7 +540,7 @@ void defRecordOfClass1(const struct_of_def *sdef, output_struct *output)
src
=
mputprintf
(
src
,
"boolean %s::is_value() const
\n
"
"{
\n
"
"if (val_ptr == NULL) return
false
;
\n
"
"if (val_ptr == NULL) return
FALSE
;
\n
"
"for(int i = 0; i < val_ptr->n_elements; ++i) {
\n
"
"if (val_ptr->value_elements[i] == NULL || "
"!val_ptr->value_elements[i]->is_value()) return FALSE;
\n
"
...
...
@@ -1093,7 +1093,7 @@ void defRecordOfClass1(const struct_of_def *sdef, output_struct *output)
" char **new_ns;
\n
"
" size_t num_new;
\n
"
" for (int i = 0; i < val_ptr->n_elements; ++i) {
\n
"
" bool def_ns_1 =
false
;"
" bool
ean
def_ns_1 =
FALSE
;"
" new_ns = (*this)[i].collect_ns(*p_td.oftype_descr, num_new, def_ns_1);
\n
"
" merge_ns(collected_ns, num_collected, new_ns, num_new);
\n
"
" def_ns = def_ns || def_ns_1;
\n
"
/* alas, no ||= */
...
...
@@ -1149,7 +1149,7 @@ void defRecordOfClass1(const struct_of_def *sdef, output_struct *output)
" {
\n
"
" size_t num_collected = 0;
\n
"
" char **collected_ns = NULL;
\n
"
" bool def_ns =
false
;
\n
"
" bool
ean
def_ns =
FALSE
;
\n
"
" collected_ns = collect_ns(p_td, num_collected, def_ns);
\n
"
" for (size_t cur_coll = 0; cur_coll < num_collected; ++cur_coll) {
\n
"
" p_buf.put_s(strlen(collected_ns[cur_coll]), (cbyte*)collected_ns[cur_coll]);
\n
"
...
...
@@ -1272,7 +1272,7 @@ void defRecordOfClass1(const struct_of_def *sdef, output_struct *output)
" {
\n
"
" size_t num_collected = 0;
\n
"
" char **collected_ns = NULL;
\n
"
" bool def_ns =
false
;
\n
"
" bool
ean
def_ns =
FALSE
;
\n
"
" collected_ns = collect_ns(p_td, num_collected, def_ns);
\n
"
" for (size_t cur_coll = 0; cur_coll < num_collected; ++cur_coll) {
\n
"
" p_buf.put_s(strlen(collected_ns[cur_coll]), (cbyte*)collected_ns[cur_coll]);
\n
"
...
...
@@ -1574,7 +1574,7 @@ void defRecordOfClass1(const struct_of_def *sdef, output_struct *output)
" return JSON_ERROR_INVALID_TOKEN;
\n
"
" }
\n\n
"
" set_size(0);
\n
"
" for (int nof_elements = 0;
true
; ++nof_elements) {
\n
"
" for (int nof_elements = 0;
TRUE
; ++nof_elements) {
\n
"
" size_t buf_pos = p_tok.get_buf_pos();
\n
"
" int ret_val;
\n
"
" if (NULL != p_td.json && p_td.json->metainfo_unbound) {
\n
"
...
...
@@ -2561,7 +2561,7 @@ void defRecordOfClassMemAllocOptimized(const struct_of_def *sdef, output_struct
" char **new_ns;
\n
"
" size_t num_new;
\n
"
" for (int i = 0; i < n_elements; ++i) {
\n
"
" bool def_ns_1 =
false
;"
" bool
ean
def_ns_1 =
FALSE
;"
" new_ns = value_elements[i].collect_ns(*p_td.oftype_descr, num_new, def_ns_1);
\n
"
" merge_ns(collected_ns, num_collected, new_ns, num_new);
\n
"
" def_ns = def_ns || def_ns_1;
\n
"
/* alas, no ||= */
...
...
@@ -2617,7 +2617,7 @@ void defRecordOfClassMemAllocOptimized(const struct_of_def *sdef, output_struct
" {
\n
"
" size_t num_collected = 0;
\n
"
" char **collected_ns = NULL;
\n
"
" bool def_ns =
false
;
\n
"
" bool
ean
def_ns =
FALSE
;
\n
"
" collected_ns = collect_ns(p_td, num_collected, def_ns);
\n
"
" for (size_t cur_coll = 0; cur_coll < num_collected; ++cur_coll) {
\n
"
" p_buf.put_s(strlen(collected_ns[cur_coll]), (cbyte*)collected_ns[cur_coll]);
\n
"
...
...
@@ -2735,7 +2735,7 @@ void defRecordOfClassMemAllocOptimized(const struct_of_def *sdef, output_struct
" {
\n
"
" size_t num_collected = 0;
\n
"
" char **collected_ns = NULL;
\n
"
" bool def_ns =
false
;
\n
"
" bool
ean
def_ns =
FALSE
;
\n
"
" collected_ns = collect_ns(p_td, num_collected, def_ns);
\n
"
" for (size_t cur_coll = 0; cur_coll < num_collected; ++cur_coll) {
\n
"
" p_buf.put_s(strlen(collected_ns[cur_coll]), (cbyte*)collected_ns[cur_coll]);
\n
"
...
...
@@ -3026,7 +3026,7 @@ void defRecordOfClassMemAllocOptimized(const struct_of_def *sdef, output_struct
" return JSON_ERROR_INVALID_TOKEN;
\n
"
" }
\n\n
"
" set_size(0);
\n
"
" for (int nof_elements = 0;
true
; ++nof_elements) {
\n
"
" for (int nof_elements = 0;
TRUE
; ++nof_elements) {
\n
"
" size_t buf_pos = p_tok.get_buf_pos();
\n
"
" int ret_val;
\n
"
" if (NULL != p_td.json && p_td.json->metainfo_unbound) {
\n
"
...
...
@@ -3977,11 +3977,11 @@ void defRecordOfTemplate1(const struct_of_def *sdef, output_struct *output)
src
=
mputprintf
(
src
,
"boolean %s_template::is_value() const
\n
"
"{
\n
"
"if (template_selection != SPECIFIC_VALUE || is_ifpresent) return
false
;
\n
"
"if (template_selection != SPECIFIC_VALUE || is_ifpresent) return
FALSE
;
\n
"
"for (int elem_count = 0; elem_count < single_value.n_elements; "
"elem_count++)
\n
"
"if (!single_value.value_elements[elem_count]->is_value()) return
false
;
\n
"
"return
true
;
\n
"
"if (!single_value.value_elements[elem_count]->is_value()) return
FALSE
;
\n
"
"return
TRUE
;
\n
"
"}
\n\n
"
,
name
);
/* valueof operation */
...
...
compiler2/union.c
View file @
8cdabe89
...
...
@@ -1105,7 +1105,7 @@ void defUnionClass(struct_def const *sdef, output_struct *output)
" case %s_%s: {
\n
"
,
selection_prefix
,
sdef
->
elements
[
i
].
name
);
if
(
t_type
&&
(
sdef
->
raw
.
taglist
.
list
+
t_type
-
1
)
->
nElements
)
{
src
=
mputstr
(
src
,
" bool negtest_confl_tag =
false
;
\n
"
);
src
=
mputstr
(
src
,
" bool
ean
negtest_confl_tag =
FALSE
;
\n
"
);
}
src
=
mputprintf
(
src
,
" err_vals = p_err_descr->get_field_err_values(%d);
\n
"
...
...
@@ -1132,7 +1132,7 @@ void defUnionClass(struct_def const *sdef, output_struct *output)
(
unsigned
long
)
i
,
(
unsigned
long
)
i
,
(
unsigned
long
)
i
);
if
(
t_type
&&
(
sdef
->
raw
.
taglist
.
list
+
t_type
-
1
)
->
nElements
)
{
/* Avoid TAGs. */
src
=
mputprintf
(
src
,
" negtest_confl_tag =
true
;
\n
"
);
src
=
mputprintf
(
src
,
" negtest_confl_tag =
TRUE
;
\n
"
);
}
src
=
mputprintf
(
src
,
" } else {
\n
"
...
...
@@ -1142,7 +1142,7 @@ void defUnionClass(struct_def const *sdef, output_struct *output)
(
unsigned
long
)
i
,
(
unsigned
long
)
i
,
sdef
->
elements
[
i
].
typedescrname
);
if
(
t_type
&&
(
sdef
->
raw
.
taglist
.
list
+
t_type
-
1
)
->
nElements
)
{
/* Avoid TAGs. */
src
=
mputprintf
(
src
,
" negtest_confl_tag =
true
;
\n
"
);
src
=
mputprintf
(
src
,
" negtest_confl_tag =
TRUE
;
\n
"
);
}
src
=
mputprintf
(
src
,
" encoded_length = field_%s->RAW_encode_negtest(emb_descr, %s_descr_, *myleaf.body.node.nodes[%lu]);
\n
"
...
...
@@ -1286,14 +1286,14 @@ void defUnionClass(struct_def const *sdef, output_struct *output)
" }
\n
"
,
name
,
sdef
->
nElements
>
1
?
" size_t pos = p_buf.get_pos();
\n
"
:
""
);
if
(
sdef
->
nElements
>
0
)
{
src
=
mputprintf
(
src
,
" int str_len = %s().TEXT_decode(%s_descr_, p_buf, limit,
true
);
\n
"
" int str_len = %s().TEXT_decode(%s_descr_, p_buf, limit,
TRUE
);
\n
"
" if (str_len >= 0) found = TRUE;
\n
"
,
sdef
->
elements
[
0
].
name
,
sdef
->
elements
[
0
].
typedescrname
);
}
for
(
i
=
1
;
i
<
sdef
->
nElements
;
i
++
)
{
src
=
mputprintf
(
src
,
" if (!found) {
\n
"
" p_buf.set_pos(pos);
\n
"
" str_len = %s().TEXT_decode(%s_descr_, p_buf, limit,
true
);
\n
"
" str_len = %s().TEXT_decode(%s_descr_, p_buf, limit,
TRUE
);
\n
"
" if (str_len >= 0) found = TRUE;
\n
"
" }
\n
"
,
sdef
->
elements
[
i
].
name
,
sdef
->
elements
[
i
].
typedescrname
);
}
...
...
@@ -1343,11 +1343,11 @@ void defUnionClass(struct_def const *sdef, output_struct *output)
/* An untagged union can start with the start tag of any alternative */
for
(
i
=
0
;
i
<
sdef
->
nElements
;
i
++
)
{
src
=
mputprintf
(
src
,
" if (%s::can_start(name, uri, %s_xer_, flavor)) return
true
;
\n
"
" if (%s::can_start(name, uri, %s_xer_, flavor)) return
TRUE
;
\n
"
,
sdef
->
elements
[
i
].
type
,
sdef
->
elements
[
i
].
typegen
);
}
src
=
mputstr
(
src
,
" return
false
;
\n
}
\n\n
"
);
src
=
mputstr
(
src
,
" return
FALSE
;
\n
}
\n\n
"
);
src
=
mputprintf
(
src
,
"char ** %s::collect_ns(const XERdescriptor_t& p_td, size_t& num, bool& def_ns) const {
\n
"
...
...
@@ -1358,7 +1358,7 @@ void defUnionClass(struct_def const *sdef, output_struct *output)
" size_t num_new;
\n
"
" boolean need_type = FALSE;
\n
"
" try {
\n
"
" bool def_ns_1 =
false
;
\n
"
" bool
ean
def_ns_1 =
FALSE
;
\n
"
" switch (union_selection) {
\n
"
,
name
);
...
...
@@ -1514,7 +1514,7 @@ void defUnionClass(struct_def const *sdef, output_struct *output)
src
=
mputprintf
(
src
,
" unsigned int flavor_1 = p_flavor;
\n
"
" if (is_exer(p_flavor)) flavor_1 &= ~XER_RECOF;
\n
"
" bool omit_tag = begin_xml(p_td, p_buf, flavor_1, p_indent,
false
, "
" bool
ean
omit_tag = begin_xml(p_td, p_buf, flavor_1, p_indent,
FALSE
, "
"(collector_fn)&%s::collect_ns%s);
\n
"
,
sdef
->
name
,
sdef
->
xerUseTypeAttr
?
", type_atr"
:
""
);
...
...
@@ -1652,7 +1652,7 @@ void defUnionClass(struct_def const *sdef, output_struct *output)
}
/* if UseTypeAttr */
src
=
mputprintf
(
src
,
" bool omit_tag = begin_xml(p_td, p_buf, p_flavor, p_indent,
false
, "
" bool
ean
omit_tag = begin_xml(p_td, p_buf, p_flavor, p_indent,
FALSE
, "
"(collector_fn)&%s::collect_ns%s);
\n
"
,
sdef
->
name
,
sdef
->
xerUseTypeAttr
?
", type_atr"
:
""
);
...
...
@@ -1744,7 +1744,7 @@ void defUnionClass(struct_def const *sdef, output_struct *output)
" xml_depth = p_reader.Depth();
\n
"
,
name
,
sdef
->
xerUseTypeAttr
?
" char * typeatr = 0;
\n
"
:
""
,
sdef
->
xerUseUnion
?
" boolean attribute = (p_td.xer_bits & XER_ATTRIBUTE) ?
true : false
;
\n
"
:
""
,
sdef
->
xerUseUnion
?
" boolean attribute = (p_td.xer_bits & XER_ATTRIBUTE) ?
TRUE : FALSE
;
\n
"
:
""
,
sdef
->
xerUseUnion
?
"if (!attribute) "
:
""
);
if
(
sdef
->
xerUseTypeAttr
)
{
...
...
@@ -2093,7 +2093,7 @@ void defUnionClass(struct_def const *sdef, output_struct *output)
if
(
JSON_NUMBER
&
sdef
->
elements
[
i
].
jsonValueType
)
{
src
=
mputprintf
(
src
,
" p_tok.set_buf_pos(buf_pos);
\n
"
" ret_val = %s%s().JSON_decode(%s_descr_, p_tok,
true
);
\n
"
" ret_val = %s%s().JSON_decode(%s_descr_, p_tok,
TRUE
);
\n
"
" if (0 <= ret_val) {
\n
"
" return ret_val;
\n
"
" }
\n
"
...
...
@@ -2110,7 +2110,7 @@ void defUnionClass(struct_def const *sdef, output_struct *output)
if
(
JSON_STRING
&
sdef
->
elements
[
i
].
jsonValueType
)
{
src
=
mputprintf
(
src
,
" p_tok.set_buf_pos(buf_pos);
\n
"
" ret_val = %s%s().JSON_decode(%s_descr_, p_tok,
true
);
\n
"
" ret_val = %s%s().JSON_decode(%s_descr_, p_tok,
TRUE
);
\n
"
" if (0 <= ret_val) {
\n
"
" return ret_val;
\n
"
" }
\n
"
...
...
@@ -2128,7 +2128,7 @@ void defUnionClass(struct_def const *sdef, output_struct *output)
if
(
JSON_BOOLEAN
&
sdef
->
elements
[
i
].
jsonValueType
)
{
src
=
mputprintf
(
src
,
" p_tok.set_buf_pos(buf_pos);
\n
"
" ret_val = %s%s().JSON_decode(%s_descr_, p_tok,
true
);
\n
"
" ret_val = %s%s().JSON_decode(%s_descr_, p_tok,
TRUE
);
\n
"
" if (0 <= ret_val) {
\n
"
" return ret_val;
\n
"
" }
\n
"
...
...
@@ -2148,7 +2148,7 @@ void defUnionClass(struct_def const *sdef, output_struct *output)
if
(
JSON_ARRAY
&
sdef
->
elements
[
i
].
jsonValueType
)
{
src
=
mputprintf
(
src
,
" p_tok.set_buf_pos(buf_pos);
\n
"
" ret_val = %s%s().JSON_decode(%s_descr_, p_tok,
true
);
\n
"
" ret_val = %s%s().JSON_decode(%s_descr_, p_tok,
TRUE
);
\n
"
" if (0 <= ret_val) {
\n
"
" return ret_val;
\n
"
" }
\n
"
...
...
@@ -2165,7 +2165,7 @@ void defUnionClass(struct_def const *sdef, output_struct *output)
if
(
JSON_OBJECT
&
sdef
->
elements
[
i
].
jsonValueType
)
{
src
=
mputprintf
(
src
,
" p_tok.set_buf_pos(buf_pos);
\n
"
" ret_val = %s%s().JSON_decode(%s_descr_, p_tok,
true
);
\n
"
" ret_val = %s%s().JSON_decode(%s_descr_, p_tok,
TRUE
);
\n
"
" if (0 <= ret_val) {
\n
"
" return ret_val;
\n
"
" }
\n
"
...
...
@@ -2182,7 +2182,7 @@ void defUnionClass(struct_def const *sdef, output_struct *output)
if
(
JSON_NULL
&
sdef
->
elements
[
i
].
jsonValueType
)
{
src
=
mputprintf
(
src
,
" p_tok.set_buf_pos(buf_pos);
\n
"
" ret_val = %s%s().JSON_decode(%s_descr_, p_tok,
true
);
\n
"
" ret_val = %s%s().JSON_decode(%s_descr_, p_tok,
TRUE
);
\n
"
" if (0 <= ret_val) {
\n
"
" return ret_val;
\n
"
" }
\n
"
...
...
@@ -2573,7 +2573,7 @@ void defUnionTemplate(const struct_def *sdef, output_struct *output)
def
=
mputstr
(
def
,
"boolean is_value() const;"
);
src
=
mputprintf
(
src
,
"boolean %s_template::is_value() const
\n
"
"{
\n
"
"if (template_selection != SPECIFIC_VALUE || is_ifpresent) return
false
;
\n
"
"if (template_selection != SPECIFIC_VALUE || is_ifpresent) return
FALSE
;
\n
"
"switch (single_value.union_selection) {
\n
"
,
name
);
for
(
i
=
0
;
i
<
sdef
->
nElements
;
i
++
)
{
...
...
core/ASN_Any.cc
View file @
8cdabe89
...
...
@@ -72,7 +72,7 @@ void ASN_ANY::decode(const TTCN_Typedescriptor_t& p_td,
TTCN_EncDec_ErrorContext
::
error_internal
(
"No JSON descriptor available for type '%s'."
,
p_td
.
name
);
JSON_Tokenizer
tok
((
const
char
*
)
p_buf
.
get_data
(),
p_buf
.
get_len
());
if
(
JSON_decode
(
p_td
,
tok
,
false
)
<
0
)
if
(
JSON_decode
(
p_td
,
tok
,
FALSE
)
<
0
)
ec
.
error
(
TTCN_EncDec
::
ET_INCOMPL_MSG
,
"Can not decode type '%s', because invalid or incomplete"
" message was received"
...
...
core/ASN_CharacterString.cc
View file @
8cdabe89
...
...
@@ -792,7 +792,7 @@ int CHARACTER_STRING_identification::XER_encode(const XERdescriptor_t& p_td,
{
int
encoded_length
=
(
int
)
p_buf
.
get_len
();
begin_xml
(
p_td
,
p_buf
,
flavor
,
indent
++
,
false
);
begin_xml
(
p_td
,
p_buf
,
flavor
,
indent
++
,
FALSE
);
flavor
&=
XER_MASK
;
switch
(
union_selection
)
{
...
...
@@ -819,7 +819,7 @@ int CHARACTER_STRING_identification::XER_encode(const XERdescriptor_t& p_td,
break
;
}
end_xml
(
p_td
,
p_buf
,
flavor
,
--
indent
,
false
);
end_xml
(
p_td
,
p_buf
,
flavor
,
--
indent
,
FALSE
);
return
(
int
)
p_buf
.
get_len
()
-
encoded_length
;
}
...
...
@@ -1685,19 +1685,19 @@ void CHARACTER_STRING_identification_syntaxes::set_param(Module_Param& param)
break
;
case
Module_Param
::
MP_Assignment_List
:
{
Vector
<
bool
>
value_used
(
mp
->
get_size
());
value_used
.
resize
(
mp
->
get_size
(),
false
);
value_used
.
resize
(
mp
->
get_size
(),
FALSE
);
for
(
size_t
val_idx
=
0
;
val_idx
<
mp
->
get_size
();
val_idx
++
)
{
Module_Param
*
const
curr_param
=
mp
->
get_elem
(
val_idx
);
if
(
!
strcmp
(
curr_param
->
get_id
()
->
get_name
(),
"abstract"
))
{
abstract
().
set_param
(
*
curr_param
);
value_used
[
val_idx
]
=
true
;
value_used
[
val_idx
]
=
TRUE
;
}
}
for
(
size_t
val_idx
=
0
;
val_idx
<
mp
->
get_size
();
val_idx
++
)
{
Module_Param
*
const
curr_param
=
mp
->
get_elem
(
val_idx
);
if
(
!
strcmp
(
curr_param
->
get_id
()
->
get_name
(),
"transfer"
))
{
transfer
().
set_param
(
*
curr_param
);
value_used
[
val_idx
]
=
true
;
value_used
[
val_idx
]
=
TRUE
;
}
}
for
(
size_t
val_idx
=
0
;
val_idx
<
mp
->
get_size
();
val_idx
++
)
if
(
!
value_used
[
val_idx
])
{
...
...
@@ -1791,12 +1791,12 @@ int CHARACTER_STRING_identification_syntaxes::XER_encode(const XERdescriptor_t&
{
int
encoded_length
=
(
int
)
p_buf
.
get_len
();
begin_xml
(
p_td
,
p_buf
,
flavor
,
indent
++
,
false
);
begin_xml
(
p_td
,
p_buf
,
flavor
,
indent
++
,
FALSE
);
field_abstract
.
XER_encode
(
CHARACTER_STRING_identification_sxs_abs_xer_
,
p_buf
,
flavor
,
indent
,
0
);
field_transfer
.
XER_encode
(
CHARACTER_STRING_identification_sxs_xfr_xer_
,
p_buf
,
flavor
,
indent
,
0
);
end_xml
(
p_td
,
p_buf
,
flavor
,
--
indent
,
false
);
end_xml
(
p_td
,
p_buf
,
flavor
,
--
indent
,
FALSE
);
return
p_buf
.
get_len
()
-
encoded_length
;
}
...
...
@@ -1868,19 +1868,19 @@ void CHARACTER_STRING_identification_syntaxes_template::set_param(Module_Param&
break
;
case
Module_Param
::
MP_Assignment_List
:
{
Vector
<
bool
>
value_used
(
mp
->
get_size
());
value_used
.
resize
(
mp
->
get_size
(),
false
);
value_used
.
resize
(
mp
->
get_size
(),
FALSE
);
for
(
size_t
val_idx
=
0
;
val_idx
<
mp
->
get_size
();
val_idx
++
)
{
Module_Param
*
const
curr_param
=
mp
->
get_elem
(
val_idx
);
if
(
!
strcmp
(
curr_param
->
get_id
()
->
get_name
(),
"abstract"
))
{
abstract
().
set_param
(
*
curr_param
);
value_used
[
val_idx
]
=
true
;
value_used
[
val_idx
]
=
TRUE
;
}
}
for
(
size_t
val_idx
=
0
;
val_idx
<
mp
->
get_size
();
val_idx
++
)
{
Module_Param
*
const
curr_param
=
mp
->
get_elem
(
val_idx
);
if
(
!
strcmp
(
curr_param
->
get_id
()
->
get_name
(),
"transfer"
))
{
transfer
().
set_param
(
*
curr_param
);
value_used
[
val_idx
]
=
true
;
value_used
[
val_idx
]
=
TRUE
;
}
}
for
(
size_t
val_idx
=
0
;
val_idx
<
mp
->
get_size
();
val_idx
++
)
if
(
!
value_used
[
val_idx
])
{
...
...
@@ -2416,19 +2416,19 @@ void CHARACTER_STRING_identification_context__negotiation::set_param(Module_Para
break
;
case
Module_Param
::
MP_Assignment_List
:
{
Vector
<
bool
>
value_used
(
mp
->
get_size
());
value_used
.
resize
(
mp
->
get_size
(),
false
);
value_used
.
resize
(
mp
->
get_size
(),
FALSE
);
for
(
size_t
val_idx
=
0
;
val_idx
<
mp
->
get_size
();
val_idx
++
)
{
Module_Param
*
const
curr_param
=
mp
->
get_elem
(
val_idx
);
if
(
!
strcmp
(
curr_param
->
get_id
()
->
get_name
(),
"presentation_context_id"
))
{
presentation__context__id
().
set_param
(
*
curr_param
);
value_used
[
val_idx
]
=
true
;
value_used
[
val_idx
]
=
TRUE
;
}
}
for
(
size_t
val_idx
=
0
;
val_idx
<
mp
->
get_size
();
val_idx
++
)
{
Module_Param
*
const
curr_param
=
mp
->
get_elem
(
val_idx
);
if
(
!
strcmp
(
curr_param
->
get_id
()
->
get_name
(),
"transfer_syntax"
))
{
transfer__syntax
().
set_param
(
*
curr_param
);
value_used
[
val_idx
]
=
true
;
value_used
[
val_idx
]
=
TRUE
;
}
}
for
(
size_t
val_idx
=
0
;
val_idx
<
mp
->
get_size
();
val_idx
++
)
if
(
!
value_used
[
val_idx
])
{
...
...
@@ -2522,12 +2522,12 @@ int CHARACTER_STRING_identification_context__negotiation::XER_encode(const XERde
{
int
encoded_length
=
(
int
)
p_buf
.
get_len
();
begin_xml
(
p_td
,
p_buf
,
flavor
,
indent
++
,
false
);
begin_xml
(
p_td
,
p_buf
,
flavor
,
indent
++
,
FALSE
);
field_presentation__context__id
.
XER_encode
(
CHARACTER_STRING_identification_pci_xer_
,
p_buf
,
flavor
,
indent
,
0
);
field_transfer__syntax
.
XER_encode
(
CHARACTER_STRING_identification_ts_xer_
,
p_buf
,
flavor
,
indent
,
0
);
end_xml
(
p_td
,
p_buf
,
flavor
,
--
indent
,
false
);
end_xml
(
p_td
,
p_buf
,
flavor
,
--
indent
,
FALSE
);
return
p_buf
.
get_len
()
-
encoded_length
;
}
...
...
@@ -2601,19 +2601,19 @@ void CHARACTER_STRING_identification_context__negotiation_template::set_param(Mo
break
;
case
Module_Param
::
MP_Assignment_List
:
{
Vector
<
bool
>
value_used
(
mp
->
get_size
());
value_used
.
resize
(
mp
->
get_size
(),
false
);
value_used
.
resize
(
mp
->
get_size
(),
FALSE
);
for
(
size_t
val_idx
=
0
;
val_idx
<
mp
->
get_size
();
val_idx
++
)
{
Module_Param
*
const
curr_param
=
mp
->
get_elem
(
val_idx
);
if
(
!
strcmp
(
curr_param
->
get_id
()
->
get_name
(),
"presentation_context_id"
))
{
presentation__context__id
().
set_param
(
*
curr_param
);
value_used
[
val_idx
]
=
true
;
value_used
[
val_idx
]
=
TRUE
;
}
}
for
(
size_t
val_idx
=
0
;
val_idx
<
mp
->
get_size
();
val_idx
++
)
{
Module_Param
*
const
curr_param
=
mp
->
get_elem
(
val_idx
);
if
(
!
strcmp
(
curr_param
->
get_id
()
->
get_name
(),
"transfer_syntax"
))
{
transfer__syntax
().
set_param
(
*
curr_param
);
value_used
[
val_idx
]
=
true
;
value_used
[
val_idx
]
=
TRUE
;
}
}
for
(
size_t
val_idx
=
0
;
val_idx
<
mp
->
get_size
();
val_idx
++
)
if
(
!
value_used
[
val_idx
])
{
...
...
@@ -3159,26 +3159,26 @@ void CHARACTER_STRING::set_param(Module_Param& param)
break
;
case
Module_Param
::
MP_Assignment_List
:
{
Vector
<
bool
>
value_used
(
mp
->
get_size
());
value_used
.
resize
(
mp
->
get_size
(),
false
);
value_used
.
resize
(
mp
->
get_size
(),
FALSE
);
for
(
size_t
val_idx
=
0
;
val_idx
<
mp
->
get_size
();
val_idx
++
)
{
Module_Param
*
const
curr_param
=
mp
->
get_elem
(
val_idx
);
if
(
!
strcmp
(
curr_param
->
get_id
()
->
get_name
(),
"identification"
))
{
identification
().
set_param
(
*
curr_param
);
value_used
[
val_idx
]
=
true
;
value_used
[
val_idx
]
=
TRUE
;
}
}
for
(
size_t
val_idx
=
0
;
val_idx
<
mp
->
get_size
();
val_idx
++
)
{
Module_Param
*
const
curr_param
=
mp
->
get_elem
(
val_idx
);
if
(
!
strcmp
(
curr_param
->
get_id
()
->
get_name
(),
"data_value_descriptor"
))
{
data__value__descriptor
().
set_param
(
*
curr_param
);
value_used
[
val_idx
]
=
true
;
value_used
[
val_idx
]
=
TRUE
;
}
}
for
(
size_t
val_idx
=
0
;
val_idx
<
mp
->
get_size
();
val_idx
++
)
{
Module_Param
*
const
curr_param
=
mp
->
get_elem
(
val_idx
);
if
(
!
strcmp
(
curr_param
->
get_id
()
->
get_name
(),
"string_value"
))
{
string__value
().
set_param
(
*
curr_param
);
value_used
[
val_idx
]
=
true
;
value_used
[
val_idx
]
=
TRUE
;
}
}
for
(
size_t
val_idx
=
0
;
val_idx
<
mp
->
get_size
();
val_idx
++
)
if
(
!
value_used
[
val_idx
])
{
...
...
@@ -3374,14 +3374,14 @@ int CHARACTER_STRING::XER_encode(const XERdescriptor_t& p_td, TTCN_Buffer& p_buf
int
encoded_length
=
(
int
)
p_buf
.
get_len
();
flavor
&=
~
XER_RECOF
;
// ASN.1 character string doesn't care
begin_xml
(
p_td
,
p_buf
,
flavor
,
indent
++
,
false
);
begin_xml
(
p_td
,
p_buf
,
flavor
,
indent
++
,
FALSE
);
field_identification
.
XER_encode
(
CHARACTER_STRING_identification_xer_
,
p_buf
,
flavor
,
indent
,
0
);
// data-value-descriptor is OPTIONAL and can never be present.
// Its encoding is empty.
field_string__value
.
XER_encode
(
CHARACTER_STRING_data_value_xer_
,
p_buf
,
flavor
,
indent
,
0
);
end_xml
(
p_td
,
p_buf
,
flavor
,
--
indent
,
false
);
end_xml
(
p_td
,
p_buf
,
flavor
,
--
indent
,
FALSE
);
return
(
int
)
p_buf
.
get_len
()
-
encoded_length
;
}
...
...
@@ -3471,26 +3471,26 @@ void CHARACTER_STRING_template::set_param(Module_Param& param)
break
;
case
Module_Param
::
MP_Assignment_List
:
{
Vector
<
bool
>
value_used
(
mp
->
get_size
());
value_used
.
resize
(
mp
->
get_size
(),
false
);
value_used
.
resize
(
mp
->
get_size
(),
FALSE
);
for
(
size_t
val_idx
=
0
;
val_idx
<
mp
->
get_size
();
val_idx
++
)
{
Module_Param
*
const
curr_param
=
mp
->
get_elem
(
val_idx
);
if
(
!
strcmp
(
curr_param
->
get_id
()
->
get_name
(),
"identification"
))
{
identification
().
set_param
(
*
curr_param
);
value_used
[
val_idx
]
=
true
;
value_used
[
val_idx
]
=
TRUE
;
}
}
for
(
size_t
val_idx
=
0
;
val_idx
<
mp
->
get_size
();
val_idx
++
)
{
Module_Param
*
const
curr_param
=
mp
->
get_elem
(
val_idx
);
if
(
!
strcmp
(
curr_param
->
get_id
()
->
get_name
(),
"data_value_descriptor"
))
{
data__value__descriptor
().
set_param
(
*
curr_param
);
value_used
[
val_idx
]
=
true
;
value_used
[
val_idx
]
=
TRUE
;
}
}
for
(
size_t
val_idx
=
0
;
val_idx
<
mp
->
get_size
();
val_idx
++
)
{
Module_Param
*
const
curr_param
=
mp
->
get_elem
(
val_idx
);
if
(
!
strcmp
(
curr_param
->
get_id
()
->
get_name
(),
"string_value"
))
{
string__value
().
set_param
(
*
curr_param
);
value_used
[
val_idx
]
=
true
;
value_used
[
val_idx
]
=
TRUE
;
}
}
for
(
size_t
val_idx
=
0
;
val_idx
<
mp
->
get_size
();
val_idx
++
)
if
(
!
value_used
[
val_idx
])
{
...
...
core/ASN_EmbeddedPDV.cc
View file @
8cdabe89
...
...
@@ -1680,19 +1680,19 @@ void EMBEDDED_PDV_identification_syntaxes::set_param(Module_Param& param)
break
;
case
Module_Param
::
MP_Assignment_List
:
{
Vector
<
bool
>
value_used
(
mp
->
get_size
());
value_used
.
resize
(
mp
->
get_size
(),
false
);
value_used
.
resize
(
mp
->
get_size
(),
FALSE
);
for
(
size_t
val_idx
=
0
;
val_idx
<
mp
->
get_size
();
val_idx
++
)
{
Module_Param
*
const
curr_param
=
mp
->
get_elem
(
val_idx
);
if
(
!
strcmp
(
curr_param
->
get_id
()
->
get_name
(),
"abstract"
))
{
abstract
().
set_param
(
*
curr_param
);
value_used
[
val_idx
]
=
true
;
value_used
[
val_idx
]
=
TRUE
;
}
}
for
(
size_t
val_idx
=
0
;
val_idx
<
mp
->
get_size
();
val_idx
++
)
{
Module_Param
*
const
curr_param
=
mp
->
get_elem
(
val_idx
);
if
(
!
strcmp
(
curr_param
->
get_id
()
->
get_name
(),
"transfer"
))
{
transfer
().
set_param
(
*
curr_param
);
value_used
[
val_idx
]
=
true
;
value_used
[
val_idx
]
=
TRUE
;
}
}
for
(
size_t
val_idx
=
0
;
val_idx
<
mp
->
get_size
();
val_idx
++
)
if
(
!
value_used
[
val_idx
])
{
...
...
@@ -1872,19 +1872,19 @@ void EMBEDDED_PDV_identification_syntaxes_template::set_param(Module_Param& para
break
;
case
Module_Param
::
MP_Assignment_List
:
{
Vector
<
bool
>
value_used
(
mp
->
get_size
());
value_used
.
resize
(
mp
->
get_size
(),
false
);
value_used
.
resize
(
mp
->
get_size
(),
FALSE
);
for
(
size_t
val_idx
=
0
;
val_idx
<
mp
->
get_size
();
val_idx
++
)
{
Module_Param
*
const
curr_param
=
mp
->
get_elem
(
val_idx
);
if
(
!
strcmp
(
curr_param
->
get_id
()
->
get_name
(),
"abstract"
))
{
abstract
().
set_param
(
*
curr_param
);
value_used
[
val_idx
]
=
true
;
value_used
[
val_idx
]
=
TRUE
;
}
}
for
(
size_t
val_idx
=
0
;
val_idx
<
mp
->
get_size
();
val_idx
++
)
{
Module_Param
*
const
curr_param
=
mp
->
get_elem
(
val_idx
);
if
(
!
strcmp
(
curr_param
->
get_id
()
->
get_name
(),
"transfer"
))
{
transfer
().
set_param
(
*
curr_param
);
value_used
[
val_idx
]
=
true
;
value_used
[
val_idx
]
=
TRUE
;
}
}
for
(
size_t
val_idx
=
0
;
val_idx
<
mp
->
get_size
();
val_idx
++
)
if
(
!
value_used
[
val_idx
])
{
...
...
@@ -2420,19 +2420,19 @@ void EMBEDDED_PDV_identification_context__negotiation::set_param(Module_Param& p
break
;
case
Module_Param
::
MP_Assignment_List
:
{
Vector
<
bool
>
value_used
(
mp
->
get_size
());
value_used
.
resize
(
mp
->
get_size
(),
false
);
value_used
.
resize
(
mp
->
get_size
(),
FALSE
);
for
(
size_t
val_idx
=
0
;
val_idx
<
mp
->
get_size
();
val_idx
++
)
{
Module_Param
*
const
curr_param
=
mp
->
get_elem
(
val_idx
);
if
(
!
strcmp
(
curr_param
->
get_id
()
->
get_name
(),
"presentation_context_id"
))
{
presentation__context__id
().
set_param
(
*
curr_param
);
value_used
[
val_idx
]
=
true
;
value_used
[
val_idx
]
=
TRUE
;
}
}
for
(
size_t
val_idx
=
0
;
val_idx
<
mp
->
get_size
();
val_idx
++
)
{
Module_Param
*
const
curr_param
=
mp
->
get_elem
(
val_idx
);
if
(
!
strcmp
(
curr_param
->
get_id
()
->
get_name
(),
"transfer_syntax"
))
{
transfer__syntax
().
set_param
(
*
curr_param
);
value_used
[
val_idx
]
=
true
;
value_used
[
val_idx
]
=
TRUE
;
}
}
for
(
size_t
val_idx
=
0
;
val_idx
<
mp
->
get_size
();
val_idx
++
)
if
(
!
value_used
[
val_idx
])
{
...
...
@@ -2613,19 +2613,19 @@ void EMBEDDED_PDV_identification_context__negotiation_template::set_param(Module
break
;
case
Module_Param
::
MP_Assignment_List
:
{
Vector
<
bool
>
value_used
(
mp
->
get_size
());
value_used
.
resize
(
mp
->
get_size
(),
false
);
value_used
.
resize
(
mp
->
get_size
(),
FALSE
);