diff --git a/dds/idl/marshal_generator.cpp b/dds/idl/marshal_generator.cpp index e6c9a62c169..d5588ccbee3 100644 --- a/dds/idl/marshal_generator.cpp +++ b/dds/idl/marshal_generator.cpp @@ -500,7 +500,7 @@ namespace { AST_Type* elem = resolveActualType(seq->base_type()); TryConstructFailAction try_construct = be_global->sequence_element_try_construct(seq); - Classification elem_cls = classify(elem); + const Classification elem_cls = classify(elem); const bool primitive = elem_cls & CL_PRIMITIVE; if (!elem->in_main_file()) { if (elem->node_type() == AST_Decl::NT_pre_defined) { @@ -918,7 +918,7 @@ namespace { AST_Type* elem = resolveActualType(arr->base_type()); TryConstructFailAction try_construct = be_global->array_element_try_construct(arr); - Classification elem_cls = classify(elem); + const Classification elem_cls = classify(elem); const bool primitive = elem_cls & CL_PRIMITIVE; if (!elem->in_main_file() && elem->node_type() != AST_Decl::NT_pre_defined) { @@ -1260,7 +1260,7 @@ namespace { if (type == type_stack[i]) return false; } type_stack.push_back(type); - Classification fld_cls = classify(type); + const Classification fld_cls = classify(type); if ((fld_cls & CL_STRING) && !(fld_cls & CL_BOUNDED)) { bounded = false; } else if (fld_cls & CL_STRUCTURE) { @@ -2477,7 +2477,7 @@ namespace { " if (!" << generate_field_stream( indent, field, ">> stru" + value_access, wrap_nested_key_only, intro) << ") {\n"; AST_Type* const field_type = resolveActualType(field->field_type()); - Classification fld_cls = classify(field_type); + const Classification fld_cls = classify(field_type); if (use_cxx11) { field_name += "()"; @@ -3046,7 +3046,7 @@ marshal_generator::gen_field_getValueFromSerialized(AST_Structure* node, const s const OpenDDS::XTypes::MemberId id = be_global->get_id(field); std::string field_name = field->local_name()->get_string(); AST_Type* const field_type = resolveActualType(field->field_type()); - Classification fld_cls = classify(field_type); + const Classification fld_cls = classify(field_type); cases << " case " << id << ": {\n"; if (fld_cls & CL_SCALAR) { @@ -3131,7 +3131,7 @@ marshal_generator::gen_field_getValueFromSerialized(AST_Structure* node, const s size_t size = 0; const std::string idl_name = canonical_name(field); AST_Type* const field_type = resolveActualType(field->field_type()); - Classification fld_cls = classify(field_type); + const Classification fld_cls = classify(field_type); if (fld_cls & CL_SCALAR) { const std::string cxx_type = to_cxx_type(field_type, size); const std::string val = (fld_cls & CL_STRING) ? (use_cxx11 ? "val" : "val.out()") @@ -3492,7 +3492,7 @@ bool marshal_generator::gen_union(AST_Union* node, UTL_ScopedName* name, NamespaceGuard ng; be_global->add_include("dds/DCPS/Serializer.h"); string cxx = scoped(name); // name as a C++ class - Classification disc_cls = classify(discriminator); + const Classification disc_cls = classify(discriminator); FieldInfo::EleLenSet anonymous_seq_generated; for (size_t i = 0; i < branches.size(); ++i) {