Bug Summary

File:OMCompiler/Compiler/boot/build/StringUtil.c
Warning:line 865, column 3
Value stored to '_len' 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/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c" OMC_BASE_FILE
3#else
4 #define OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c" "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
5#endif
6#include "omc_simulation_settings.h"
7#include "StringUtil.h"
8#define _OMC_LIT0_data"" ""
9static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT0,0,_OMC_LIT0_data)struct { mmc_uint_t header; const char data[(0)+1]; } _OMC_LIT_STRUCT0
= { ((((mmc_uint_t)0)<<(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" kB" " kB"
12static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT1,3,_OMC_LIT1_data)struct { mmc_uint_t header; const char data[(3)+1]; } _OMC_LIT_STRUCT1
= { ((((mmc_uint_t)3)<<(3))+((1<<(3+3))+5)), " kB"
}
;
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" MB" " MB"
15static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT2,3,_OMC_LIT2_data)struct { mmc_uint_t header; const char data[(3)+1]; } _OMC_LIT_STRUCT2
= { ((((mmc_uint_t)3)<<(3))+((1<<(3+3))+5)), " MB"
}
;
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" GB" " GB"
18static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT3,3,_OMC_LIT3_data)struct { mmc_uint_t header; const char data[(3)+1]; } _OMC_LIT_STRUCT3
= { ((((mmc_uint_t)3)<<(3))+((1<<(3+3))+5)), " GB"
}
;
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" TB" " TB"
21static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT4,3,_OMC_LIT4_data)struct { mmc_uint_t header; const char data[(3)+1]; } _OMC_LIT_STRUCT4
= { ((((mmc_uint_t)3)<<(3))+((1<<(3+3))+5)), " TB"
}
;
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"\"" "\""
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)), "\""
}
;
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"\n" "\n"
27static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT6,1,_OMC_LIT6_data)struct { mmc_uint_t header; const char data[(1)+1]; } _OMC_LIT_STRUCT6
= { ((((mmc_uint_t)1)<<(3))+((1<<(3+3))+5)), "\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#define _OMC_LIT7_data"-" "-"
30static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT7,1,_OMC_LIT7_data)struct { mmc_uint_t header; const char data[(1)+1]; } _OMC_LIT_STRUCT7
= { ((((mmc_uint_t)1)<<(3))+((1<<(3+3))+5)), "-"
}
;
31#define _OMC_LIT7((void*)((char*)(&(_OMC_LIT_STRUCT7).header) + 3)) MMC_REFSTRINGLIT(_OMC_LIT_STRUCT7)((void*)((char*)(&(_OMC_LIT_STRUCT7).header) + 3))
32#include "util/modelica.h"
33
34#include "StringUtil_includes.h"
35
36
37
38DLLExport
39modelica_boolean omc_StringUtil_endsWithNewline(threadData_t *threadData, modelica_string _str)
40{
41 modelica_boolean _b;
42 MMC_SO()mmc_check_stackoverflow(threadData);
43 _tailrecursive: OMC_LABEL_UNUSED__attribute__((unused))
44 // _b has no default value.
45#line 386 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
46 _b = (((modelica_integer) 10) == stringGetNoBoundsChecking(_str, stringLength(_str))((unsigned char*)(((struct mmc_string*)((void*)((char*)((_str
)) - 3)))->data))[((((((*(mmc_uint_t*)((void*)((char*)(_str
) - 3)))) >> (3)) - 8)))-1]
);
47#line 47 OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
48 _return: OMC_LABEL_UNUSED__attribute__((unused))
49 return _b;
50}
51modelica_metatype boxptr_StringUtil_endsWithNewline(threadData_t *threadData, modelica_metatype _str)
52{
53 modelica_boolean _b;
54 modelica_metatype out_b;
55 _b = omc_StringUtil_endsWithNewline(threadData, _str);
56 out_b = mmc_mk_icon(_b);
57 return out_b;
58}
59
60DLLExport
61modelica_string omc_StringUtil_stringAppend9(threadData_t *threadData, modelica_string _str1, modelica_string _str2, modelica_string _str3, modelica_string _str4, modelica_string _str5, modelica_string _str6, modelica_string _str7, modelica_string _str8, modelica_string _str9)
62{
63 modelica_string _str = NULL((void*)0);
64 modelica_complex _sb;
65 modelica_integer _c;
66 MMC_SO()mmc_check_stackoverflow(threadData);
67 _tailrecursive: OMC_LABEL_UNUSED__attribute__((unused))
68 // _str has no default value.
69 _sb = omc_System_StringAllocator_constructor(threadData, stringLength(_str1)(((((*(mmc_uint_t*)((void*)((char*)(_str1) - 3)))) >> (
3)) - 8))
+ stringLength(_str2)(((((*(mmc_uint_t*)((void*)((char*)(_str2) - 3)))) >> (
3)) - 8))
+ stringLength(_str3)(((((*(mmc_uint_t*)((void*)((char*)(_str3) - 3)))) >> (
3)) - 8))
+ stringLength(_str4)(((((*(mmc_uint_t*)((void*)((char*)(_str4) - 3)))) >> (
3)) - 8))
+ stringLength(_str5)(((((*(mmc_uint_t*)((void*)((char*)(_str5) - 3)))) >> (
3)) - 8))
+ stringLength(_str6)(((((*(mmc_uint_t*)((void*)((char*)(_str6) - 3)))) >> (
3)) - 8))
+ stringLength(_str7)(((((*(mmc_uint_t*)((void*)((char*)(_str7) - 3)))) >> (
3)) - 8))
+ stringLength(_str8)(((((*(mmc_uint_t*)((void*)((char*)(_str8) - 3)))) >> (
3)) - 8))
+ stringLength(_str9)(((((*(mmc_uint_t*)((void*)((char*)(_str9) - 3)))) >> (
3)) - 8))
);
70 _c = ((modelica_integer) 0);
71#line 361 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
72 omc_System_stringAllocatorStringCopy(threadData, _sb, _str1, _c);
73#line 73 OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
74
75#line 362 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
76 _c = _c + stringLength(_str1)(((((*(mmc_uint_t*)((void*)((char*)(_str1) - 3)))) >> (
3)) - 8))
;
77#line 77 OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
78
79#line 363 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
80 omc_System_stringAllocatorStringCopy(threadData, _sb, _str2, _c);
81#line 81 OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
82
83#line 364 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
84 _c = _c + stringLength(_str2)(((((*(mmc_uint_t*)((void*)((char*)(_str2) - 3)))) >> (
3)) - 8))
;
85#line 85 OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
86
87#line 365 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
88 omc_System_stringAllocatorStringCopy(threadData, _sb, _str3, _c);
89#line 89 OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
90
91#line 366 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
92 _c = _c + stringLength(_str3)(((((*(mmc_uint_t*)((void*)((char*)(_str3) - 3)))) >> (
3)) - 8))
;
93#line 93 OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
94
95#line 367 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
96 omc_System_stringAllocatorStringCopy(threadData, _sb, _str4, _c);
97#line 97 OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
98
99#line 368 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
100 _c = _c + stringLength(_str4)(((((*(mmc_uint_t*)((void*)((char*)(_str4) - 3)))) >> (
3)) - 8))
;
101#line 101 OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
102
103#line 369 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
104 omc_System_stringAllocatorStringCopy(threadData, _sb, _str5, _c);
105#line 105 OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
106
107#line 370 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
108 _c = _c + stringLength(_str5)(((((*(mmc_uint_t*)((void*)((char*)(_str5) - 3)))) >> (
3)) - 8))
;
109#line 109 OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
110
111#line 371 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
112 omc_System_stringAllocatorStringCopy(threadData, _sb, _str6, _c);
113#line 113 OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
114
115#line 372 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
116 _c = _c + stringLength(_str6)(((((*(mmc_uint_t*)((void*)((char*)(_str6) - 3)))) >> (
3)) - 8))
;
117#line 117 OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
118
119#line 373 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
120 omc_System_stringAllocatorStringCopy(threadData, _sb, _str7, _c);
121#line 121 OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
122
123#line 374 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
124 _c = _c + stringLength(_str7)(((((*(mmc_uint_t*)((void*)((char*)(_str7) - 3)))) >> (
3)) - 8))
;
125#line 125 OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
126
127#line 375 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
128 omc_System_stringAllocatorStringCopy(threadData, _sb, _str8, _c);
129#line 129 OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
130
131#line 376 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
132 _c = _c + stringLength(_str8)(((((*(mmc_uint_t*)((void*)((char*)(_str8) - 3)))) >> (
3)) - 8))
;
133#line 133 OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
134
135#line 377 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
136 omc_System_stringAllocatorStringCopy(threadData, _sb, _str9, _c);
137#line 137 OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
138
139#line 378 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
140 _c = _c + stringLength(_str9)(((((*(mmc_uint_t*)((void*)((char*)(_str9) - 3)))) >> (
3)) - 8))
;
141#line 141 OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
142
143#line 379 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
144 _str = omc_System_stringAllocatorResult(threadData, _sb, _str1);
145#line 145 OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
146 _return: OMC_LABEL_UNUSED__attribute__((unused))
147 omc_System_StringAllocator_destructor(threadData,_sb);
148 return _str;
149}
150
151DLLExport
152modelica_integer omc_StringUtil_stringHashDjb2Work(threadData_t *threadData, modelica_string _str, modelica_integer _hash)
153{
154 modelica_integer _ohash;
155 modelica_integer tmp1;
156 modelica_integer tmp2;
157 modelica_integer tmp3;
158 MMC_SO()mmc_check_stackoverflow(threadData);
159 _tailrecursive: OMC_LABEL_UNUSED__attribute__((unused))
160 _ohash = _hash;
161#line 349 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
162 tmp1 = ((modelica_integer) 1); tmp2 = 1; tmp3 = stringLength(_str)(((((*(mmc_uint_t*)((void*)((char*)(_str) - 3)))) >> (3
)) - 8))
;
163#line 349 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
164 if(!(((tmp2 > 0) && (tmp1 > tmp3)) || ((tmp2 < 0) && (tmp1 < tmp3))))
165#line 349 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
166 {
167#line 349 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
168 modelica_integer _i;
169#line 349 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
170 for(_i = ((modelica_integer) 1); in_range_integer(_i, tmp1, tmp3); _i += tmp2)
171#line 349 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
172 {
173#line 350 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
174 _ohash = (((modelica_integer) 31)) * (_ohash) + stringGetNoBoundsChecking(_str, _i)((unsigned char*)(((struct mmc_string*)((void*)((char*)((_str
)) - 3)))->data))[(_i)-1]
;
175#line 175 OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
176 }
177 }
178 _return: OMC_LABEL_UNUSED__attribute__((unused))
179 return _ohash;
180}
181modelica_metatype boxptr_StringUtil_stringHashDjb2Work(threadData_t *threadData, modelica_metatype _str, modelica_metatype _hash)
182{
183 modelica_integer tmp1;
184 modelica_integer _ohash;
185 modelica_metatype out_ohash;
186 tmp1 = mmc_unbox_integer(_hash)(((mmc_sint_t) (_hash)) >> 1);
187 _ohash = omc_StringUtil_stringHashDjb2Work(threadData, _str, tmp1);
188 out_ohash = mmc_mk_icon(_ohash);
189 return out_ohash;
190}
191
192DLLExport
193modelica_string omc_StringUtil_bytesToReadableUnit(threadData_t *threadData, modelica_real _bytes, modelica_integer _significantDigits, modelica_real _maxSizeInUnit)
194{
195 modelica_string _str = NULL((void*)0);
196 modelica_real _TB;
197 modelica_real _GB;
198 modelica_real _MB;
199 modelica_real _kB;
200 modelica_string tmp1;
201 modelica_string tmp2;
202 modelica_string tmp3;
203 modelica_string tmp4;
204 modelica_string tmp5;
205 modelica_metatype tmpMeta[1] __attribute__((unused)) = {0};
206 MMC_SO()mmc_check_stackoverflow(threadData);
207 _tailrecursive: OMC_LABEL_UNUSED__attribute__((unused))
208 // _str has no default value.
209 _TB = 1099511627776.0;
210 _GB = 1073741824.0;
211 _MB = 1048576.0;
212 _kB = 1024.0;
213#line 331 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
214 if((_bytes > (1073741824.0) * (_maxSizeInUnit)))
215#line 331 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
216 {
217#line 332 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
218 tmp1 = modelica_real_to_modelica_string((9.094947017729282e-13) * (_bytes), _significantDigits, ((modelica_integer) 0), 1);
219#line 332 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
220 tmpMeta[0] = stringAppend(tmp1,_OMC_LIT4((void*)((char*)(&(_OMC_LIT_STRUCT4).header) + 3)));
221#line 332 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
222 _str = tmpMeta[0];
223#line 223 OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
224 }
225 else
226 {
227 if((_bytes > (1048576.0) * (_maxSizeInUnit)))
228 {
229#line 334 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
230 tmp2 = modelica_real_to_modelica_string((9.313225746154785e-10) * (_bytes), _significantDigits, ((modelica_integer) 0), 1);
231#line 334 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
232 tmpMeta[0] = stringAppend(tmp2,_OMC_LIT3((void*)((char*)(&(_OMC_LIT_STRUCT3).header) + 3)));
233#line 334 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
234 _str = tmpMeta[0];
235#line 235 OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
236 }
237 else
238 {
239 if((_bytes > (1024.0) * (_maxSizeInUnit)))
240 {
241#line 336 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
242 tmp3 = modelica_real_to_modelica_string((9.5367431640625e-07) * (_bytes), _significantDigits, ((modelica_integer) 0), 1);
243#line 336 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
244 tmpMeta[0] = stringAppend(tmp3,_OMC_LIT2((void*)((char*)(&(_OMC_LIT_STRUCT2).header) + 3)));
245#line 336 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
246 _str = tmpMeta[0];
247#line 247 OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
248 }
249 else
250 {
251 if((_bytes > _maxSizeInUnit))
252 {
253#line 338 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
254 tmp4 = modelica_real_to_modelica_string((0.0009765625) * (_bytes), _significantDigits, ((modelica_integer) 0), 1);
255#line 338 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
256 tmpMeta[0] = stringAppend(tmp4,_OMC_LIT1((void*)((char*)(&(_OMC_LIT_STRUCT1).header) + 3)));
257#line 338 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
258 _str = tmpMeta[0];
259#line 259 OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
260 }
261 else
262 {
263#line 340 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
264 tmp5 = modelica_integer_to_modelica_string(((modelica_integer)floor(_bytes)), ((modelica_integer) 0), 1);
265#line 340 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
266 _str = tmp5;
267#line 267 OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
268 }
269 }
270 }
271 }
272 _return: OMC_LABEL_UNUSED__attribute__((unused))
273 return _str;
274}
275modelica_metatype boxptr_StringUtil_bytesToReadableUnit(threadData_t *threadData, modelica_metatype _bytes, modelica_metatype _significantDigits, modelica_metatype _maxSizeInUnit)
276{
277 modelica_real tmp1;
278 modelica_integer tmp2;
279 modelica_real tmp3;
280 modelica_string _str = NULL((void*)0);
281 tmp1 = mmc_unbox_real(_bytes)mmc_prim_get_real(_bytes);
282 tmp2 = mmc_unbox_integer(_significantDigits)(((mmc_sint_t) (_significantDigits)) >> 1);
283 tmp3 = mmc_unbox_real(_maxSizeInUnit)mmc_prim_get_real(_maxSizeInUnit);
284 _str = omc_StringUtil_bytesToReadableUnit(threadData, tmp1, tmp2, tmp3);
285 /* skip box _str; String */
286 return _str;
287}
288
289DLLExport
290modelica_boolean omc_StringUtil_equalIgnoreSpace(threadData_t *threadData, modelica_string _s1, modelica_string _s2)
291{
292 modelica_boolean _b;
293 modelica_integer _j;
294 modelica_integer tmp1;
295 modelica_integer tmp2;
296 modelica_integer tmp3;
297 modelica_integer tmp4;
298 modelica_integer tmp5;
299 modelica_integer tmp6;
300 modelica_integer tmp7;
301 modelica_integer tmp8;
302 modelica_integer tmp9;
303 MMC_SO()mmc_check_stackoverflow(threadData);
304 _tailrecursive: OMC_LABEL_UNUSED__attribute__((unused))
305 // _b has no default value.
306 _j = ((modelica_integer) 1);
307#line 299 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
308 _b = 1;
309#line 309 OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
310
311#line 300 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
312 tmp4 = ((modelica_integer) 1); tmp5 = 1; tmp6 = stringLength(_s1)(((((*(mmc_uint_t*)((void*)((char*)(_s1) - 3)))) >> (3)
) - 8))
;
313#line 300 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
314 if(!(((tmp5 > 0) && (tmp4 > tmp6)) || ((tmp5 < 0) && (tmp4 < tmp6))))
315#line 300 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
316 {
317#line 300 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
318 modelica_integer _i;
319#line 300 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
320 for(_i = ((modelica_integer) 1); in_range_integer(_i, tmp4, tmp6); _i += tmp5)
321#line 300 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
322 {
323#line 301 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
324 if((stringGetNoBoundsChecking(_s1, _i)((unsigned char*)(((struct mmc_string*)((void*)((char*)((_s1)
) - 3)))->data))[(_i)-1]
!= ((modelica_integer) 32)))
325#line 301 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
326 {
327#line 302 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
328 _b = 0;
329#line 329 OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
330
331#line 303 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
332 tmp1 = _j; tmp2 = 1; tmp3 = stringLength(_s2)(((((*(mmc_uint_t*)((void*)((char*)(_s2) - 3)))) >> (3)
) - 8))
;
333#line 303 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
334 if(!(((tmp2 > 0) && (tmp1 > tmp3)) || ((tmp2 < 0) && (tmp1 < tmp3))))
335#line 303 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
336 {
337#line 303 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
338 modelica_integer _j2;
339#line 303 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
340 for(_j2 = _j; in_range_integer(_j2, tmp1, tmp3); _j2 += tmp2)
341#line 303 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
342 {
343#line 304 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
344 if((stringGetNoBoundsChecking(_s2, _j2)((unsigned char*)(((struct mmc_string*)((void*)((char*)((_s2)
) - 3)))->data))[(_j2)-1]
!= ((modelica_integer) 32)))
345#line 304 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
346 {
347#line 305 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
348 _j = ((modelica_integer) 1) + _j2;
349#line 349 OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
350
351#line 306 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
352 _b = 1;
353#line 353 OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
354
355#line 307 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
356 break;
357#line 357 OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
358 }
359 }
360 }
361
362#line 310 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
363 if((!_b))
364#line 310 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
365 {
366#line 311 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
367 goto _return;
368#line 368 OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
369 }
370 }
371 }
372 }
373
374#line 315 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
375 tmp7 = _j; tmp8 = 1; tmp9 = stringLength(_s2)(((((*(mmc_uint_t*)((void*)((char*)(_s2) - 3)))) >> (3)
) - 8))
;
376#line 315 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
377 if(!(((tmp8 > 0) && (tmp7 > tmp9)) || ((tmp8 < 0) && (tmp7 < tmp9))))
378#line 315 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
379 {
380#line 315 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
381 modelica_integer _j2;
382#line 315 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
383 for(_j2 = _j; in_range_integer(_j2, tmp7, tmp9); _j2 += tmp8)
384#line 315 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
385 {
386#line 316 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
387 if((stringGetNoBoundsChecking(_s2, _j2)((unsigned char*)(((struct mmc_string*)((void*)((char*)((_s2)
) - 3)))->data))[(_j2)-1]
!= ((modelica_integer) 32)))
388#line 316 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
389 {
390#line 317 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
391 _b = 0;
392#line 392 OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
393
394#line 318 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
395 goto _return;
396#line 396 OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
397 }
398 }
399 }
400 _return: OMC_LABEL_UNUSED__attribute__((unused))
401 return _b;
402}
403modelica_metatype boxptr_StringUtil_equalIgnoreSpace(threadData_t *threadData, modelica_metatype _s1, modelica_metatype _s2)
404{
405 modelica_boolean _b;
406 modelica_metatype out_b;
407 _b = omc_StringUtil_equalIgnoreSpace(threadData, _s1, _s2);
408 out_b = mmc_mk_icon(_b);
409 return out_b;
410}
411
412DLLExport
413modelica_string omc_StringUtil_quote(threadData_t *threadData, modelica_string _inString)
414{
415 modelica_string _outString = NULL((void*)0);
416 modelica_metatype tmpMeta[1] __attribute__((unused)) = {0};
417 MMC_SO()mmc_check_stackoverflow(threadData);
418 _tailrecursive: OMC_LABEL_UNUSED__attribute__((unused))
419 tmpMeta[0] = mmc_mk_cons(_OMC_LIT5((void*)((char*)(&(_OMC_LIT_STRUCT5).header) + 3)), mmc_mk_cons(_inString, mmc_mk_cons(_OMC_LIT5((void*)((char*)(&(_OMC_LIT_STRUCT5).header) + 3)), MMC_REFSTRUCTLIT(mmc_nil)((void*)((char*)(&(mmc_nil).header) + 3)))));
420 _outString = stringAppendList(tmpMeta[0]);
421 _return: OMC_LABEL_UNUSED__attribute__((unused))
422 return _outString;
423}
424
425DLLExport
426modelica_string omc_StringUtil_repeat(threadData_t *threadData, modelica_string _str, modelica_integer _n)
427{
428 modelica_string _res = NULL((void*)0);
429 modelica_integer _len;
430 modelica_complex _ext;
431 modelica_integer tmp1;
432 modelica_integer tmp2;
433 modelica_integer tmp3;
434 MMC_SO()mmc_check_stackoverflow(threadData);
435 _tailrecursive: OMC_LABEL_UNUSED__attribute__((unused))
436 _res = _OMC_LIT0((void*)((char*)(&(_OMC_LIT_STRUCT0).header) + 3));
437 _len = stringLength(_str)(((((*(mmc_uint_t*)((void*)((char*)(_str) - 3)))) >> (3
)) - 8))
;
438 _ext = omc_System_StringAllocator_constructor(threadData, (_len) * (_n));
439#line 279 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
440 tmp1 = ((modelica_integer) 0); tmp2 = 1; tmp3 = ((modelica_integer) -1) + _n;
441#line 279 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
442 if(!(((tmp2 > 0) && (tmp1 > tmp3)) || ((tmp2 < 0) && (tmp1 < tmp3))))
443#line 279 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
444 {
445#line 279 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
446 modelica_integer _i;
447#line 279 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
448 for(_i = ((modelica_integer) 0); in_range_integer(_i, tmp1, tmp3); _i += tmp2)
449#line 279 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
450 {
451#line 280 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
452 omc_System_stringAllocatorStringCopy(threadData, _ext, _str, (_len) * (_i));
453#line 453 OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
454 }
455 }
456
457#line 282 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
458 _res = omc_System_stringAllocatorResult(threadData, _ext, _res);
459#line 459 OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
460 _return: OMC_LABEL_UNUSED__attribute__((unused))
461 omc_System_StringAllocator_destructor(threadData,_ext);
462 return _res;
463}
464modelica_metatype boxptr_StringUtil_repeat(threadData_t *threadData, modelica_metatype _str, modelica_metatype _n)
465{
466 modelica_integer tmp1;
467 modelica_string _res = NULL((void*)0);
468 tmp1 = mmc_unbox_integer(_n)(((mmc_sint_t) (_n)) >> 1);
469 _res = omc_StringUtil_repeat(threadData, _str, tmp1);
470 /* skip box _res; String */
471 return _res;
472}
473
474DLLExport
475modelica_metatype omc_StringUtil_wordWrap(threadData_t *threadData, modelica_string _inString, modelica_integer _inWrapLength, modelica_string _inDelimiter, modelica_real _inRaggedness)
476{
477 modelica_metatype _outStrings = NULL((void*)0);
478 modelica_integer _start_pos;
479 modelica_integer _end_pos;
480 modelica_integer _line_len;
481 modelica_integer _pos;
482 modelica_integer _next_char;
483 modelica_integer _char;
484 modelica_integer _gap_size;
485 modelica_integer _next_gap_size;
486 modelica_string _str = NULL((void*)0);
487 modelica_string _delim = NULL((void*)0);
488 modelica_metatype _lines = NULL((void*)0);
489 modelica_metatype tmpMeta[4] __attribute__((unused)) = {0};
490 MMC_SO()mmc_check_stackoverflow(threadData);
491 _tailrecursive: OMC_LABEL_UNUSED__attribute__((unused))
492 tmpMeta[0] = MMC_REFSTRUCTLIT(mmc_nil)((void*)((char*)(&(mmc_nil).header) + 3));
493 _outStrings = tmpMeta[0];
494 _start_pos = ((modelica_integer) 1);
495 _end_pos = _inWrapLength;
496 // _line_len has no default value.
497 // _pos has no default value.
498 // _next_char has no default value.
499 // _char has no default value.
500 // _gap_size has no default value.
501 // _next_gap_size has no default value.
502 // _str has no default value.
503 _delim = _OMC_LIT0((void*)((char*)(&(_OMC_LIT_STRUCT0).header) + 3));
504 // _lines has no default value.
505#line 196 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
506 if((stringLength(_inDelimiter)(((((*(mmc_uint_t*)((void*)((char*)(_inDelimiter) - 3)))) >>
(3)) - 8))
>= ((modelica_integer) -1) + _inWrapLength))
507#line 196 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
508 {
509#line 197 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
510 tmpMeta[1] = mmc_mk_cons(_inString, MMC_REFSTRUCTLIT(mmc_nil)((void*)((char*)(&(mmc_nil).header) + 3)));
511#line 197 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
512 _outStrings = tmpMeta[1];
513#line 513 OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
514
515#line 198 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
516 goto _return;
517#line 517 OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
518 }
519
520#line 202 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
521 _lines = omc_System_strtok(threadData, _inString, _OMC_LIT6((void*)((char*)(&(_OMC_LIT_STRUCT6).header) + 3)));
522#line 522 OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
523
524#line 204 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
525 _line_len = ((modelica_integer) -1) + _inWrapLength - stringLength(_inDelimiter)(((((*(mmc_uint_t*)((void*)((char*)(_inDelimiter) - 3)))) >>
(3)) - 8))
;
526#line 526 OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
527
528#line 207 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
529 _gap_size = modelica_integer_max((modelica_integer)(((modelica_integer)floor((((modelica_real)_line_len)) * (_inRaggedness)))),(modelica_integer)(((modelica_integer) 0)));
530#line 530 OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
531
532#line 210 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
533 {
534#line 210 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
535 modelica_metatype _line;
536#line 210 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
537 for (tmpMeta[1] = _lines; !listEmpty(tmpMeta[1])((*(mmc_uint_t*)((void*)((char*)(tmpMeta[1]) - 3))) == (((0) <<
10) + (((0) & 255) << 2)))
; tmpMeta[1]=MMC_CDR(tmpMeta[1])(*(void**)(((void*)((void**)(((void*)((char*)(tmpMeta[1]) - 3
))) + (2)))))
)
538#line 210 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
539 {
540#line 210 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
541 _line = MMC_CAR(tmpMeta[1])(*(void**)(((void*)((void**)(((void*)((char*)(tmpMeta[1]) - 3
))) + (1)))))
;
542#line 211 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
543 while(1)
544#line 211 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
545 {
546#line 211 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
547 if(!(_end_pos < stringLength(_line)(((((*(mmc_uint_t*)((void*)((char*)(_line) - 3)))) >> (
3)) - 8))
)) break;
548#line 212 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
549 _next_char = stringGetNoBoundsChecking(_line, ((modelica_integer) 1) + _end_pos)((unsigned char*)(((struct mmc_string*)((void*)((char*)((_line
)) - 3)))->data))[(((modelica_integer) 1) + _end_pos)-1]
;
550#line 550 OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
551
552#line 214 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
553 if(((_next_char != ((modelica_integer) 32)) && (_next_char != ((modelica_integer) 45))))
554#line 214 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
555 {
556#line 216 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
557 _pos = omc_StringUtil_rfindChar(threadData, _line, ((modelica_integer) 32), _end_pos, _end_pos - _gap_size);
558#line 558 OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
559
560#line 218 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
561 if((_pos != ((modelica_integer) 0)))
562#line 218 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
563 {
564#line 220 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
565 _str = substring(_line, _start_pos, ((modelica_integer) -1) + _pos)boxptr_substring(threadData,_line,mmc_mk_icon(_start_pos),mmc_mk_icon
(((modelica_integer) -1) + _pos))
;
566#line 566 OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
567
568#line 221 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
569 _start_pos = ((modelica_integer) 1) + _pos;
570#line 570 OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
571 }
572 else
573 {
574#line 224 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
575 _pos = omc_StringUtil_rfindChar(threadData, _line, ((modelica_integer) 45), _end_pos, _start_pos + _gap_size);
576#line 576 OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
577
578#line 226 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
579 if((_pos > ((modelica_integer) 1)))
580#line 226 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
581 {
582#line 228 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
583 _char = stringGetNoBoundsChecking(_line, ((modelica_integer) -1) + _pos)((unsigned char*)(((struct mmc_string*)((void*)((char*)((_line
)) - 3)))->data))[(((modelica_integer) -1) + _pos)-1]
;
584#line 584 OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
585
586#line 229 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
587 _pos = ((omc_StringUtil_isAlpha(threadData, _char) && omc_StringUtil_isAlpha(threadData, _next_char))?_pos:((modelica_integer) 0));
588#line 588 OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
589 }
590
591#line 232 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
592 if((_pos != ((modelica_integer) 0)))
593#line 232 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
594 {
595#line 234 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
596 _str = substring(_line, _start_pos, _pos)boxptr_substring(threadData,_line,mmc_mk_icon(_start_pos),mmc_mk_icon
(_pos))
;
597#line 597 OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
598
599#line 235 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
600 _start_pos = ((modelica_integer) 1) + _pos;
601#line 601 OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
602 }
603 else
604 {
605#line 238 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
606 tmpMeta[2] = stringAppend(substring(_line, _start_pos, ((modelica_integer) -1) + _end_pos)boxptr_substring(threadData,_line,mmc_mk_icon(_start_pos),mmc_mk_icon
(((modelica_integer) -1) + _end_pos))
,_OMC_LIT7((void*)((char*)(&(_OMC_LIT_STRUCT7).header) + 3)));
607#line 238 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
608 _str = tmpMeta[2];
609#line 609 OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
610
611#line 239 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
612 _start_pos = _end_pos;
613#line 613 OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
614 }
615 }
616 }
617 else
618 {
619#line 244 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
620 _str = substring(_line, _start_pos, _end_pos)boxptr_substring(threadData,_line,mmc_mk_icon(_start_pos),mmc_mk_icon
(_end_pos))
;
621#line 621 OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
622
623#line 246 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
624 _start_pos = _end_pos + ((_next_char == ((modelica_integer) 32))?((modelica_integer) 2):((modelica_integer) 1));
625#line 625 OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
626 }
627
628#line 250 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
629 tmpMeta[3] = stringAppend(_delim,_str);
630#line 250 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
631 tmpMeta[2] = mmc_mk_cons(tmpMeta[3], _outStrings);
632#line 250 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
633 _outStrings = tmpMeta[2];
634#line 634 OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
635
636#line 251 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
637 _end_pos = _start_pos + _line_len;
638#line 638 OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
639
640#line 252 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
641 _delim = _inDelimiter;
642#line 642 OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
643 }
644
645#line 256 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
646 if((_start_pos < stringLength(_line)(((((*(mmc_uint_t*)((void*)((char*)(_line) - 3)))) >> (
3)) - 8))
))
647#line 256 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
648 {
649#line 257 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
650 tmpMeta[2] = stringAppend(_delim,substring(_line, _start_pos, stringLength(_line))boxptr_substring(threadData,_line,mmc_mk_icon(_start_pos),mmc_mk_icon
((((((*(mmc_uint_t*)((void*)((char*)(_line) - 3)))) >> (
3)) - 8))))
);
651#line 257 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
652 _str = tmpMeta[2];
653#line 653 OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
654
655#line 258 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
656 tmpMeta[2] = mmc_mk_cons(_str, _outStrings);
657#line 258 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
658 _outStrings = tmpMeta[2];
659#line 659 OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
660 }
661
662#line 262 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
663 _start_pos = ((modelica_integer) 1);
664#line 664 OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
665
666#line 263 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
667 _end_pos = _line_len;
668#line 668 OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
669
670#line 264 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
671 _delim = _inDelimiter;
672#line 672 OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
673 }
674 }
675
676#line 267 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
677 _outStrings = listReverseInPlace(_outStrings);
678#line 678 OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
679 _return: OMC_LABEL_UNUSED__attribute__((unused))
680 return _outStrings;
681}
682modelica_metatype boxptr_StringUtil_wordWrap(threadData_t *threadData, modelica_metatype _inString, modelica_metatype _inWrapLength, modelica_metatype _inDelimiter, modelica_metatype _inRaggedness)
683{
684 modelica_integer tmp1;
685 modelica_real tmp2;
686 modelica_metatype _outStrings = NULL((void*)0);
687 modelica_metatype tmpMeta[1] __attribute__((unused)) = {0};
688 tmp1 = mmc_unbox_integer(_inWrapLength)(((mmc_sint_t) (_inWrapLength)) >> 1);
689 tmp2 = mmc_unbox_real(_inRaggedness)mmc_prim_get_real(_inRaggedness);
690 _outStrings = omc_StringUtil_wordWrap(threadData, _inString, tmp1, _inDelimiter, tmp2);
691 /* skip box _outStrings; list<String> */
692 return _outStrings;
693}
694
695DLLExport
696modelica_boolean omc_StringUtil_isAlpha(threadData_t *threadData, modelica_integer _inChar)
697{
698 modelica_boolean _outIsAlpha;
699 MMC_SO()mmc_check_stackoverflow(threadData);
700 _tailrecursive: OMC_LABEL_UNUSED__attribute__((unused))
701 _outIsAlpha = (((_inChar >= ((modelica_integer) 65)) && (_inChar <= ((modelica_integer) 90))) || ((_inChar >= ((modelica_integer) 97)) && (_inChar <= ((modelica_integer) 122))));
702 _return: OMC_LABEL_UNUSED__attribute__((unused))
703 return _outIsAlpha;
704}
705modelica_metatype boxptr_StringUtil_isAlpha(threadData_t *threadData, modelica_metatype _inChar)
706{
707 modelica_integer tmp1;
708 modelica_boolean _outIsAlpha;
709 modelica_metatype out_outIsAlpha;
710 tmp1 = mmc_unbox_integer(_inChar)(((mmc_sint_t) (_inChar)) >> 1);
711 _outIsAlpha = omc_StringUtil_isAlpha(threadData, tmp1);
712 out_outIsAlpha = mmc_mk_icon(_outIsAlpha);
713 return out_outIsAlpha;
714}
715
716DLLExport
717modelica_integer omc_StringUtil_rfindCharNot(threadData_t *threadData, modelica_string _inString, modelica_integer _inChar, modelica_integer _inStartPos, modelica_integer _inEndPos)
718{
719 modelica_integer _outIndex;
720 modelica_integer _len;
721 modelica_integer _start_pos;
722 modelica_integer _end_pos;
723 modelica_integer tmp1;
724 modelica_integer tmp2;
725 modelica_integer tmp3;
726 MMC_SO()mmc_check_stackoverflow(threadData);
727 _tailrecursive: OMC_LABEL_UNUSED__attribute__((unused))
728 _outIndex = ((modelica_integer) 0);
729 _len = stringLength(_inString)(((((*(mmc_uint_t*)((void*)((char*)(_inString) - 3)))) >>
(3)) - 8))
;
730 // _start_pos has no default value.
731 // _end_pos has no default value.
732#line 143 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
733 _start_pos = ((_inStartPos > ((modelica_integer) 0))?modelica_integer_min((modelica_integer)(_inStartPos),(modelica_integer)(stringLength(_inString)(((((*(mmc_uint_t*)((void*)((char*)(_inString) - 3)))) >>
(3)) - 8))
)):stringLength(_inString)(((((*(mmc_uint_t*)((void*)((char*)(_inString) - 3)))) >>
(3)) - 8))
);
734#line 734 OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
735
736#line 144 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
737 _end_pos = modelica_integer_max((modelica_integer)(_inEndPos),(modelica_integer)(((modelica_integer) 1)));
738#line 738 OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
739
740#line 146 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
741 tmp1 = _start_pos; tmp2 = ((modelica_integer) -1); tmp3 = _end_pos;
742#line 146 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
743 if(!(((tmp2 > 0) && (tmp1 > tmp3)) || ((tmp2 < 0) && (tmp1 < tmp3))))
744#line 146 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
745 {
746#line 146 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
747 modelica_integer _i;
748#line 146 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
749 for(_i = _start_pos; in_range_integer(_i, tmp1, tmp3); _i += tmp2)
750#line 146 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
751 {
752#line 147 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
753 if((stringGetNoBoundsChecking(_inString, _i)((unsigned char*)(((struct mmc_string*)((void*)((char*)((_inString
)) - 3)))->data))[(_i)-1]
!= _inChar))
754#line 147 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
755 {
756#line 148 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
757 _outIndex = _i;
758#line 758 OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
759
760#line 149 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
761 break;
762#line 762 OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
763 }
764 }
765 }
766 _return: OMC_LABEL_UNUSED__attribute__((unused))
767 return _outIndex;
768}
769modelica_metatype boxptr_StringUtil_rfindCharNot(threadData_t *threadData, modelica_metatype _inString, modelica_metatype _inChar, modelica_metatype _inStartPos, modelica_metatype _inEndPos)
770{
771 modelica_integer tmp1;
772 modelica_integer tmp2;
773 modelica_integer tmp3;
774 modelica_integer _outIndex;
775 modelica_metatype out_outIndex;
776 tmp1 = mmc_unbox_integer(_inChar)(((mmc_sint_t) (_inChar)) >> 1);
777 tmp2 = mmc_unbox_integer(_inStartPos)(((mmc_sint_t) (_inStartPos)) >> 1);
778 tmp3 = mmc_unbox_integer(_inEndPos)(((mmc_sint_t) (_inEndPos)) >> 1);
779 _outIndex = omc_StringUtil_rfindCharNot(threadData, _inString, tmp1, tmp2, tmp3);
780 out_outIndex = mmc_mk_icon(_outIndex);
781 return out_outIndex;
782}
783
784DLLExport
785modelica_integer omc_StringUtil_findCharNot(threadData_t *threadData, modelica_string _inString, modelica_integer _inChar, modelica_integer _inStartPos, modelica_integer _inEndPos)
786{
787 modelica_integer _outIndex;
788 modelica_integer _len;
789 modelica_integer _start_pos;
790 modelica_integer _end_pos;
791 modelica_integer tmp1;
792 modelica_integer tmp2;
793 modelica_integer tmp3;
794 MMC_SO()mmc_check_stackoverflow(threadData);
795 _tailrecursive: OMC_LABEL_UNUSED__attribute__((unused))
796 _outIndex = ((modelica_integer) 0);
797 _len = stringLength(_inString)(((((*(mmc_uint_t*)((void*)((char*)(_inString) - 3)))) >>
(3)) - 8))
;
798 // _start_pos has no default value.
799 // _end_pos has no default value.
800#line 117 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
801 _start_pos = modelica_integer_max((modelica_integer)(_inStartPos),(modelica_integer)(((modelica_integer) 1)));
802#line 802 OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
803
804#line 118 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
805 _end_pos = ((_inEndPos > ((modelica_integer) 0))?modelica_integer_min((modelica_integer)(_inEndPos),(modelica_integer)(stringLength(_inString)(((((*(mmc_uint_t*)((void*)((char*)(_inString) - 3)))) >>
(3)) - 8))
)):stringLength(_inString)(((((*(mmc_uint_t*)((void*)((char*)(_inString) - 3)))) >>
(3)) - 8))
);
806#line 806 OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
807
808#line 120 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
809 tmp1 = _start_pos; tmp2 = 1; tmp3 = _end_pos;
810#line 120 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
811 if(!(((tmp2 > 0) && (tmp1 > tmp3)) || ((tmp2 < 0) && (tmp1 < tmp3))))
812#line 120 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
813 {
814#line 120 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
815 modelica_integer _i;
816#line 120 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
817 for(_i = _start_pos; in_range_integer(_i, tmp1, tmp3); _i += tmp2)
818#line 120 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
819 {
820#line 121 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
821 if((stringGetNoBoundsChecking(_inString, _i)((unsigned char*)(((struct mmc_string*)((void*)((char*)((_inString
)) - 3)))->data))[(_i)-1]
!= _inChar))
822#line 121 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
823 {
824#line 122 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
825 _outIndex = _i;
826#line 826 OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
827
828#line 123 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
829 break;
830#line 830 OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
831 }
832 }
833 }
834 _return: OMC_LABEL_UNUSED__attribute__((unused))
835 return _outIndex;
836}
837modelica_metatype boxptr_StringUtil_findCharNot(threadData_t *threadData, modelica_metatype _inString, modelica_metatype _inChar, modelica_metatype _inStartPos, modelica_metatype _inEndPos)
838{
839 modelica_integer tmp1;
840 modelica_integer tmp2;
841 modelica_integer tmp3;
842 modelica_integer _outIndex;
843 modelica_metatype out_outIndex;
844 tmp1 = mmc_unbox_integer(_inChar)(((mmc_sint_t) (_inChar)) >> 1);
845 tmp2 = mmc_unbox_integer(_inStartPos)(((mmc_sint_t) (_inStartPos)) >> 1);
846 tmp3 = mmc_unbox_integer(_inEndPos)(((mmc_sint_t) (_inEndPos)) >> 1);
847 _outIndex = omc_StringUtil_findCharNot(threadData, _inString, tmp1, tmp2, tmp3);
848 out_outIndex = mmc_mk_icon(_outIndex);
849 return out_outIndex;
850}
851
852DLLExport
853modelica_integer omc_StringUtil_rfindChar(threadData_t *threadData, modelica_string _inString, modelica_integer _inChar, modelica_integer _inStartPos, modelica_integer _inEndPos)
854{
855 modelica_integer _outIndex;
856 modelica_integer _len;
857 modelica_integer _start_pos;
858 modelica_integer _end_pos;
859 modelica_integer tmp1;
860 modelica_integer tmp2;
861 modelica_integer tmp3;
862 MMC_SO()mmc_check_stackoverflow(threadData);
863 _tailrecursive: OMC_LABEL_UNUSED__attribute__((unused))
864 _outIndex = ((modelica_integer) 0);
865 _len = stringLength(_inString)(((((*(mmc_uint_t*)((void*)((char*)(_inString) - 3)))) >>
(3)) - 8))
;
Value stored to '_len' is never read
866 // _start_pos has no default value.
867 // _end_pos has no default value.
868#line 91 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
869 _start_pos = ((_inStartPos > ((modelica_integer) 0))?modelica_integer_min((modelica_integer)(_inStartPos),(modelica_integer)(stringLength(_inString)(((((*(mmc_uint_t*)((void*)((char*)(_inString) - 3)))) >>
(3)) - 8))
)):stringLength(_inString)(((((*(mmc_uint_t*)((void*)((char*)(_inString) - 3)))) >>
(3)) - 8))
);
870#line 870 OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
871
872#line 92 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
873 _end_pos = modelica_integer_max((modelica_integer)(_inEndPos),(modelica_integer)(((modelica_integer) 1)));
874#line 874 OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
875
876#line 94 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
877 tmp1 = _start_pos; tmp2 = ((modelica_integer) -1); tmp3 = _end_pos;
878#line 94 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
879 if(!(((tmp2 > 0) && (tmp1 > tmp3)) || ((tmp2 < 0) && (tmp1 < tmp3))))
880#line 94 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
881 {
882#line 94 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
883 modelica_integer _i;
884#line 94 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
885 for(_i = _start_pos; in_range_integer(_i, tmp1, tmp3); _i += tmp2)
886#line 94 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
887 {
888#line 95 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
889 if((stringGetNoBoundsChecking(_inString, _i)((unsigned char*)(((struct mmc_string*)((void*)((char*)((_inString
)) - 3)))->data))[(_i)-1]
== _inChar))
890#line 95 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
891 {
892#line 96 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
893 _outIndex = _i;
894#line 894 OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
895
896#line 97 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
897 break;
898#line 898 OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
899 }
900 }
901 }
902 _return: OMC_LABEL_UNUSED__attribute__((unused))
903 return _outIndex;
904}
905modelica_metatype boxptr_StringUtil_rfindChar(threadData_t *threadData, modelica_metatype _inString, modelica_metatype _inChar, modelica_metatype _inStartPos, modelica_metatype _inEndPos)
906{
907 modelica_integer tmp1;
908 modelica_integer tmp2;
909 modelica_integer tmp3;
910 modelica_integer _outIndex;
911 modelica_metatype out_outIndex;
912 tmp1 = mmc_unbox_integer(_inChar)(((mmc_sint_t) (_inChar)) >> 1);
913 tmp2 = mmc_unbox_integer(_inStartPos)(((mmc_sint_t) (_inStartPos)) >> 1);
914 tmp3 = mmc_unbox_integer(_inEndPos)(((mmc_sint_t) (_inEndPos)) >> 1);
915 _outIndex = omc_StringUtil_rfindChar(threadData, _inString, tmp1, tmp2, tmp3);
916 out_outIndex = mmc_mk_icon(_outIndex);
917 return out_outIndex;
918}
919
920DLLExport
921modelica_integer omc_StringUtil_findChar(threadData_t *threadData, modelica_string _inString, modelica_integer _inChar, modelica_integer _inStartPos, modelica_integer _inEndPos)
922{
923 modelica_integer _outIndex;
924 modelica_integer _len;
925 modelica_integer _start_pos;
926 modelica_integer _end_pos;
927 modelica_integer tmp1;
928 modelica_integer tmp2;
929 modelica_integer tmp3;
930 MMC_SO()mmc_check_stackoverflow(threadData);
931 _tailrecursive: OMC_LABEL_UNUSED__attribute__((unused))
932 _outIndex = ((modelica_integer) 0);
933 _len = stringLength(_inString)(((((*(mmc_uint_t*)((void*)((char*)(_inString) - 3)))) >>
(3)) - 8))
;
934 // _start_pos has no default value.
935 // _end_pos has no default value.
936#line 66 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
937 _start_pos = modelica_integer_max((modelica_integer)(_inStartPos),(modelica_integer)(((modelica_integer) 1)));
938#line 938 OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
939
940#line 67 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
941 _end_pos = ((_inEndPos > ((modelica_integer) 0))?modelica_integer_min((modelica_integer)(_inEndPos),(modelica_integer)(stringLength(_inString)(((((*(mmc_uint_t*)((void*)((char*)(_inString) - 3)))) >>
(3)) - 8))
)):stringLength(_inString)(((((*(mmc_uint_t*)((void*)((char*)(_inString) - 3)))) >>
(3)) - 8))
);
942#line 942 OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
943
944#line 69 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
945 tmp1 = _start_pos; tmp2 = 1; tmp3 = _end_pos;
946#line 69 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
947 if(!(((tmp2 > 0) && (tmp1 > tmp3)) || ((tmp2 < 0) && (tmp1 < tmp3))))
948#line 69 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
949 {
950#line 69 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
951 modelica_integer _i;
952#line 69 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
953 for(_i = _start_pos; in_range_integer(_i, tmp1, tmp3); _i += tmp2)
954#line 69 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
955 {
956#line 70 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
957 if((stringGetNoBoundsChecking(_inString, _i)((unsigned char*)(((struct mmc_string*)((void*)((char*)((_inString
)) - 3)))->data))[(_i)-1]
== _inChar))
958#line 70 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
959 {
960#line 71 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
961 _outIndex = _i;
962#line 962 OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
963
964#line 72 "/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/Util/StringUtil.mo"
965 break;
966#line 966 OMC_FILE"/var/lib/jenkins1/ws/ins.slow_JKRT-OMSens-minor-fixes/OMCompiler/Compiler/boot/build/tmp/StringUtil.c"
967 }
968 }
969 }
970 _return: OMC_LABEL_UNUSED__attribute__((unused))
971 return _outIndex;
972}
973modelica_metatype boxptr_StringUtil_findChar(threadData_t *threadData, modelica_metatype _inString, modelica_metatype _inChar, modelica_metatype _inStartPos, modelica_metatype _inEndPos)
974{
975 modelica_integer tmp1;
976 modelica_integer tmp2;
977 modelica_integer tmp3;
978 modelica_integer _outIndex;
979 modelica_metatype out_outIndex;
980 tmp1 = mmc_unbox_integer(_inChar)(((mmc_sint_t) (_inChar)) >> 1);
981 tmp2 = mmc_unbox_integer(_inStartPos)(((mmc_sint_t) (_inStartPos)) >> 1);
982 tmp3 = mmc_unbox_integer(_inEndPos)(((mmc_sint_t) (_inEndPos)) >> 1);
983 _outIndex = omc_StringUtil_findChar(threadData, _inString, tmp1, tmp2, tmp3);
984 out_outIndex = mmc_mk_icon(_outIndex);
985 return out_outIndex;
986}
987