Bug Summary

File:OMCompiler/Compiler/boot/build/ExpandableArray.c
Warning:line 377, column 9
Value stored to '_i' is never read

Annotated Source Code

[?] Use j/k keys for keyboard navigation

1#ifdef OMC_BASE_FILE
2 #define OMC_FILE"/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/boot/build/tmp/ExpandableArray.c" OMC_BASE_FILE
3#else
4 #define OMC_FILE"/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/boot/build/tmp/ExpandableArray.c" "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/boot/build/tmp/ExpandableArray.c"
5#endif
6#include "omc_simulation_settings.h"
7#include "ExpandableArray.h"
8#define _OMC_LIT0_data" (" " ("
9static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT0,2,_OMC_LIT0_data)struct { mmc_uint_t header; const char data[(2)+1]; } _OMC_LIT_STRUCT0
= { ((((mmc_uint_t)2)<<(3))+((1<<(3+3))+5)), " ("
}
;
10#define _OMC_LIT0((void*)((char*)(&(_OMC_LIT_STRUCT0).header) + 3)) MMC_REFSTRINGLIT(_OMC_LIT_STRUCT0)((void*)((char*)(&(_OMC_LIT_STRUCT0).header) + 3))
11#define _OMC_LIT1_data"/" "/"
12static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT1,1,_OMC_LIT1_data)struct { mmc_uint_t header; const char data[(1)+1]; } _OMC_LIT_STRUCT1
= { ((((mmc_uint_t)1)<<(3))+((1<<(3+3))+5)), "/"
}
;
13#define _OMC_LIT1((void*)((char*)(&(_OMC_LIT_STRUCT1).header) + 3)) MMC_REFSTRINGLIT(_OMC_LIT_STRUCT1)((void*)((char*)(&(_OMC_LIT_STRUCT1).header) + 3))
14#define _OMC_LIT2_data")\n" ")\n"
15static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT2,2,_OMC_LIT2_data)struct { mmc_uint_t header; const char data[(2)+1]; } _OMC_LIT_STRUCT2
= { ((((mmc_uint_t)2)<<(3))+((1<<(3+3))+5)), ")\n"
}
;
16#define _OMC_LIT2((void*)((char*)(&(_OMC_LIT_STRUCT2).header) + 3)) MMC_REFSTRINGLIT(_OMC_LIT_STRUCT2)((void*)((char*)(&(_OMC_LIT_STRUCT2).header) + 3))
17#define _OMC_LIT3_data"========================================\n" "========================================\n"
18static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT3,41,_OMC_LIT3_data)struct { mmc_uint_t header; const char data[(41)+1]; } _OMC_LIT_STRUCT3
= { ((((mmc_uint_t)41)<<(3))+((1<<(3+3))+5)), "========================================\n"
}
;
19#define _OMC_LIT3((void*)((char*)(&(_OMC_LIT_STRUCT3).header) + 3)) MMC_REFSTRINGLIT(_OMC_LIT_STRUCT3)((void*)((char*)(&(_OMC_LIT_STRUCT3).header) + 3))
20#define _OMC_LIT4_data": " ": "
21static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT4,2,_OMC_LIT4_data)struct { mmc_uint_t header; const char data[(2)+1]; } _OMC_LIT_STRUCT4
= { ((((mmc_uint_t)2)<<(3))+((1<<(3+3))+5)), ": "
}
;
22#define _OMC_LIT4((void*)((char*)(&(_OMC_LIT_STRUCT4).header) + 3)) MMC_REFSTRINGLIT(_OMC_LIT_STRUCT4)((void*)((char*)(&(_OMC_LIT_STRUCT4).header) + 3))
23#define _OMC_LIT5_data"\n" "\n"
24static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT5,1,_OMC_LIT5_data)struct { mmc_uint_t header; const char data[(1)+1]; } _OMC_LIT_STRUCT5
= { ((((mmc_uint_t)1)<<(3))+((1<<(3+3))+5)), "\n"
}
;
25#define _OMC_LIT5((void*)((char*)(&(_OMC_LIT_STRUCT5).header) + 3)) MMC_REFSTRINGLIT(_OMC_LIT_STRUCT5)((void*)((char*)(&(_OMC_LIT_STRUCT5).header) + 3))
26#define _OMC_LIT6_data"<empty>\n" "<empty>\n"
27static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT6,8,_OMC_LIT6_data)struct { mmc_uint_t header; const char data[(8)+1]; } _OMC_LIT_STRUCT6
= { ((((mmc_uint_t)8)<<(3))+((1<<(3+3))+5)), "<empty>\n"
}
;
28#define _OMC_LIT6((void*)((char*)(&(_OMC_LIT_STRUCT6).header) + 3)) MMC_REFSTRINGLIT(_OMC_LIT_STRUCT6)((void*)((char*)(&(_OMC_LIT_STRUCT6).header) + 3))
29#include "util/modelica.h"
30
31#include "ExpandableArray_includes.h"
32
33
34
35DLLExport
36modelica_metatype omc_ExpandableArray_getData(threadData_t *threadData, modelica_metatype _exarray)
37{
38 modelica_metatype _data = NULL((void*)0);
39 MMC_SO()mmc_check_stackoverflow(threadData);
40 _tailrecursive: OMC_LABEL_UNUSED__attribute__((unused))
41 _data = arrayGetNoBoundsChecking((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_exarray), 5))), ((modelica_integer) 1))((((struct mmc_struct*)((void*)((char*)((((*(void**)(((void*)
((void**)(((void*)((char*)(_exarray) - 3))) + (5)))))))) - 3)
))->data)[(((modelica_integer) 1))-1])
;
42 _return: OMC_LABEL_UNUSED__attribute__((unused))
43 return _data;
44}
45
46DLLExport
47modelica_integer omc_ExpandableArray_getCapacity(threadData_t *threadData, modelica_metatype _exarray)
48{
49 modelica_integer _capacity;
50 MMC_SO()mmc_check_stackoverflow(threadData);
51 _tailrecursive: OMC_LABEL_UNUSED__attribute__((unused))
52 _capacity = mmc_unbox_integer(arrayGetNoBoundsChecking((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_exarray), 4))), ((modelica_integer) 1)))(((mmc_sint_t) (((((struct mmc_struct*)((void*)((char*)((((*(
void**)(((void*)((void**)(((void*)((char*)(_exarray) - 3))) +
(4)))))))) - 3)))->data)[(((modelica_integer) 1))-1]))) >>
1)
;
53 _return: OMC_LABEL_UNUSED__attribute__((unused))
54 return _capacity;
55}
56modelica_metatype boxptr_ExpandableArray_getCapacity(threadData_t *threadData, modelica_metatype _exarray)
57{
58 modelica_integer _capacity;
59 modelica_metatype out_capacity;
60 _capacity = omc_ExpandableArray_getCapacity(threadData, _exarray);
61 out_capacity = mmc_mk_icon(_capacity);
62 return out_capacity;
63}
64
65DLLExport
66modelica_integer omc_ExpandableArray_getLastUsedIndex(threadData_t *threadData, modelica_metatype _exarray)
67{
68 modelica_integer _lastUsedIndex;
69 MMC_SO()mmc_check_stackoverflow(threadData);
70 _tailrecursive: OMC_LABEL_UNUSED__attribute__((unused))
71 _lastUsedIndex = mmc_unbox_integer(arrayGetNoBoundsChecking((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_exarray), 3))), ((modelica_integer) 1)))(((mmc_sint_t) (((((struct mmc_struct*)((void*)((char*)((((*(
void**)(((void*)((void**)(((void*)((char*)(_exarray) - 3))) +
(3)))))))) - 3)))->data)[(((modelica_integer) 1))-1]))) >>
1)
;
72 _return: OMC_LABEL_UNUSED__attribute__((unused))
73 return _lastUsedIndex;
74}
75modelica_metatype boxptr_ExpandableArray_getLastUsedIndex(threadData_t *threadData, modelica_metatype _exarray)
76{
77 modelica_integer _lastUsedIndex;
78 modelica_metatype out_lastUsedIndex;
79 _lastUsedIndex = omc_ExpandableArray_getLastUsedIndex(threadData, _exarray);
80 out_lastUsedIndex = mmc_mk_icon(_lastUsedIndex);
81 return out_lastUsedIndex;
82}
83
84DLLExport
85modelica_integer omc_ExpandableArray_getNumberOfElements(threadData_t *threadData, modelica_metatype _exarray)
86{
87 modelica_integer _numberOfElements;
88 MMC_SO()mmc_check_stackoverflow(threadData);
89 _tailrecursive: OMC_LABEL_UNUSED__attribute__((unused))
90 _numberOfElements = mmc_unbox_integer(arrayGetNoBoundsChecking((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_exarray), 2))), ((modelica_integer) 1)))(((mmc_sint_t) (((((struct mmc_struct*)((void*)((char*)((((*(
void**)(((void*)((void**)(((void*)((char*)(_exarray) - 3))) +
(2)))))))) - 3)))->data)[(((modelica_integer) 1))-1]))) >>
1)
;
91 _return: OMC_LABEL_UNUSED__attribute__((unused))
92 return _numberOfElements;
93}
94modelica_metatype boxptr_ExpandableArray_getNumberOfElements(threadData_t *threadData, modelica_metatype _exarray)
95{
96 modelica_integer _numberOfElements;
97 modelica_metatype out_numberOfElements;
98 _numberOfElements = omc_ExpandableArray_getNumberOfElements(threadData, _exarray);
99 out_numberOfElements = mmc_mk_icon(_numberOfElements);
100 return out_numberOfElements;
101}
102
103DLLExport
104void omc_ExpandableArray_dump(threadData_t *threadData, modelica_metatype _exarray, modelica_string _header, modelica_fnptr _func)
105{
106 modelica_integer _numberOfElements;
107 modelica_integer _capacity;
108 modelica_metatype _value = NULL((void*)0);
109 modelica_metatype _data = NULL((void*)0);
110 modelica_integer tmp1;
111 modelica_integer tmp2;
112 modelica_integer tmp3;
113 modelica_metatype tmpMeta[5] __attribute__((unused)) = {0};
114 MMC_SO()mmc_check_stackoverflow(threadData);
115 _tailrecursive: OMC_LABEL_UNUSED__attribute__((unused))
116 _numberOfElements = mmc_unbox_integer(arrayGetNoBoundsChecking((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_exarray), 2))), ((modelica_integer) 1)))(((mmc_sint_t) (((((struct mmc_struct*)((void*)((char*)((((*(
void**)(((void*)((void**)(((void*)((char*)(_exarray) - 3))) +
(2)))))))) - 3)))->data)[(((modelica_integer) 1))-1]))) >>
1)
;
117 _capacity = mmc_unbox_integer(arrayGetNoBoundsChecking((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_exarray), 4))), ((modelica_integer) 1)))(((mmc_sint_t) (((((struct mmc_struct*)((void*)((char*)((((*(
void**)(((void*)((void**)(((void*)((char*)(_exarray) - 3))) +
(4)))))))) - 3)))->data)[(((modelica_integer) 1))-1]))) >>
1)
;
118 // _value has no default value.
119 _data = arrayGetNoBoundsChecking((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_exarray), 5))), ((modelica_integer) 1))((((struct mmc_struct*)((void*)((char*)((((*(void**)(((void*)
((void**)(((void*)((char*)(_exarray) - 3))) + (5)))))))) - 3)
))->data)[(((modelica_integer) 1))-1])
;
120#line 297 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
121 tmpMeta[0] = stringAppend(_header,_OMC_LIT0((void*)((char*)(&(_OMC_LIT_STRUCT0).header) + 3)));
122#line 297 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
123 tmpMeta[1] = stringAppend(tmpMeta[0],intString(_numberOfElements));
124#line 297 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
125 tmpMeta[2] = stringAppend(tmpMeta[1],_OMC_LIT1((void*)((char*)(&(_OMC_LIT_STRUCT1).header) + 3)));
126#line 297 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
127 tmpMeta[3] = stringAppend(tmpMeta[2],intString(_capacity));
128#line 297 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
129 tmpMeta[4] = stringAppend(tmpMeta[3],_OMC_LIT2((void*)((char*)(&(_OMC_LIT_STRUCT2).header) + 3)));
130#line 297 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
131 fputs(MMC_STRINGDATA(tmpMeta[4])(((struct mmc_string*)((void*)((char*)(tmpMeta[4]) - 3)))->
data)
,stdoutstdout);
132#line 132 OMC_FILE"/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/boot/build/tmp/ExpandableArray.c"
133
134#line 298 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
135 fputs(MMC_STRINGDATA(_OMC_LIT3)(((struct mmc_string*)((void*)((char*)(((void*)((char*)(&
(_OMC_LIT_STRUCT3).header) + 3))) - 3)))->data)
,stdoutstdout);
136#line 136 OMC_FILE"/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/boot/build/tmp/ExpandableArray.c"
137
138#line 300 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
139 if((_numberOfElements == ((modelica_integer) 0)))
140#line 300 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
141 {
142#line 301 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
143 fputs(MMC_STRINGDATA(_OMC_LIT6)(((struct mmc_string*)((void*)((char*)(((void*)((char*)(&
(_OMC_LIT_STRUCT6).header) + 3))) - 3)))->data)
,stdoutstdout);
144#line 144 OMC_FILE"/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/boot/build/tmp/ExpandableArray.c"
145 }
146 else
147 {
148#line 303 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
149 tmp1 = ((modelica_integer) 1); tmp2 = 1; tmp3 = _capacity;
150#line 303 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
151 if(!(((tmp2 > 0) && (tmp1 > tmp3)) || ((tmp2 < 0) && (tmp1 < tmp3))))
152#line 303 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
153 {
154#line 303 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
155 modelica_integer _i;
156#line 303 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
157 for(_i = ((modelica_integer) 1); in_range_integer(_i, tmp1, tmp3); _i += tmp2)
158#line 303 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
159 {
160#line 304 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
161 if(isSome(arrayGetNoBoundsChecking(_data, _i))(0==((((((*(mmc_uint_t*)((void*)((char*)(((((struct mmc_struct
*)((void*)((char*)((_data)) - 3)))->data)[(_i)-1])) - 3)))
) & (7)) == 5)) ? ((((*(mmc_uint_t*)((void*)((char*)(((((
struct mmc_struct*)((void*)((char*)((_data)) - 3)))->data)
[(_i)-1])) - 3)))) >> (3+3))) : (((*(mmc_uint_t*)((void
*)((char*)(((((struct mmc_struct*)((void*)((char*)((_data)) -
3)))->data)[(_i)-1])) - 3)))) >> 10)) ? 0 : 1)
)
162#line 304 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
163 {
164#line 305 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
165 /* Pattern-matching assignment */
166#line 305 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
167 tmpMeta[0] = arrayGetNoBoundsChecking(_data, _i)((((struct mmc_struct*)((void*)((char*)((_data)) - 3)))->data
)[(_i)-1])
;
168#line 305 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
169 if (optionNone(tmpMeta[0])(0==((((((*(mmc_uint_t*)((void*)((char*)(tmpMeta[0]) - 3)))) &
(7)) == 5)) ? ((((*(mmc_uint_t*)((void*)((char*)(tmpMeta[0])
- 3)))) >> (3+3))) : (((*(mmc_uint_t*)((void*)((char*)
(tmpMeta[0]) - 3)))) >> 10)) ? 1 : 0)
) MMC_THROW_INTERNAL(){longjmp(*threadData->mmc_jumper,1);};
170#line 305 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
171 tmpMeta[1] = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta[0]), 1))(*(void**)(((void*)((void**)(((void*)((char*)(tmpMeta[0]) - 3
))) + (1)))))
;
172#line 305 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
173 _value = tmpMeta[1];
174#line 174 OMC_FILE"/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/boot/build/tmp/ExpandableArray.c"
175
176#line 306 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
177 _numberOfElements = ((modelica_integer) -1) + _numberOfElements;
178#line 178 OMC_FILE"/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/boot/build/tmp/ExpandableArray.c"
179
180#line 307 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
181 tmpMeta[0] = stringAppend(intString(_i),_OMC_LIT4((void*)((char*)(&(_OMC_LIT_STRUCT4).header) + 3)));
182#line 307 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
183 tmpMeta[1] = stringAppend(tmpMeta[0],(MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_func), 2))(*(void**)(((void*)((void**)(((void*)((char*)(_func) - 3))) +
(2)))))
) ? ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_func), 1))(*(void**)(((void*)((void**)(((void*)((char*)(_func) - 3))) +
(1)))))
)) (threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_func), 2))(*(void**)(((void*)((void**)(((void*)((char*)(_func) - 3))) +
(2)))))
), _value) : ((modelica_metatype(*)(threadData_t*, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_func), 1))(*(void**)(((void*)((void**)(((void*)((char*)(_func) - 3))) +
(1)))))
)) (threadData, _value));
184#line 307 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
185 tmpMeta[2] = stringAppend(tmpMeta[1],_OMC_LIT5((void*)((char*)(&(_OMC_LIT_STRUCT5).header) + 3)));
186#line 307 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
187 fputs(MMC_STRINGDATA(tmpMeta[2])(((struct mmc_string*)((void*)((char*)(tmpMeta[2]) - 3)))->
data)
,stdoutstdout);
188#line 188 OMC_FILE"/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/boot/build/tmp/ExpandableArray.c"
189
190#line 308 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
191 if((_numberOfElements == ((modelica_integer) 0)))
192#line 308 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
193 {
194#line 309 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
195 goto _return;
196#line 196 OMC_FILE"/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/boot/build/tmp/ExpandableArray.c"
197 }
198 }
199 }
200 }
201 }
202 _return: OMC_LABEL_UNUSED__attribute__((unused))
203 return;
204}
205
206DLLExport
207modelica_metatype omc_ExpandableArray_shrink(threadData_t *threadData, modelica_metatype _D_24in_exarray)
208{
209 modelica_metatype _exarray = NULL((void*)0);
210 modelica_integer _numberOfElements;
211 modelica_metatype _data = NULL((void*)0);
212 modelica_metatype _newData = NULL((void*)0);
213 modelica_integer tmp1;
214 modelica_integer tmp2;
215 modelica_integer tmp3;
216 MMC_SO()mmc_check_stackoverflow(threadData);
217 _tailrecursive: OMC_LABEL_UNUSED__attribute__((unused))
218 _exarray = _D_24in_exarray;
219 _numberOfElements = mmc_unbox_integer(arrayGetNoBoundsChecking((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_exarray), 2))), ((modelica_integer) 1)))(((mmc_sint_t) (((((struct mmc_struct*)((void*)((char*)((((*(
void**)(((void*)((void**)(((void*)((char*)(_exarray) - 3))) +
(2)))))))) - 3)))->data)[(((modelica_integer) 1))-1]))) >>
1)
;
220 _data = arrayGetNoBoundsChecking((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_exarray), 5))), ((modelica_integer) 1))((((struct mmc_struct*)((void*)((char*)((((*(void**)(((void*)
((void**)(((void*)((char*)(_exarray) - 3))) + (5)))))))) - 3)
))->data)[(((modelica_integer) 1))-1])
;
221 // _newData has no default value.
222#line 272 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
223 _exarray = omc_ExpandableArray_compress(threadData, _exarray);
224#line 224 OMC_FILE"/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/boot/build/tmp/ExpandableArray.c"
225
226#line 273 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
227 arrayUpdateNoBoundsChecking((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_exarray), 4))), ((modelica_integer) 1), mmc_mk_integer(_numberOfElements))boxptr_arrayUpdateNoBoundsChecking(threadData,((*(void**)(((void
*)((void**)(((void*)((char*)(_exarray) - 3))) + (4)))))),mmc_mk_icon
(((modelica_integer) 1)),mmc_mk_icon(_numberOfElements))
;
228#line 228 OMC_FILE"/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/boot/build/tmp/ExpandableArray.c"
229
230#line 274 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
231 _newData = arrayCreateNoInit(_numberOfElements, arrayGetNoBoundsChecking(_data, ((modelica_integer) 1))((((struct mmc_struct*)((void*)((char*)((_data)) - 3)))->data
)[(((modelica_integer) 1))-1])
);
232#line 232 OMC_FILE"/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/boot/build/tmp/ExpandableArray.c"
233
234#line 275 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
235 tmp1 = ((modelica_integer) 1); tmp2 = 1; tmp3 = _numberOfElements;
236#line 275 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
237 if(!(((tmp2 > 0) && (tmp1 > tmp3)) || ((tmp2 < 0) && (tmp1 < tmp3))))
238#line 275 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
239 {
240#line 275 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
241 modelica_integer _i;
242#line 275 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
243 for(_i = ((modelica_integer) 1); in_range_integer(_i, tmp1, tmp3); _i += tmp2)
244#line 275 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
245 {
246#line 276 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
247 arrayUpdateNoBoundsChecking(_newData, _i, arrayGetNoBoundsChecking(_data, _i))boxptr_arrayUpdateNoBoundsChecking(threadData,_newData,mmc_mk_icon
(_i),((((struct mmc_struct*)((void*)((char*)((_data)) - 3)))->
data)[(_i)-1]))
;
248#line 248 OMC_FILE"/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/boot/build/tmp/ExpandableArray.c"
249 }
250 }
251
252#line 278 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
253 arrayUpdateNoBoundsChecking((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_exarray), 5))), ((modelica_integer) 1), _newData)boxptr_arrayUpdateNoBoundsChecking(threadData,((*(void**)(((void
*)((void**)(((void*)((char*)(_exarray) - 3))) + (5)))))),mmc_mk_icon
(((modelica_integer) 1)),_newData)
;
254#line 254 OMC_FILE"/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/boot/build/tmp/ExpandableArray.c"
255 _return: OMC_LABEL_UNUSED__attribute__((unused))
256 return _exarray;
257}
258
259DLLExport
260modelica_metatype omc_ExpandableArray_compress(threadData_t *threadData, modelica_metatype _D_24in_exarray)
261{
262 modelica_metatype _exarray = NULL((void*)0);
263 modelica_integer _numberOfElements;
264 modelica_integer _lastUsedIndex;
265 modelica_metatype _data = NULL((void*)0);
266 modelica_integer _i;
267 MMC_SO()mmc_check_stackoverflow(threadData);
268 _tailrecursive: OMC_LABEL_UNUSED__attribute__((unused))
269 _exarray = _D_24in_exarray;
270 _numberOfElements = mmc_unbox_integer(arrayGetNoBoundsChecking((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_exarray), 2))), ((modelica_integer) 1)))(((mmc_sint_t) (((((struct mmc_struct*)((void*)((char*)((((*(
void**)(((void*)((void**)(((void*)((char*)(_exarray) - 3))) +
(2)))))))) - 3)))->data)[(((modelica_integer) 1))-1]))) >>
1)
;
271 _lastUsedIndex = mmc_unbox_integer(arrayGetNoBoundsChecking((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_exarray), 3))), ((modelica_integer) 1)))(((mmc_sint_t) (((((struct mmc_struct*)((void*)((char*)((((*(
void**)(((void*)((void**)(((void*)((char*)(_exarray) - 3))) +
(3)))))))) - 3)))->data)[(((modelica_integer) 1))-1]))) >>
1)
;
272 _data = arrayGetNoBoundsChecking((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_exarray), 5))), ((modelica_integer) 1))((((struct mmc_struct*)((void*)((char*)((((*(void**)(((void*)
((void**)(((void*)((char*)(_exarray) - 3))) + (5)))))))) - 3)
))->data)[(((modelica_integer) 1))-1])
;
273 _i = ((modelica_integer) 0);
274#line 248 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
275 while(1)
276#line 248 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
277 {
278#line 248 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
279 if(!(_lastUsedIndex > _numberOfElements)) break;
280#line 249 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
281 _i = ((modelica_integer) 1) + _i;
282#line 282 OMC_FILE"/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/boot/build/tmp/ExpandableArray.c"
283
284#line 250 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
285 if(isNone(arrayGetNoBoundsChecking(_data, _i))(0==((((((*(mmc_uint_t*)((void*)((char*)(((((struct mmc_struct
*)((void*)((char*)((_data)) - 3)))->data)[(_i)-1])) - 3)))
) & (7)) == 5)) ? ((((*(mmc_uint_t*)((void*)((char*)(((((
struct mmc_struct*)((void*)((char*)((_data)) - 3)))->data)
[(_i)-1])) - 3)))) >> (3+3))) : (((*(mmc_uint_t*)((void
*)((char*)(((((struct mmc_struct*)((void*)((char*)((_data)) -
3)))->data)[(_i)-1])) - 3)))) >> 10)) ? 1 : 0)
)
286#line 250 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
287 {
288#line 251 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
289 arrayUpdateNoBoundsChecking(_data, _i, arrayGetNoBoundsChecking(_data, _lastUsedIndex))boxptr_arrayUpdateNoBoundsChecking(threadData,_data,mmc_mk_icon
(_i),((((struct mmc_struct*)((void*)((char*)((_data)) - 3)))->
data)[(_lastUsedIndex)-1]))
;
290#line 290 OMC_FILE"/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/boot/build/tmp/ExpandableArray.c"
291
292#line 252 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
293 arrayUpdateNoBoundsChecking(_data, _lastUsedIndex, mmc_mk_none())boxptr_arrayUpdateNoBoundsChecking(threadData,_data,mmc_mk_icon
(_lastUsedIndex),((void*)((char*)(&(mmc_none).header) + 3
)))
;
294#line 294 OMC_FILE"/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/boot/build/tmp/ExpandableArray.c"
295
296#line 253 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
297 _lastUsedIndex = ((modelica_integer) -1) + _lastUsedIndex;
298#line 298 OMC_FILE"/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/boot/build/tmp/ExpandableArray.c"
299
300#line 254 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
301 while(1)
302#line 254 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
303 {
304#line 254 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
305 if(!isNone(arrayGetNoBoundsChecking(_data, _lastUsedIndex))(0==((((((*(mmc_uint_t*)((void*)((char*)(((((struct mmc_struct
*)((void*)((char*)((_data)) - 3)))->data)[(_lastUsedIndex)
-1])) - 3)))) & (7)) == 5)) ? ((((*(mmc_uint_t*)((void*)(
(char*)(((((struct mmc_struct*)((void*)((char*)((_data)) - 3)
))->data)[(_lastUsedIndex)-1])) - 3)))) >> (3+3))) :
(((*(mmc_uint_t*)((void*)((char*)(((((struct mmc_struct*)((void
*)((char*)((_data)) - 3)))->data)[(_lastUsedIndex)-1])) - 3
)))) >> 10)) ? 1 : 0)
) break;
306#line 255 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
307 _lastUsedIndex = ((modelica_integer) -1) + _lastUsedIndex;
308#line 308 OMC_FILE"/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/boot/build/tmp/ExpandableArray.c"
309 }
310 }
311 }
312
313#line 260 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
314 arrayUpdateNoBoundsChecking((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_exarray), 3))), ((modelica_integer) 1), mmc_mk_integer(_lastUsedIndex))boxptr_arrayUpdateNoBoundsChecking(threadData,((*(void**)(((void
*)((void**)(((void*)((char*)(_exarray) - 3))) + (3)))))),mmc_mk_icon
(((modelica_integer) 1)),mmc_mk_icon(_lastUsedIndex))
;
315#line 315 OMC_FILE"/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/boot/build/tmp/ExpandableArray.c"
316 _return: OMC_LABEL_UNUSED__attribute__((unused))
317 return _exarray;
318}
319
320DLLExport
321modelica_metatype omc_ExpandableArray_toList(threadData_t *threadData, modelica_metatype _exarray)
322{
323 modelica_metatype _listT = NULL((void*)0);
324 modelica_integer _numberOfElements;
325 modelica_integer _capacity;
326 modelica_metatype _data = NULL((void*)0);
327 modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
328 MMC_SO()mmc_check_stackoverflow(threadData);
329 _tailrecursive: OMC_LABEL_UNUSED__attribute__((unused))
330 // _listT has no default value.
331 _numberOfElements = mmc_unbox_integer(arrayGetNoBoundsChecking((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_exarray), 2))), ((modelica_integer) 1)))(((mmc_sint_t) (((((struct mmc_struct*)((void*)((char*)((((*(
void**)(((void*)((void**)(((void*)((char*)(_exarray) - 3))) +
(2)))))))) - 3)))->data)[(((modelica_integer) 1))-1]))) >>
1)
;
332 _capacity = mmc_unbox_integer(arrayGetNoBoundsChecking((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_exarray), 4))), ((modelica_integer) 1)))(((mmc_sint_t) (((((struct mmc_struct*)((void*)((char*)((((*(
void**)(((void*)((void**)(((void*)((char*)(_exarray) - 3))) +
(4)))))))) - 3)))->data)[(((modelica_integer) 1))-1]))) >>
1)
;
333 _data = arrayGetNoBoundsChecking((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_exarray), 5))), ((modelica_integer) 1))((((struct mmc_struct*)((void*)((char*)((((*(void**)(((void*)
((void**)(((void*)((char*)(_exarray) - 3))) + (5)))))))) - 3)
))->data)[(((modelica_integer) 1))-1])
;
334#line 229 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
335 if((_numberOfElements == ((modelica_integer) 0)))
336#line 229 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
337 {
338#line 230 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
339 tmpMeta[0] = MMC_REFSTRUCTLIT(mmc_nil)((void*)((char*)(&(mmc_nil).header) + 3));
340#line 230 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
341 _listT = tmpMeta[0];
342#line 342 OMC_FILE"/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/boot/build/tmp/ExpandableArray.c"
343 }
344 else
345 {
346 if((_capacity == ((modelica_integer) 1)))
347 {
348#line 232 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
349 tmpMeta[0] = mmc_mk_cons(omc_Util_getOption(threadData, arrayGet(_data,((modelica_integer) 1))nobox_arrayGet(threadData,_data,((modelica_integer) 1)) /* DAE.ASUB */), MMC_REFSTRUCTLIT(mmc_nil)((void*)((char*)(&(mmc_nil).header) + 3)));
350#line 232 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
351 _listT = tmpMeta[0];
352#line 352 OMC_FILE"/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/boot/build/tmp/ExpandableArray.c"
353 }
354 else
355 {
356#line 234 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
357 {
358#line 234 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
359 modelica_metatype _D_24tmpVar1;
360#line 234 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
361 modelica_metatype* tmp1;
362#line 234 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
363 modelica_metatype _D_24tmpVar0;
364#line 234 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
365 int tmp2;
366#line 234 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
367 modelica_integer tmp3;
368#line 234 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
369 modelica_integer tmp4;
370#line 234 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
371 modelica_integer _i;
372#line 234 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
373 tmp3 = 1 /* Range step-value */;
374#line 234 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
375 tmp4 = _capacity /* Range stop-value */;
376#line 234 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
377 _i = ((modelica_integer) 1) /* Range start-value */;
Value stored to '_i' is never read
378#line 234 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
379 _i = (((modelica_integer) 1) /* Range start-value */)-tmp3;
380#line 234 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
381 tmpMeta[1] = MMC_REFSTRUCTLIT(mmc_nil)((void*)((char*)(&(mmc_nil).header) + 3));
382#line 234 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
383 _D_24tmpVar1 = tmpMeta[1]; /* defaultValue */
384#line 234 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
385 tmp1 = &_D_24tmpVar1;
386#line 234 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
387 while(1) {
388#line 234 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
389 tmp2 = 1;
390#line 234 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
391 while (tmp3 > 0 ? _i+tmp3 <= tmp4 : _i+tmp3 >= tmp4) {
392#line 234 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
393 _i += tmp3;
394#line 234 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
395 if (isSome(arrayGet(_data,_i) /* DAE.ASUB */)(0==((((((*(mmc_uint_t*)((void*)((char*)(nobox_arrayGet(threadData
,_data,_i)) - 3)))) & (7)) == 5)) ? ((((*(mmc_uint_t*)((void
*)((char*)(nobox_arrayGet(threadData,_data,_i)) - 3)))) >>
(3+3))) : (((*(mmc_uint_t*)((void*)((char*)(nobox_arrayGet(threadData
,_data,_i)) - 3)))) >> 10)) ? 0 : 1)
) {
396#line 234 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
397 tmp2--;
398#line 234 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
399 break;
400#line 234 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
401 }
402#line 234 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
403 }
404#line 234 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
405 if (tmp2 == 0) {
406#line 234 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
407 _D_24tmpVar0 = omc_Util_getOption(threadData, arrayGet(_data,_i)nobox_arrayGet(threadData,_data,_i) /* DAE.ASUB */);
408#line 234 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
409 *tmp1 = mmc_mk_cons(_D_24tmpVar0,0);
410#line 234 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
411 tmp1 = &MMC_CDR(*tmp1)(*(void**)(((void*)((void**)(((void*)((char*)(*tmp1) - 3))) +
(2)))))
;
412#line 234 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
413 } else if (tmp2 == 1) {
414#line 234 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
415 break;
416#line 234 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
417 } else {
418#line 234 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
419 MMC_THROW_INTERNAL(){longjmp(*threadData->mmc_jumper,1);};
420#line 234 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
421 }
422#line 234 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
423 }
424#line 234 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
425 *tmp1 = mmc_mk_nil()((void*)((char*)(&(mmc_nil).header) + 3));
426#line 234 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
427 tmpMeta[0] = _D_24tmpVar1;
428#line 234 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
429 }
430#line 234 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
431 _listT = tmpMeta[0];
432#line 432 OMC_FILE"/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/boot/build/tmp/ExpandableArray.c"
433 }
434 }
435 _return: OMC_LABEL_UNUSED__attribute__((unused))
436 return _listT;
437}
438
439DLLExport
440modelica_metatype omc_ExpandableArray_update(threadData_t *threadData, modelica_integer _index, modelica_metatype _value, modelica_metatype _D_24in_exarray)
441{
442 modelica_metatype _exarray = NULL((void*)0);
443 modelica_integer _lastUsedIndex;
444 modelica_metatype _data = NULL((void*)0);
445 MMC_SO()mmc_check_stackoverflow(threadData);
446 _tailrecursive: OMC_LABEL_UNUSED__attribute__((unused))
447 _exarray = _D_24in_exarray;
448 _lastUsedIndex = mmc_unbox_integer(arrayGetNoBoundsChecking((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_exarray), 3))), ((modelica_integer) 1)))(((mmc_sint_t) (((((struct mmc_struct*)((void*)((char*)((((*(
void**)(((void*)((void**)(((void*)((char*)(_exarray) - 3))) +
(3)))))))) - 3)))->data)[(((modelica_integer) 1))-1]))) >>
1)
;
449 _data = arrayGetNoBoundsChecking((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_exarray), 5))), ((modelica_integer) 1))((((struct mmc_struct*)((void*)((char*)((((*(void**)(((void*)
((void**)(((void*)((char*)(_exarray) - 3))) + (5)))))))) - 3)
))->data)[(((modelica_integer) 1))-1])
;
450#line 214 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
451 if((((_index >= ((modelica_integer) 1)) && (_index <= _lastUsedIndex)) && isSome(arrayGetNoBoundsChecking(_data, _index))(0==((((((*(mmc_uint_t*)((void*)((char*)(((((struct mmc_struct
*)((void*)((char*)((_data)) - 3)))->data)[(_index)-1])) - 3
)))) & (7)) == 5)) ? ((((*(mmc_uint_t*)((void*)((char*)((
(((struct mmc_struct*)((void*)((char*)((_data)) - 3)))->data
)[(_index)-1])) - 3)))) >> (3+3))) : (((*(mmc_uint_t*)(
(void*)((char*)(((((struct mmc_struct*)((void*)((char*)((_data
)) - 3)))->data)[(_index)-1])) - 3)))) >> 10)) ? 0 :
1)
))
452#line 214 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
453 {
454#line 215 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
455 arrayUpdate(_data, _index, mmc_mk_some(_value))boxptr_arrayUpdate(threadData,_data,mmc_mk_icon(_index),mmc_mk_some
(_value))
;
456#line 456 OMC_FILE"/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/boot/build/tmp/ExpandableArray.c"
457 }
458 else
459 {
460#line 217 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
461 MMC_THROW_INTERNAL(){longjmp(*threadData->mmc_jumper,1);};
462#line 462 OMC_FILE"/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/boot/build/tmp/ExpandableArray.c"
463 }
464 _return: OMC_LABEL_UNUSED__attribute__((unused))
465 return _exarray;
466}
467modelica_metatype boxptr_ExpandableArray_update(threadData_t *threadData, modelica_metatype _index, modelica_metatype _value, modelica_metatype _D_24in_exarray)
468{
469 modelica_integer tmp1;
470 modelica_metatype _exarray = NULL((void*)0);
471 tmp1 = mmc_unbox_integer(_index)(((mmc_sint_t) (_index)) >> 1);
472 _exarray = omc_ExpandableArray_update(threadData, tmp1, _value, _D_24in_exarray);
473 /* skip box _exarray; ExpandableArray<polymorphic<T>> */
474 return _exarray;
475}
476
477DLLExport
478modelica_metatype omc_ExpandableArray_delete(threadData_t *threadData, modelica_integer _index, modelica_metatype _D_24in_exarray)
479{
480 modelica_metatype _exarray = NULL((void*)0);
481 modelica_integer _numberOfElements;
482 modelica_integer _lastUsedIndex;
483 modelica_metatype _data = NULL((void*)0);
484 MMC_SO()mmc_check_stackoverflow(threadData);
485 _tailrecursive: OMC_LABEL_UNUSED__attribute__((unused))
486 _exarray = _D_24in_exarray;
487 _numberOfElements = mmc_unbox_integer(arrayGetNoBoundsChecking((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_exarray), 2))), ((modelica_integer) 1)))(((mmc_sint_t) (((((struct mmc_struct*)((void*)((char*)((((*(
void**)(((void*)((void**)(((void*)((char*)(_exarray) - 3))) +
(2)))))))) - 3)))->data)[(((modelica_integer) 1))-1]))) >>
1)
;
488 _lastUsedIndex = mmc_unbox_integer(arrayGetNoBoundsChecking((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_exarray), 3))), ((modelica_integer) 1)))(((mmc_sint_t) (((((struct mmc_struct*)((void*)((char*)((((*(
void**)(((void*)((void**)(((void*)((char*)(_exarray) - 3))) +
(3)))))))) - 3)))->data)[(((modelica_integer) 1))-1]))) >>
1)
;
489 _data = arrayGetNoBoundsChecking((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_exarray), 5))), ((modelica_integer) 1))((((struct mmc_struct*)((void*)((char*)((((*(void**)(((void*)
((void**)(((void*)((char*)(_exarray) - 3))) + (5)))))))) - 3)
))->data)[(((modelica_integer) 1))-1])
;
490#line 188 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
491 if((((_index >= ((modelica_integer) 1)) && (_index <= _lastUsedIndex)) && isSome(arrayGetNoBoundsChecking(_data, _index))(0==((((((*(mmc_uint_t*)((void*)((char*)(((((struct mmc_struct
*)((void*)((char*)((_data)) - 3)))->data)[(_index)-1])) - 3
)))) & (7)) == 5)) ? ((((*(mmc_uint_t*)((void*)((char*)((
(((struct mmc_struct*)((void*)((char*)((_data)) - 3)))->data
)[(_index)-1])) - 3)))) >> (3+3))) : (((*(mmc_uint_t*)(
(void*)((char*)(((((struct mmc_struct*)((void*)((char*)((_data
)) - 3)))->data)[(_index)-1])) - 3)))) >> 10)) ? 0 :
1)
))
492#line 188 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
493 {
494#line 189 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
495 arrayUpdate(_data, _index, mmc_mk_none())boxptr_arrayUpdate(threadData,_data,mmc_mk_icon(_index),((void
*)((char*)(&(mmc_none).header) + 3)))
;
496#line 496 OMC_FILE"/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/boot/build/tmp/ExpandableArray.c"
497
498#line 190 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
499 arrayUpdateNoBoundsChecking((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_exarray), 2))), ((modelica_integer) 1), mmc_mk_integer(((modelica_integer) -1) + _numberOfElements))boxptr_arrayUpdateNoBoundsChecking(threadData,((*(void**)(((void
*)((void**)(((void*)((char*)(_exarray) - 3))) + (2)))))),mmc_mk_icon
(((modelica_integer) 1)),mmc_mk_icon(((modelica_integer) -1) +
_numberOfElements))
;
500#line 500 OMC_FILE"/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/boot/build/tmp/ExpandableArray.c"
501
502#line 192 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
503 if((_index == _lastUsedIndex))
504#line 192 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
505 {
506#line 193 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
507 _lastUsedIndex = ((modelica_integer) -1) + _lastUsedIndex;
508#line 508 OMC_FILE"/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/boot/build/tmp/ExpandableArray.c"
509
510#line 194 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
511 while(1)
512#line 194 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
513 {
514#line 194 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
515 if(!((_lastUsedIndex > ((modelica_integer) 0)) && isNone(arrayGetNoBoundsChecking(_data, _lastUsedIndex))(0==((((((*(mmc_uint_t*)((void*)((char*)(((((struct mmc_struct
*)((void*)((char*)((_data)) - 3)))->data)[(_lastUsedIndex)
-1])) - 3)))) & (7)) == 5)) ? ((((*(mmc_uint_t*)((void*)(
(char*)(((((struct mmc_struct*)((void*)((char*)((_data)) - 3)
))->data)[(_lastUsedIndex)-1])) - 3)))) >> (3+3))) :
(((*(mmc_uint_t*)((void*)((char*)(((((struct mmc_struct*)((void
*)((char*)((_data)) - 3)))->data)[(_lastUsedIndex)-1])) - 3
)))) >> 10)) ? 1 : 0)
)) break;
516#line 195 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
517 _lastUsedIndex = ((modelica_integer) -1) + _lastUsedIndex;
518#line 518 OMC_FILE"/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/boot/build/tmp/ExpandableArray.c"
519 }
520
521#line 197 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
522 arrayUpdateNoBoundsChecking((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_exarray), 3))), ((modelica_integer) 1), mmc_mk_integer(_lastUsedIndex))boxptr_arrayUpdateNoBoundsChecking(threadData,((*(void**)(((void
*)((void**)(((void*)((char*)(_exarray) - 3))) + (3)))))),mmc_mk_icon
(((modelica_integer) 1)),mmc_mk_icon(_lastUsedIndex))
;
523#line 523 OMC_FILE"/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/boot/build/tmp/ExpandableArray.c"
524 }
525 }
526 else
527 {
528#line 200 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
529 MMC_THROW_INTERNAL(){longjmp(*threadData->mmc_jumper,1);};
530#line 530 OMC_FILE"/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/boot/build/tmp/ExpandableArray.c"
531 }
532 _return: OMC_LABEL_UNUSED__attribute__((unused))
533 return _exarray;
534}
535modelica_metatype boxptr_ExpandableArray_delete(threadData_t *threadData, modelica_metatype _index, modelica_metatype _D_24in_exarray)
536{
537 modelica_integer tmp1;
538 modelica_metatype _exarray = NULL((void*)0);
539 tmp1 = mmc_unbox_integer(_index)(((mmc_sint_t) (_index)) >> 1);
540 _exarray = omc_ExpandableArray_delete(threadData, tmp1, _D_24in_exarray);
541 /* skip box _exarray; ExpandableArray<polymorphic<T>> */
542 return _exarray;
543}
544
545DLLExport
546modelica_metatype omc_ExpandableArray_add(threadData_t *threadData, modelica_metatype _value, modelica_metatype _D_24in_exarray, modelica_integer *out_index)
547{
548 modelica_metatype _exarray = NULL((void*)0);
549 modelica_integer _index;
550 modelica_integer _lastUsedIndex;
551 MMC_SO()mmc_check_stackoverflow(threadData);
552 _tailrecursive: OMC_LABEL_UNUSED__attribute__((unused))
553 _exarray = _D_24in_exarray;
554 // _index has no default value.
555 _lastUsedIndex = mmc_unbox_integer(arrayGetNoBoundsChecking((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_exarray), 3))), ((modelica_integer) 1)))(((mmc_sint_t) (((((struct mmc_struct*)((void*)((char*)((((*(
void**)(((void*)((void**)(((void*)((char*)(_exarray) - 3))) +
(3)))))))) - 3)))->data)[(((modelica_integer) 1))-1]))) >>
1)
;
556#line 174 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
557 _index = ((modelica_integer) 1) + _lastUsedIndex;
558#line 558 OMC_FILE"/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/boot/build/tmp/ExpandableArray.c"
559
560#line 175 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
561 _exarray = omc_ExpandableArray_set(threadData, _index, _value, _exarray);
562#line 562 OMC_FILE"/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/boot/build/tmp/ExpandableArray.c"
563 _return: OMC_LABEL_UNUSED__attribute__((unused))
564 if (out_index) { *out_index = _index; }
565 return _exarray;
566}
567modelica_metatype boxptr_ExpandableArray_add(threadData_t *threadData, modelica_metatype _value, modelica_metatype _D_24in_exarray, modelica_metatype *out_index)
568{
569 modelica_integer _index;
570 modelica_metatype _exarray = NULL((void*)0);
571 _exarray = omc_ExpandableArray_add(threadData, _value, _D_24in_exarray, &_index);
572 /* skip box _exarray; ExpandableArray<polymorphic<T>> */
573 if (out_index) { *out_index = mmc_mk_icon(_index); }
574 return _exarray;
575}
576
577DLLExport
578modelica_metatype omc_ExpandableArray_set(threadData_t *threadData, modelica_integer _index, modelica_metatype _value, modelica_metatype _D_24in_exarray)
579{
580 modelica_metatype _exarray = NULL((void*)0);
581 modelica_integer _numberOfElements;
582 modelica_integer _lastUsedIndex;
583 modelica_integer _capacity;
584 modelica_metatype _data = NULL((void*)0);
585 MMC_SO()mmc_check_stackoverflow(threadData);
586 _tailrecursive: OMC_LABEL_UNUSED__attribute__((unused))
587 _exarray = _D_24in_exarray;
588 _numberOfElements = mmc_unbox_integer(arrayGetNoBoundsChecking((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_exarray), 2))), ((modelica_integer) 1)))(((mmc_sint_t) (((((struct mmc_struct*)((void*)((char*)((((*(
void**)(((void*)((void**)(((void*)((char*)(_exarray) - 3))) +
(2)))))))) - 3)))->data)[(((modelica_integer) 1))-1]))) >>
1)
;
589 _lastUsedIndex = mmc_unbox_integer(arrayGetNoBoundsChecking((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_exarray), 3))), ((modelica_integer) 1)))(((mmc_sint_t) (((((struct mmc_struct*)((void*)((char*)((((*(
void**)(((void*)((void**)(((void*)((char*)(_exarray) - 3))) +
(3)))))))) - 3)))->data)[(((modelica_integer) 1))-1]))) >>
1)
;
590 _capacity = mmc_unbox_integer(arrayGetNoBoundsChecking((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_exarray), 4))), ((modelica_integer) 1)))(((mmc_sint_t) (((((struct mmc_struct*)((void*)((char*)((((*(
void**)(((void*)((void**)(((void*)((char*)(_exarray) - 3))) +
(4)))))))) - 3)))->data)[(((modelica_integer) 1))-1]))) >>
1)
;
591 _data = arrayGetNoBoundsChecking((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_exarray), 5))), ((modelica_integer) 1))((((struct mmc_struct*)((void*)((char*)((((*(void**)(((void*)
((void**)(((void*)((char*)(_exarray) - 3))) + (5)))))))) - 3)
))->data)[(((modelica_integer) 1))-1])
;
592#line 150 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
593 if(((_index > ((modelica_integer) 0)) && ((_index > _capacity) || isNone(arrayGetNoBoundsChecking(_data, _index))(0==((((((*(mmc_uint_t*)((void*)((char*)(((((struct mmc_struct
*)((void*)((char*)((_data)) - 3)))->data)[(_index)-1])) - 3
)))) & (7)) == 5)) ? ((((*(mmc_uint_t*)((void*)((char*)((
(((struct mmc_struct*)((void*)((char*)((_data)) - 3)))->data
)[(_index)-1])) - 3)))) >> (3+3))) : (((*(mmc_uint_t*)(
(void*)((char*)(((((struct mmc_struct*)((void*)((char*)((_data
)) - 3)))->data)[(_index)-1])) - 3)))) >> 10)) ? 1 :
0)
)))
594#line 150 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
595 {
596#line 151 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
597 if((_index > _capacity))
598#line 151 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
599 {
600#line 152 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
601 omc_ExpandableArray_expandToSize(threadData, _index, _exarray);
602#line 602 OMC_FILE"/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/boot/build/tmp/ExpandableArray.c"
603
604#line 153 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
605 _data = arrayGetNoBoundsChecking((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_exarray), 5))), ((modelica_integer) 1))((((struct mmc_struct*)((void*)((char*)((((*(void**)(((void*)
((void**)(((void*)((char*)(_exarray) - 3))) + (5)))))))) - 3)
))->data)[(((modelica_integer) 1))-1])
;
606#line 606 OMC_FILE"/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/boot/build/tmp/ExpandableArray.c"
607 }
608
609#line 156 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
610 arrayUpdate(_data, _index, mmc_mk_some(_value))boxptr_arrayUpdate(threadData,_data,mmc_mk_icon(_index),mmc_mk_some
(_value))
;
611#line 611 OMC_FILE"/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/boot/build/tmp/ExpandableArray.c"
612
613#line 157 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
614 arrayUpdateNoBoundsChecking((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_exarray), 2))), ((modelica_integer) 1), mmc_mk_integer(((modelica_integer) 1) + _numberOfElements))boxptr_arrayUpdateNoBoundsChecking(threadData,((*(void**)(((void
*)((void**)(((void*)((char*)(_exarray) - 3))) + (2)))))),mmc_mk_icon
(((modelica_integer) 1)),mmc_mk_icon(((modelica_integer) 1) +
_numberOfElements))
;
615#line 615 OMC_FILE"/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/boot/build/tmp/ExpandableArray.c"
616
617#line 158 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
618 if((_index > _lastUsedIndex))
619#line 158 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
620 {
621#line 159 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
622 arrayUpdateNoBoundsChecking((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_exarray), 3))), ((modelica_integer) 1), mmc_mk_integer(_index))boxptr_arrayUpdateNoBoundsChecking(threadData,((*(void**)(((void
*)((void**)(((void*)((char*)(_exarray) - 3))) + (3)))))),mmc_mk_icon
(((modelica_integer) 1)),mmc_mk_icon(_index))
;
623#line 623 OMC_FILE"/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/boot/build/tmp/ExpandableArray.c"
624 }
625 }
626 else
627 {
628#line 162 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
629 MMC_THROW_INTERNAL(){longjmp(*threadData->mmc_jumper,1);};
630#line 630 OMC_FILE"/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/boot/build/tmp/ExpandableArray.c"
631 }
632 _return: OMC_LABEL_UNUSED__attribute__((unused))
633 return _exarray;
634}
635modelica_metatype boxptr_ExpandableArray_set(threadData_t *threadData, modelica_metatype _index, modelica_metatype _value, modelica_metatype _D_24in_exarray)
636{
637 modelica_integer tmp1;
638 modelica_metatype _exarray = NULL((void*)0);
639 tmp1 = mmc_unbox_integer(_index)(((mmc_sint_t) (_index)) >> 1);
640 _exarray = omc_ExpandableArray_set(threadData, tmp1, _value, _D_24in_exarray);
641 /* skip box _exarray; ExpandableArray<polymorphic<T>> */
642 return _exarray;
643}
644
645DLLExport
646modelica_metatype omc_ExpandableArray_expandToSize(threadData_t *threadData, modelica_integer _minCapacity, modelica_metatype _D_24in_exarray)
647{
648 modelica_metatype _exarray = NULL((void*)0);
649 modelica_integer _capacity;
650 modelica_metatype _data = NULL((void*)0);
651 MMC_SO()mmc_check_stackoverflow(threadData);
652 _tailrecursive: OMC_LABEL_UNUSED__attribute__((unused))
653 _exarray = _D_24in_exarray;
654 _capacity = mmc_unbox_integer(arrayGetNoBoundsChecking((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_exarray), 4))), ((modelica_integer) 1)))(((mmc_sint_t) (((((struct mmc_struct*)((void*)((char*)((((*(
void**)(((void*)((void**)(((void*)((char*)(_exarray) - 3))) +
(4)))))))) - 3)))->data)[(((modelica_integer) 1))-1]))) >>
1)
;
655 _data = arrayGetNoBoundsChecking((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_exarray), 5))), ((modelica_integer) 1))((((struct mmc_struct*)((void*)((char*)((((*(void**)(((void*)
((void**)(((void*)((char*)(_exarray) - 3))) + (5)))))))) - 3)
))->data)[(((modelica_integer) 1))-1])
;
656#line 131 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
657 if((_minCapacity > _capacity))
658#line 131 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
659 {
660#line 132 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
661 arrayUpdateNoBoundsChecking((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_exarray), 4))), ((modelica_integer) 1), mmc_mk_integer(_minCapacity))boxptr_arrayUpdateNoBoundsChecking(threadData,((*(void**)(((void
*)((void**)(((void*)((char*)(_exarray) - 3))) + (4)))))),mmc_mk_icon
(((modelica_integer) 1)),mmc_mk_icon(_minCapacity))
;
662#line 662 OMC_FILE"/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/boot/build/tmp/ExpandableArray.c"
663
664#line 133 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
665 _data = omc_Array_expandToSize(threadData, _minCapacity, _data, mmc_mk_none()((void*)((char*)(&(mmc_none).header) + 3)));
666#line 666 OMC_FILE"/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/boot/build/tmp/ExpandableArray.c"
667
668#line 134 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
669 arrayUpdateNoBoundsChecking((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_exarray), 5))), ((modelica_integer) 1), _data)boxptr_arrayUpdateNoBoundsChecking(threadData,((*(void**)(((void
*)((void**)(((void*)((char*)(_exarray) - 3))) + (5)))))),mmc_mk_icon
(((modelica_integer) 1)),_data)
;
670#line 670 OMC_FILE"/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/boot/build/tmp/ExpandableArray.c"
671 }
672 _return: OMC_LABEL_UNUSED__attribute__((unused))
673 return _exarray;
674}
675modelica_metatype boxptr_ExpandableArray_expandToSize(threadData_t *threadData, modelica_metatype _minCapacity, modelica_metatype _D_24in_exarray)
676{
677 modelica_integer tmp1;
678 modelica_metatype _exarray = NULL((void*)0);
679 tmp1 = mmc_unbox_integer(_minCapacity)(((mmc_sint_t) (_minCapacity)) >> 1);
680 _exarray = omc_ExpandableArray_expandToSize(threadData, tmp1, _D_24in_exarray);
681 /* skip box _exarray; ExpandableArray<polymorphic<T>> */
682 return _exarray;
683}
684
685DLLExport
686modelica_metatype omc_ExpandableArray_get(threadData_t *threadData, modelica_integer _index, modelica_metatype _exarray)
687{
688 modelica_metatype _value = NULL((void*)0);
689 modelica_metatype _data = NULL((void*)0);
690 modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
691 MMC_SO()mmc_check_stackoverflow(threadData);
692 _tailrecursive: OMC_LABEL_UNUSED__attribute__((unused))
693 // _value has no default value.
694 _data = arrayGetNoBoundsChecking((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_exarray), 5))), ((modelica_integer) 1))((((struct mmc_struct*)((void*)((char*)((((*(void**)(((void*)
((void**)(((void*)((char*)(_exarray) - 3))) + (5)))))))) - 3)
))->data)[(((modelica_integer) 1))-1])
;
695#line 115 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
696 if(omc_ExpandableArray_occupied(threadData, _index, _exarray))
697#line 115 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
698 {
699#line 116 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
700 /* Pattern-matching assignment */
701#line 116 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
702 tmpMeta[0] = arrayGetNoBoundsChecking(_data, _index)((((struct mmc_struct*)((void*)((char*)((_data)) - 3)))->data
)[(_index)-1])
;
703#line 116 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
704 if (optionNone(tmpMeta[0])(0==((((((*(mmc_uint_t*)((void*)((char*)(tmpMeta[0]) - 3)))) &
(7)) == 5)) ? ((((*(mmc_uint_t*)((void*)((char*)(tmpMeta[0])
- 3)))) >> (3+3))) : (((*(mmc_uint_t*)((void*)((char*)
(tmpMeta[0]) - 3)))) >> 10)) ? 1 : 0)
) MMC_THROW_INTERNAL(){longjmp(*threadData->mmc_jumper,1);};
705#line 116 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
706 tmpMeta[1] = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta[0]), 1))(*(void**)(((void*)((void**)(((void*)((char*)(tmpMeta[0]) - 3
))) + (1)))))
;
707#line 116 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
708 _value = tmpMeta[1];
709#line 709 OMC_FILE"/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/boot/build/tmp/ExpandableArray.c"
710 }
711 else
712 {
713#line 118 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
714 MMC_THROW_INTERNAL(){longjmp(*threadData->mmc_jumper,1);};
715#line 715 OMC_FILE"/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/boot/build/tmp/ExpandableArray.c"
716 }
717 _return: OMC_LABEL_UNUSED__attribute__((unused))
718 return _value;
719}
720modelica_metatype boxptr_ExpandableArray_get(threadData_t *threadData, modelica_metatype _index, modelica_metatype _exarray)
721{
722 modelica_integer tmp1;
723 modelica_metatype _value = NULL((void*)0);
724 tmp1 = mmc_unbox_integer(_index)(((mmc_sint_t) (_index)) >> 1);
725 _value = omc_ExpandableArray_get(threadData, tmp1, _exarray);
726 /* skip box _value; polymorphic<T> */
727 return _value;
728}
729
730DLLExport
731modelica_boolean omc_ExpandableArray_occupied(threadData_t *threadData, modelica_integer _index, modelica_metatype _exarray)
732{
733 modelica_boolean _b;
734 modelica_integer _lastUsedIndex;
735 modelica_metatype _data = NULL((void*)0);
736 MMC_SO()mmc_check_stackoverflow(threadData);
737 _tailrecursive: OMC_LABEL_UNUSED__attribute__((unused))
738 // _b has no default value.
739 _lastUsedIndex = mmc_unbox_integer(arrayGetNoBoundsChecking((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_exarray), 3))), ((modelica_integer) 1)))(((mmc_sint_t) (((((struct mmc_struct*)((void*)((char*)((((*(
void**)(((void*)((void**)(((void*)((char*)(_exarray) - 3))) +
(3)))))))) - 3)))->data)[(((modelica_integer) 1))-1]))) >>
1)
;
740 _data = arrayGetNoBoundsChecking((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_exarray), 5))), ((modelica_integer) 1))((((struct mmc_struct*)((void*)((char*)((((*(void**)(((void*)
((void**)(((void*)((char*)(_exarray) - 3))) + (5)))))))) - 3)
))->data)[(((modelica_integer) 1))-1])
;
741#line 103 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
742 _b = (((_index >= ((modelica_integer) 1)) && (_index <= _lastUsedIndex)) && isSome(arrayGetNoBoundsChecking(_data, _index))(0==((((((*(mmc_uint_t*)((void*)((char*)(((((struct mmc_struct
*)((void*)((char*)((_data)) - 3)))->data)[(_index)-1])) - 3
)))) & (7)) == 5)) ? ((((*(mmc_uint_t*)((void*)((char*)((
(((struct mmc_struct*)((void*)((char*)((_data)) - 3)))->data
)[(_index)-1])) - 3)))) >> (3+3))) : (((*(mmc_uint_t*)(
(void*)((char*)(((((struct mmc_struct*)((void*)((char*)((_data
)) - 3)))->data)[(_index)-1])) - 3)))) >> 10)) ? 0 :
1)
);
743#line 743 OMC_FILE"/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/boot/build/tmp/ExpandableArray.c"
744 _return: OMC_LABEL_UNUSED__attribute__((unused))
745 return _b;
746}
747modelica_metatype boxptr_ExpandableArray_occupied(threadData_t *threadData, modelica_metatype _index, modelica_metatype _exarray)
748{
749 modelica_integer tmp1;
750 modelica_boolean _b;
751 modelica_metatype out_b;
752 tmp1 = mmc_unbox_integer(_index)(((mmc_sint_t) (_index)) >> 1);
753 _b = omc_ExpandableArray_occupied(threadData, tmp1, _exarray);
754 out_b = mmc_mk_icon(_b);
755 return out_b;
756}
757
758DLLExport
759modelica_metatype omc_ExpandableArray_copy(threadData_t *threadData, modelica_metatype _inExarray, modelica_metatype _dummy)
760{
761 modelica_metatype _outExarray = NULL((void*)0);
762 modelica_metatype tmpMeta[1] __attribute__((unused)) = {0};
763 MMC_SO()mmc_check_stackoverflow(threadData);
764 _tailrecursive: OMC_LABEL_UNUSED__attribute__((unused))
765 // _outExarray has no default value.
766#line 87 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
767 _outExarray = omc_ExpandableArray_new(threadData, mmc_unbox_integer(arrayGet((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExarray), 4))),((modelica_integer) 1)) /* DAE.ASUB */)(((mmc_sint_t) (nobox_arrayGet(threadData,((*(void**)(((void*
)((void**)(((void*)((char*)(_inExarray) - 3))) + (4)))))),((modelica_integer
) 1)))) >> 1)
, _dummy);
768#line 768 OMC_FILE"/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/boot/build/tmp/ExpandableArray.c"
769
770#line 88 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
771 tmpMeta[0] = MMC_TAGPTR(mmc_alloc_words(6))((void*)((char*)(mmc_alloc_words(6)) + 3));
772#line 88 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
773 memcpy(MMC_UNTAGPTR(tmpMeta[0])((void*)((char*)(tmpMeta[0]) - 3)), MMC_UNTAGPTR(_outExarray)((void*)((char*)(_outExarray) - 3)), 6*sizeof(modelica_metatype));
774#line 88 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
775 ((modelica_metatype*)MMC_UNTAGPTR(tmpMeta[0])((void*)((char*)(tmpMeta[0]) - 3)))[2] = arrayCopy((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExarray), 2))(*(void**)(((void*)((void**)(((void*)((char*)(_inExarray) - 3
))) + (2)))))
));
776#line 88 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
777 _outExarray = tmpMeta[0];
778#line 778 OMC_FILE"/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/boot/build/tmp/ExpandableArray.c"
779
780#line 89 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
781 tmpMeta[0] = MMC_TAGPTR(mmc_alloc_words(6))((void*)((char*)(mmc_alloc_words(6)) + 3));
782#line 89 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
783 memcpy(MMC_UNTAGPTR(tmpMeta[0])((void*)((char*)(tmpMeta[0]) - 3)), MMC_UNTAGPTR(_outExarray)((void*)((char*)(_outExarray) - 3)), 6*sizeof(modelica_metatype));
784#line 89 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
785 ((modelica_metatype*)MMC_UNTAGPTR(tmpMeta[0])((void*)((char*)(tmpMeta[0]) - 3)))[3] = arrayCopy((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExarray), 3))(*(void**)(((void*)((void**)(((void*)((char*)(_inExarray) - 3
))) + (3)))))
));
786#line 89 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
787 _outExarray = tmpMeta[0];
788#line 788 OMC_FILE"/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/boot/build/tmp/ExpandableArray.c"
789
790#line 90 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
791 tmpMeta[0] = MMC_TAGPTR(mmc_alloc_words(6))((void*)((char*)(mmc_alloc_words(6)) + 3));
792#line 90 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
793 memcpy(MMC_UNTAGPTR(tmpMeta[0])((void*)((char*)(tmpMeta[0]) - 3)), MMC_UNTAGPTR(_outExarray)((void*)((char*)(_outExarray) - 3)), 6*sizeof(modelica_metatype));
794#line 90 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
795 ((modelica_metatype*)MMC_UNTAGPTR(tmpMeta[0])((void*)((char*)(tmpMeta[0]) - 3)))[4] = arrayCopy((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExarray), 4))(*(void**)(((void*)((void**)(((void*)((char*)(_inExarray) - 3
))) + (4)))))
));
796#line 90 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
797 _outExarray = tmpMeta[0];
798#line 798 OMC_FILE"/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/boot/build/tmp/ExpandableArray.c"
799
800#line 91 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
801 tmpMeta[0] = MMC_TAGPTR(mmc_alloc_words(6))((void*)((char*)(mmc_alloc_words(6)) + 3));
802#line 91 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
803 memcpy(MMC_UNTAGPTR(tmpMeta[0])((void*)((char*)(tmpMeta[0]) - 3)), MMC_UNTAGPTR(_outExarray)((void*)((char*)(_outExarray) - 3)), 6*sizeof(modelica_metatype));
804#line 91 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
805 ((modelica_metatype*)MMC_UNTAGPTR(tmpMeta[0])((void*)((char*)(tmpMeta[0]) - 3)))[5] = arrayCreate(((modelica_integer) 1), arrayCopy(arrayGetNoBoundsChecking((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inExarray), 5))), ((modelica_integer) 1))((((struct mmc_struct*)((void*)((char*)((((*(void**)(((void*)
((void**)(((void*)((char*)(_inExarray) - 3))) + (5)))))))) - 3
)))->data)[(((modelica_integer) 1))-1])
));
806#line 91 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
807 _outExarray = tmpMeta[0];
808#line 808 OMC_FILE"/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/boot/build/tmp/ExpandableArray.c"
809 _return: OMC_LABEL_UNUSED__attribute__((unused))
810 return _outExarray;
811}
812
813DLLExport
814modelica_metatype omc_ExpandableArray_clear(threadData_t *threadData, modelica_metatype _D_24in_exarray)
815{
816 modelica_metatype _exarray = NULL((void*)0);
817 modelica_integer _n;
818 modelica_integer _lastUsedIndex;
819 modelica_metatype _data = NULL((void*)0);
820 modelica_integer tmp1;
821 modelica_integer tmp2;
822 modelica_integer tmp3;
823 MMC_SO()mmc_check_stackoverflow(threadData);
824 _tailrecursive: OMC_LABEL_UNUSED__attribute__((unused))
825 _exarray = _D_24in_exarray;
826 _n = mmc_unbox_integer(arrayGetNoBoundsChecking((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_exarray), 2))), ((modelica_integer) 1)))(((mmc_sint_t) (((((struct mmc_struct*)((void*)((char*)((((*(
void**)(((void*)((void**)(((void*)((char*)(_exarray) - 3))) +
(2)))))))) - 3)))->data)[(((modelica_integer) 1))-1]))) >>
1)
;
827 _lastUsedIndex = mmc_unbox_integer(arrayGetNoBoundsChecking((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_exarray), 3))), ((modelica_integer) 1)))(((mmc_sint_t) (((((struct mmc_struct*)((void*)((char*)((((*(
void**)(((void*)((void**)(((void*)((char*)(_exarray) - 3))) +
(3)))))))) - 3)))->data)[(((modelica_integer) 1))-1]))) >>
1)
;
828 _data = arrayGetNoBoundsChecking((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_exarray), 5))), ((modelica_integer) 1))((((struct mmc_struct*)((void*)((char*)((((*(void**)(((void*)
((void**)(((void*)((char*)(_exarray) - 3))) + (5)))))))) - 3)
))->data)[(((modelica_integer) 1))-1])
;
829#line 69 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
830 arrayUpdateNoBoundsChecking((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_exarray), 2))), ((modelica_integer) 1), mmc_mk_integer(((modelica_integer) 0)))boxptr_arrayUpdateNoBoundsChecking(threadData,((*(void**)(((void
*)((void**)(((void*)((char*)(_exarray) - 3))) + (2)))))),mmc_mk_icon
(((modelica_integer) 1)),mmc_mk_icon(((modelica_integer) 0)))
;
831#line 831 OMC_FILE"/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/boot/build/tmp/ExpandableArray.c"
832
833#line 70 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
834 arrayUpdateNoBoundsChecking((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_exarray), 3))), ((modelica_integer) 1), mmc_mk_integer(((modelica_integer) 0)))boxptr_arrayUpdateNoBoundsChecking(threadData,((*(void**)(((void
*)((void**)(((void*)((char*)(_exarray) - 3))) + (3)))))),mmc_mk_icon
(((modelica_integer) 1)),mmc_mk_icon(((modelica_integer) 0)))
;
835#line 835 OMC_FILE"/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/boot/build/tmp/ExpandableArray.c"
836
837#line 71 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
838 tmp1 = ((modelica_integer) 1); tmp2 = 1; tmp3 = _lastUsedIndex;
839#line 71 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
840 if(!(((tmp2 > 0) && (tmp1 > tmp3)) || ((tmp2 < 0) && (tmp1 < tmp3))))
841#line 71 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
842 {
843#line 71 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
844 modelica_integer _i;
845#line 71 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
846 for(_i = ((modelica_integer) 1); in_range_integer(_i, tmp1, tmp3); _i += tmp2)
847#line 71 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
848 {
849#line 72 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
850 if(isSome(arrayGetNoBoundsChecking(_data, _i))(0==((((((*(mmc_uint_t*)((void*)((char*)(((((struct mmc_struct
*)((void*)((char*)((_data)) - 3)))->data)[(_i)-1])) - 3)))
) & (7)) == 5)) ? ((((*(mmc_uint_t*)((void*)((char*)(((((
struct mmc_struct*)((void*)((char*)((_data)) - 3)))->data)
[(_i)-1])) - 3)))) >> (3+3))) : (((*(mmc_uint_t*)((void
*)((char*)(((((struct mmc_struct*)((void*)((char*)((_data)) -
3)))->data)[(_i)-1])) - 3)))) >> 10)) ? 0 : 1)
)
851#line 72 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
852 {
853#line 73 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
854 _n = ((modelica_integer) -1) + _n;
855#line 855 OMC_FILE"/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/boot/build/tmp/ExpandableArray.c"
856
857#line 74 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
858 arrayUpdateNoBoundsChecking(_data, _i, mmc_mk_none())boxptr_arrayUpdateNoBoundsChecking(threadData,_data,mmc_mk_icon
(_i),((void*)((char*)(&(mmc_none).header) + 3)))
;
859#line 859 OMC_FILE"/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/boot/build/tmp/ExpandableArray.c"
860
861#line 75 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
862 if((_n == ((modelica_integer) 0)))
863#line 75 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
864 {
865#line 76 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
866 goto _return;
867#line 867 OMC_FILE"/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/boot/build/tmp/ExpandableArray.c"
868 }
869 }
870 }
871 }
872 _return: OMC_LABEL_UNUSED__attribute__((unused))
873 return _exarray;
874}
875
876DLLExport
877modelica_metatype omc_ExpandableArray_new(threadData_t *threadData, modelica_integer _capacity, modelica_metatype _dummy)
878{
879 modelica_metatype _exarray = NULL((void*)0);
880 modelica_metatype tmpMeta[1] __attribute__((unused)) = {0};
881 MMC_SO()mmc_check_stackoverflow(threadData);
882 _tailrecursive: OMC_LABEL_UNUSED__attribute__((unused))
883 // _exarray has no default value.
884#line 58 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
885 tmpMeta[0] = mmc_mk_box5(3, &ExpandableArray_EXPANDABLE__ARRAY__desc, arrayCreate(((modelica_integer) 1), mmc_mk_integermmc_mk_icon(((modelica_integer) 0))), arrayCreate(((modelica_integer) 1), mmc_mk_integermmc_mk_icon(((modelica_integer) 0))), arrayCreate(((modelica_integer) 1), mmc_mk_integermmc_mk_icon(_capacity)), arrayCreate(((modelica_integer) 1), arrayCreate(_capacity, mmc_mk_none()((void*)((char*)(&(mmc_none).header) + 3)))));
886#line 58 "/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/Util/ExpandableArray.mo"
887 _exarray = tmpMeta[0];
888#line 888 OMC_FILE"/var/lib/jenkins1/ws/iodic_Jenkins.slow_omlib-staging/OMCompiler/Compiler/boot/build/tmp/ExpandableArray.c"
889 _return: OMC_LABEL_UNUSED__attribute__((unused))
890 return _exarray;
891}
892modelica_metatype boxptr_ExpandableArray_new(threadData_t *threadData, modelica_metatype _capacity, modelica_metatype _dummy)
893{
894 modelica_integer tmp1;
895 modelica_metatype _exarray = NULL((void*)0);
896 tmp1 = mmc_unbox_integer(_capacity)(((mmc_sint_t) (_capacity)) >> 1);
897 _exarray = omc_ExpandableArray_new(threadData, tmp1, _dummy);
898 /* skip box _exarray; ExpandableArray<polymorphic<T>> */
899 return _exarray;
900}
901