Commit 11e0e8e5 authored by Laura Alexandra Sequeira Gouveia's avatar Laura Alexandra Sequeira Gouveia
Browse files

Simulink Mapper: Octet string convert uses loop instead of assigning

each element individually.
parent 6bf40fab
......@@ -158,9 +158,9 @@ class FromASN1SCCtoSimulink(RecursiveMapper):
lines = [] # type: List[str]
limit = sourceSequenceLimit(node, srcVar)
for i in range(0, node._range[-1]):
lines.append("if (%s>=%d) %s.element_data[%d] = %s.arr[%d]; else %s.element_data[%d] = 0;\n" %
(limit, i + 1, dstSimulink, i, srcVar, i, dstSimulink, i))
lines.append("unsigned int i=0;\n");
lines.append("for(i=0; i<%s; i++)\n %s.element_data[i] = %s.arr[i];\n" % (limit, dstSimulink, srcVar));
if len(node._range) > 1 and node._range[0] != node._range[1]:
lines.append("%s.length = %s;\n" % (dstSimulink, limit))
return lines
Supports Markdown
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