nandi/vflutter_ffipublic Fork 0
472eb493bac94bdcb79a38829ccca0c541256fef
Commits
Clone
git clone https://git.rickub.com/nandi/vflutter_ffi.git
git clone ssh://git@rickub.com/nandi/vflutter_ffi.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

nimflutter_01.c · 337 lines · 5.4 KBC Blame HistoryRaw
Replace V with Nim 472eb49 nandithebull 17h ago1/* Generated by Nim Compiler v2.2.0 */
2#define NIM_INTBITS 64
3
4#include "nimbase.h"
5#include <string.h>
6#undef LANGUAGE_C
7#undef MIPSEB
8#undef MIPSEL
9#undef PPC
10#undef R3000
11#undef R4000
12#undef i386
13#undef linux
14#undef mips
15#undef near
16#undef far
17#undef powerpc
18#undef unix
19typedef struct NimStrPayload NimStrPayload;
20typedef struct NimStringV2 NimStringV2;
21struct NimStrPayload {
22 NI cap;
23 NIM_CHAR data[SEQ_DECL_SIZE];
24};
25struct NimStringV2 {
26 NI len;
27 NimStrPayload* p;
28};
29typedef NIM_CHAR tyArray__PbS9a6gkxCuxWEnFq4lOU9aw[24];
30typedef NIM_CHAR tyArray__38Z69amCaoywES5tRmClBSw[200];
31static N_INLINE(void, nimAddCharV1)(NimStringV2* s_p0, NIM_CHAR c_p1);
32N_LIB_PRIVATE N_NIMCALL(void, prepareAdd)(NimStringV2* s_p0, NI addLen_p1);
33N_LIB_PRIVATE N_NIMCALL(void, addInt__stdZprivateZdigitsutils_u175)(NimStringV2* result_p0, NU64 x_p1);
34static N_INLINE(void, addIntImpl__stdZprivateZdigitsutils_u55)(NimStringV2* result_p0, NU64 x_p1);
35static N_INLINE(void, addChars__stdZprivateZdigitsutils_u98)(NimStringV2* result_p0, tyArray__PbS9a6gkxCuxWEnFq4lOU9aw x_p1, NI start_p2, NI n_p3);
36N_LIB_PRIVATE N_NIMCALL(void, setLengthStrV2)(NimStringV2* s_p0, NI newLen_p1);
37static N_INLINE(void, copyMem__system_u1726)(void* dest_p0, void* source_p1, NI size_p2);
38static N_INLINE(void, nimCopyMem)(void* dest_p0, void* source_p1, NI size_p2);
39static N_INLINE(NIM_BOOL*, nimErrorFlag)(void);
40N_LIB_PRIVATE NIM_CONST tyArray__38Z69amCaoywES5tRmClBSw digits100__stdZprivateZdigitsutils_u2 = {48,
4148,
4248,
4349,
4448,
4550,
4648,
4751,
4848,
4952,
5048,
5153,
5248,
5354,
5448,
5555,
5648,
5756,
5848,
5957,
6049,
6148,
6249,
6349,
6449,
6550,
6649,
6751,
6849,
6952,
7049,
7153,
7249,
7354,
7449,
7555,
7649,
7756,
7849,
7957,
8050,
8148,
8250,
8349,
8450,
8550,
8650,
8751,
8850,
8952,
9050,
9153,
9250,
9354,
9450,
9555,
9650,
9756,
9850,
9957,
10051,
10148,
10251,
10349,
10451,
10550,
10651,
10751,
10851,
10952,
11051,
11153,
11251,
11354,
11451,
11555,
11651,
11756,
11851,
11957,
12052,
12148,
12252,
12349,
12452,
12550,
12652,
12751,
12852,
12952,
13052,
13153,
13252,
13354,
13452,
13555,
13652,
13756,
13852,
13957,
14053,
14148,
14253,
14349,
14453,
14550,
14653,
14751,
14853,
14952,
15053,
15153,
15253,
15354,
15453,
15555,
15653,
15756,
15853,
15957,
16054,
16148,
16254,
16349,
16454,
16550,
16654,
16751,
16854,
16952,
17054,
17153,
17254,
17354,
17454,
17555,
17654,
17756,
17854,
17957,
18055,
18148,
18255,
18349,
18455,
18550,
18655,
18751,
18855,
18952,
19055,
19153,
19255,
19354,
19455,
19555,
19655,
19756,
19855,
19957,
20056,
20148,
20256,
20349,
20456,
20550,
20656,
20751,
20856,
20952,
21056,
21153,
21256,
21354,
21456,
21555,
21656,
21756,
21856,
21957,
22057,
22148,
22257,
22349,
22457,
22550,
22657,
22751,
22857,
22952,
23057,
23153,
23257,
23354,
23457,
23555,
23657,
23756,
23857,
23957}
240;
241extern NIM_THREADVAR NIM_BOOL nimInErrorMode__system_u3579;
242static N_INLINE(void, nimAddCharV1)(NimStringV2* s_p0, NIM_CHAR c_p1) {
243 prepareAdd(s_p0, ((NI)1));
244 (*(*s_p0).p).data[(*s_p0).len] = c_p1;
245 (*s_p0).len += ((NI)1);
246 (*(*s_p0).p).data[(*s_p0).len] = 0;
247}
248static N_INLINE(void, nimCopyMem)(void* dest_p0, void* source_p1, NI size_p2) {
249 void* T1_;
250 T1_ = (void*)0;
251 T1_ = memcpy(dest_p0, source_p1, ((size_t) (size_p2)));
252}
253static N_INLINE(void, copyMem__system_u1726)(void* dest_p0, void* source_p1, NI size_p2) {
254 nimCopyMem(dest_p0, source_p1, size_p2);
255}
256static N_INLINE(void, addChars__stdZprivateZdigitsutils_u98)(NimStringV2* result_p0, tyArray__PbS9a6gkxCuxWEnFq4lOU9aw x_p1, NI start_p2, NI n_p3) {
257 NI old;
258 old = (*result_p0).len;
259 setLengthStrV2((&(*result_p0)), ((NI)(old + n_p3)));
260 copyMem__system_u1726(((void*) ((&(*result_p0).p->data[old]))), ((void*) ((&x_p1[(start_p2)- 0]))), (n_p3));
261}
262static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) {
263 NIM_BOOL* result;
264 result = (&nimInErrorMode__system_u3579);
265 return result;
266}
267static N_INLINE(void, addIntImpl__stdZprivateZdigitsutils_u55)(NimStringV2* result_p0, NU64 x_p1) {
268 tyArray__PbS9a6gkxCuxWEnFq4lOU9aw tmp;
269 NU64 num;
270 NI next;
271NIM_BOOL* nimErr_;
272{nimErr_ = nimErrorFlag();
273 num = x_p1;
274 next = ((NI)23);
275 {
276 while (1) {
277 NU64 originNum;
278 NI16 index;
279 if (!((NU64)(100ULL) <= (NU64)(num))) goto LA2;
280 originNum = num;
281 num = (NU64)((NU64)(num) / (NU64)(100ULL));
282 index = ((NI16) ((NU64)((NU64)((NU64)((NU64)(originNum) - (NU64)((NU64)((NU64)(num) * (NU64)(100ULL))))) << (NU64)(((NI)1)))));
283 tmp[(next)- 0] = digits100__stdZprivateZdigitsutils_u2[((NI16)(index + ((NI16)1)))- 0];
284 tmp[((NI)(next - ((NI)1)))- 0] = digits100__stdZprivateZdigitsutils_u2[(index)- 0];
285 next -= ((NI)2);
286 } LA2: ;
287 }
288 {
289 if (!((NU64)(num) < (NU64)(10ULL))) goto LA5_;
290 tmp[(next)- 0] = ((NIM_CHAR) (((NI) ((NU8)((NU8)(((NU8)48)) + (NU8)(((NU8) (num))))))));
291 }
292 goto LA3_;
293LA5_: ;
294 {
295 NU64 index_2;
296 index_2 = (NU64)((NU64)(num) * (NU64)(2ULL));
297 tmp[(next)- 0] = digits100__stdZprivateZdigitsutils_u2[((NU64)((NU64)(index_2) + (NU64)(1ULL)))- 0];
298 tmp[((NI)(next - ((NI)1)))- 0] = digits100__stdZprivateZdigitsutils_u2[(index_2)- 0];
299 next -= ((NI)1);
300 }
301LA3_: ;
302 addChars__stdZprivateZdigitsutils_u98(result_p0, tmp, next, (NI)(((NI)24) - next));
303 if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
304 }BeforeRet_: ;
305}
306N_LIB_PRIVATE N_NIMCALL(void, addInt__stdZprivateZdigitsutils_u175)(NimStringV2* result_p0, NU64 x_p1) {
307NIM_BOOL* nimErr_;
308{nimErr_ = nimErrorFlag();
309 addIntImpl__stdZprivateZdigitsutils_u55(result_p0, x_p1);
310 if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
311 }BeforeRet_: ;
312}
313N_LIB_PRIVATE N_NIMCALL(void, addInt__stdZprivateZdigitsutils_u178)(NimStringV2* result_p0, NI64 x_p1) {
314 NU64 numX60gensym3_;
315 numX60gensym3_ = (NU64)0;
316 {
317 if (!(x_p1 < IL64(0))) goto LA3_;
318 {
319 if (!(x_p1 == (IL64(-9223372036854775807) - IL64(1)))) goto LA7_;
320 numX60gensym3_ = ((NU64) (x_p1));
321 }
322 goto LA5_;
323LA7_: ;
324 {
325 numX60gensym3_ = ((NU64) (-(x_p1)));
326 }
327LA5_: ;
328 nimAddCharV1((&(*result_p0)), 45);
329 }
330 goto LA1_;
331LA3_: ;
332 {
333 numX60gensym3_ = ((NU64) (x_p1));
334 }
335LA1_: ;
336 addInt__stdZprivateZdigitsutils_u175(result_p0, numX60gensym3_);
337}