mirror of
https://github.com/waku-org/nwaku.git
synced 2025-01-16 01:45:40 +00:00
584 lines
37 KiB
C
584 lines
37 KiB
C
/* Generated by Nim Compiler v1.2.6 */
|
|
/* (c) 2020 Andreas Rumpf */
|
|
/* The generated code is subject to the original license. */
|
|
/* Compiled for: Linux, amd64, gcc */
|
|
/* Command for C compiler:
|
|
gcc -c -w -pthread -I/home/runner/work/nim-waku/nim-waku/vendor/nim-libbacktrace -I/home/runner/work/nim-waku/nim-waku/vendor/nim-libbacktrace/install/usr/include -I/home/runner/work/nim-waku/nim-waku/vendor/nim-secp256k1/secp256k1_wrapper -I/home/runner/work/nim-waku/nim-waku/vendor/nim-secp256k1/secp256k1_wrapper/secp256k1 -I/home/runner/work/nim-waku/nim-waku/vendor/nim-secp256k1/secp256k1_wrapper/secp256k1/src -DHAVE_CONFIG_H -DHAVE_BUILTIN_EXPECT -I/home/runner/work/nim-waku/nim-waku/vendor/nim-bearssl/bearssl/csources/src -I/home/runner/work/nim-waku/nim-waku/vendor/nim-bearssl/bearssl/csources/inc -I/home/runner/work/nim-waku/nim-waku/vendor/nim-bearssl/bearssl/csources/tools -DBR_USE_UNIX_TIME=1 -DBR_USE_URANDOM=1 -DBR_LE_UNALIGNED=1 -DBR_64=1 -DBR_amd64=1 -DBR_INT128=1 -I/home/runner/work/nim-waku/nim-waku/vendor/nim-nat-traversal/vendor/miniupnp/miniupnpc -I/home/runner/work/nim-waku/nim-waku/vendor/nim-nat-traversal/vendor/libnatpmp-upstream -DENABLE_STRNATPMPERR -march=native -g3 -Og -O3 -fno-strict-aliasing -fno-ident -I/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib -I/home/runner/work/nim-waku/nim-waku/waku/common -o nimcache/release/wakubridge/@m..@s..@svendor@snim-libp2p@slibp2p@svarint.nim.c.o nimcache/release/wakubridge/@m..@s..@svendor@snim-libp2p@slibp2p@svarint.nim.c */
|
|
#define NIM_INTBITS 64
|
|
|
|
#include "nimbase.h"
|
|
#include <string.h>
|
|
#undef LANGUAGE_C
|
|
#undef MIPSEB
|
|
#undef MIPSEL
|
|
#undef PPC
|
|
#undef R3000
|
|
#undef R4000
|
|
#undef i386
|
|
#undef linux
|
|
#undef mips
|
|
#undef near
|
|
#undef far
|
|
#undef powerpc
|
|
#undef unix
|
|
#define nimfr_(x, y)
|
|
#define nimln_(x, y)
|
|
typedef struct tyObject_Result__EU2D85u1tT2g3bs9aUSzTHw tyObject_Result__EU2D85u1tT2g3bs9aUSzTHw;
|
|
typedef struct tyTuple__lQTEq64iYzLA0LTdjMrTyA tyTuple__lQTEq64iYzLA0LTdjMrTyA;
|
|
typedef struct tyObject_Leb128Buf__GUQ4yCTJYfeDKXfLstDw9cg tyObject_Leb128Buf__GUQ4yCTJYfeDKXfLstDw9cg;
|
|
typedef struct tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA;
|
|
typedef struct tyObject_Leb128Buf__9bzW7WZ9baNLvEUq6EAZWcQQ tyObject_Leb128Buf__9bzW7WZ9baNLvEUq6EAZWcQQ;
|
|
typedef struct TNimType TNimType;
|
|
typedef struct TNimNode TNimNode;
|
|
typedef struct tyTuple__VUQsm9bkd3EZ53SlvlfA4ZQ tyTuple__VUQsm9bkd3EZ53SlvlfA4ZQ;
|
|
typedef struct tyObject_Leb128Buf__IkNc4bkGf4WAP3MnRXuR6A tyObject_Leb128Buf__IkNc4bkGf4WAP3MnRXuR6A;
|
|
typedef NU8 tyEnum_VarintError__z9coCVKRSy09c3xCpPfzuFKg;
|
|
struct tyObject_Result__EU2D85u1tT2g3bs9aUSzTHw {NIM_BOOL o;
|
|
union{
|
|
struct {tyEnum_VarintError__z9coCVKRSy09c3xCpPfzuFKg e;
|
|
} _o_1;
|
|
};
|
|
};
|
|
struct tyTuple__lQTEq64iYzLA0LTdjMrTyA {
|
|
NU64 Field0;
|
|
NI8 Field1;
|
|
};
|
|
typedef NU8 tyArray__aczTGVLbkjaI8GxGYP6HtA[10];
|
|
struct tyObject_Leb128Buf__GUQ4yCTJYfeDKXfLstDw9cg {tyArray__aczTGVLbkjaI8GxGYP6HtA data;
|
|
NI8 len;
|
|
};
|
|
struct tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA {NI a;
|
|
NI b;
|
|
};
|
|
struct tyObject_Leb128Buf__9bzW7WZ9baNLvEUq6EAZWcQQ {tyArray__aczTGVLbkjaI8GxGYP6HtA data;
|
|
NI8 len;
|
|
};
|
|
typedef NU8 tyEnum_TNimKind__jIBKr1ejBgsfM33Kxw4j7A;
|
|
typedef NU8 tySet_tyEnum_TNimTypeFlag__v8QUszD1sWlSIWZz7mC4bQ;
|
|
typedef N_NIMCALL_PTR(void, tyProc__ojoeKfW4VYIm36I9cpDTQIg) (void* p, NI op);
|
|
typedef N_NIMCALL_PTR(void*, tyProc__WSm2xU5ARYv9aAR4l0z9c9auQ) (void* p);
|
|
struct TNimType {NI size;
|
|
tyEnum_TNimKind__jIBKr1ejBgsfM33Kxw4j7A kind;
|
|
tySet_tyEnum_TNimTypeFlag__v8QUszD1sWlSIWZz7mC4bQ flags;
|
|
TNimType* base;
|
|
TNimNode* node;
|
|
void* finalizer;
|
|
tyProc__ojoeKfW4VYIm36I9cpDTQIg marker;
|
|
tyProc__WSm2xU5ARYv9aAR4l0z9c9auQ deepcopy;
|
|
NCSTRING name;
|
|
TNimType* nextType;
|
|
NI instances;
|
|
NI sizes;
|
|
};
|
|
struct tyTuple__VUQsm9bkd3EZ53SlvlfA4ZQ {
|
|
NU32 Field0;
|
|
NI8 Field1;
|
|
};
|
|
typedef NU8 tyArray__39cnIm4v9c7pQp5XFRxTMpFg[5];
|
|
struct tyObject_Leb128Buf__IkNc4bkGf4WAP3MnRXuR6A {tyArray__39cnIm4v9c7pQp5XFRxTMpFg data;
|
|
NI8 len;
|
|
};
|
|
typedef NU8 tyEnum_TNimNodeKind__unfNsxrcATrufDZmpBq4HQ;
|
|
struct TNimNode {tyEnum_TNimNodeKind__unfNsxrcATrufDZmpBq4HQ kind;
|
|
NI offset;
|
|
TNimType* typ;
|
|
NCSTRING name;
|
|
NI len;
|
|
TNimNode** sons;
|
|
};
|
|
static N_INLINE(void, nimZeroMem)(void* p, NI size);
|
|
static N_INLINE(void, nimSetMem__zxfKBYntu9cBapkhrCOk1fgmemory)(void* a, int v, NI size);
|
|
N_LIB_PRIVATE N_NIMCALL(tyTuple__lQTEq64iYzLA0LTdjMrTyA, fromBytes__7hWUjMBxLj9cxfulyDO6OAA)(NU8* x_0, NI x_0Len_0);
|
|
N_LIB_PRIVATE N_NOINLINE(void, chckNil)(void* p);
|
|
static N_INLINE(NI, vsizeof__LNrGVKzYZfjqZfKsinkR9bwvarint)(NU64 x_0);
|
|
N_LIB_PRIVATE N_NIMCALL(NI8, len__pONbWCTj2wIjLBtK9b8oQ3w)(NU64 x_0);
|
|
N_LIB_PRIVATE N_NIMCALL(tyObject_Leb128Buf__GUQ4yCTJYfeDKXfLstDw9cg, toBytes__iuJK1yQKhkDEFO4aAbuyeA)(NU v);
|
|
N_LIB_PRIVATE N_NIMCALL(void, X5BX5Deq___PcCQmAfdUds9cWGauPahR7Q)(NU8* r, NI rLen_0, tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA s_0, NU8* v, NI vLen_0);
|
|
static N_INLINE(tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA, dotdot___BokNSDrKN1xmV1nA01G9brAsystem)(NI a, NI b);
|
|
N_LIB_PRIVATE N_NOINLINE(void, raiseOverflow)(void);
|
|
N_LIB_PRIVATE N_NOINLINE(void, raiseIndexError)(void);
|
|
N_LIB_PRIVATE N_NIMCALL(tyObject_Leb128Buf__9bzW7WZ9baNLvEUq6EAZWcQQ, toBytes__hhUsu00DKWf733XDSXxiMg)(NU64 v);
|
|
N_LIB_PRIVATE N_NIMCALL(tyTuple__VUQsm9bkd3EZ53SlvlfA4ZQ, fromBytes__IwPEtyYwTpDiRz9by9bukxfQ)(NU8* x_0, NI x_0Len_0);
|
|
static N_INLINE(NI, vsizeof__2zTrmYvoZcmBNl78sO7TzQvarint)(NU32 x_0);
|
|
N_LIB_PRIVATE N_NIMCALL(NI8, len__WD9a0uECGrMHWiosRqbXCUA)(NU32 x_0);
|
|
N_LIB_PRIVATE N_NIMCALL(tyObject_Leb128Buf__IkNc4bkGf4WAP3MnRXuR6A, toBytes__dFw3qTueyDF4xOoJG1kSPw)(NU32 v);
|
|
N_LIB_PRIVATE TNimType NTI__z9coCVKRSy09c3xCpPfzuFKg_;
|
|
extern TNimType* nimTypeRoot;
|
|
|
|
#line 22 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/system/memory.nim"
|
|
static N_INLINE(void, nimSetMem__zxfKBYntu9cBapkhrCOk1fgmemory)(void* a, int v, NI size) { void* T1_;
|
|
#line 24 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/system/memory.nim"
|
|
|
|
#line 24 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/system/memory.nim"
|
|
T1_ = (void*)0; T1_ = memset(a, v, ((size_t) (size)));}
|
|
|
|
#line 33 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/system/memory.nim"
|
|
static N_INLINE(void, nimZeroMem)(void* p, NI size) {
|
|
#line 34 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/system/memory.nim"
|
|
|
|
#line 34 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/system/memory.nim"
|
|
nimSetMem__zxfKBYntu9cBapkhrCOk1fgmemory(p, ((int) 0), size);
|
|
}
|
|
|
|
#line 101 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
static N_INLINE(NI, vsizeof__LNrGVKzYZfjqZfKsinkR9bwvarint)(NU64 x_0) { NI result; NI8 T1_; result = (NI)0;
|
|
#line 102 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
|
|
#line 103 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
|
|
#line 103 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
T1_ = (NI8)0; T1_ = len__pONbWCTj2wIjLBtK9b8oQ3w(x_0); result = ((NI) (T1_)); return result;}
|
|
|
|
#line 105 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
N_LIB_PRIVATE N_NIMCALL(tyObject_Result__EU2D85u1tT2g3bs9aUSzTHw, getUVarint__8Fv9a4AsBnhOSlTNa6xhluw)(NU8* pbytes, NI pbytesLen_0, NI* outlen, NU64* outval) { tyObject_Result__EU2D85u1tT2g3bs9aUSzTHw result; tyTuple__lQTEq64iYzLA0LTdjMrTyA parsed; tyTuple__lQTEq64iYzLA0LTdjMrTyA _;{ nimZeroMem((void*)(&result), sizeof(tyObject_Result__EU2D85u1tT2g3bs9aUSzTHw));
|
|
#line 109 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
|
|
#line 130 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
(*outlen) = ((NI) 0);
|
|
#line 131 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
(*outval) = 0ULL;
|
|
#line 133 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
|
|
#line 133 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
parsed = fromBytes__7hWUjMBxLj9cxfulyDO6OAA(pbytes, pbytesLen_0);
|
|
#line 135 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
{
|
|
#line 135 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
if (!(parsed.Field1 == ((NI8) 0))) goto LA3_;
|
|
|
|
#line 136 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
|
|
#line 136 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
chckNil((void*)(&result)); nimZeroMem((void*)(&result), sizeof(tyObject_Result__EU2D85u1tT2g3bs9aUSzTHw)); result.o = NIM_FALSE; result._o_1.e = ((tyEnum_VarintError__z9coCVKRSy09c3xCpPfzuFKg) 2); goto BeforeRet_;
|
|
}
|
|
LA3_: ;
|
|
|
|
#line 137 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
{
|
|
#line 137 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
if (!(parsed.Field1 < ((NI8) 0))) goto LA7_;
|
|
|
|
#line 138 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
|
|
#line 138 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
chckNil((void*)(&result)); nimZeroMem((void*)(&result), sizeof(tyObject_Result__EU2D85u1tT2g3bs9aUSzTHw)); result.o = NIM_FALSE; result._o_1.e = ((tyEnum_VarintError__z9coCVKRSy09c3xCpPfzuFKg) 1); goto BeforeRet_;
|
|
}
|
|
LA7_: ;
|
|
|
|
#line 141 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
{
|
|
#line 141 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
if (!((NU64)(9223372036854775808ULL) <= (NU64)(parsed.Field0))) goto LA11_;
|
|
|
|
#line 142 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
|
|
#line 142 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
chckNil((void*)(&result)); nimZeroMem((void*)(&result), sizeof(tyObject_Result__EU2D85u1tT2g3bs9aUSzTHw)); result.o = NIM_FALSE; result._o_1.e = ((tyEnum_VarintError__z9coCVKRSy09c3xCpPfzuFKg) 1); goto BeforeRet_;
|
|
}
|
|
LA11_: ;
|
|
|
|
#line 144 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
{ NI T15_;
|
|
#line 144 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
|
|
#line 144 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
|
|
#line 144 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
|
|
#line 144 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
T15_ = (NI)0; T15_ = vsizeof__LNrGVKzYZfjqZfKsinkR9bwvarint(parsed.Field0); if (!!((T15_ == ((NI) (parsed.Field1))))) goto LA16_;
|
|
|
|
#line 145 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
|
|
#line 145 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
chckNil((void*)(&result)); nimZeroMem((void*)(&result), sizeof(tyObject_Result__EU2D85u1tT2g3bs9aUSzTHw)); result.o = NIM_FALSE; result._o_1.e = ((tyEnum_VarintError__z9coCVKRSy09c3xCpPfzuFKg) 3); goto BeforeRet_;
|
|
}
|
|
LA16_: ;
|
|
|
|
#line 147 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
_ = parsed;
|
|
#line 147 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
(*outval) = _.Field0;
|
|
#line 147 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
(*outlen) = ((NI) (_.Field1)); chckNil((void*)(&result)); nimZeroMem((void*)(&result), sizeof(tyObject_Result__EU2D85u1tT2g3bs9aUSzTHw)); result.o = NIM_TRUE; }BeforeRet_: ;
|
|
return result;}
|
|
|
|
#line 459 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/system.nim"
|
|
static N_INLINE(tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA, dotdot___BokNSDrKN1xmV1nA01G9brAsystem)(NI a, NI b) { tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA result; nimZeroMem((void*)(&result), sizeof(tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA));
|
|
#line 469 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/system.nim"
|
|
chckNil((void*)(&result)); nimZeroMem((void*)(&result), sizeof(tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA)); result.a = a; result.b = b; return result;}
|
|
|
|
#line 151 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
N_LIB_PRIVATE N_NIMCALL(tyObject_Result__EU2D85u1tT2g3bs9aUSzTHw, putUVarint__otpik4CuaU29aQKjm9bz9c2Qg)(NU8* pbytes, NI pbytesLen_0, NI* outlen, NU outval) { tyObject_Result__EU2D85u1tT2g3bs9aUSzTHw result; tyObject_Leb128Buf__GUQ4yCTJYfeDKXfLstDw9cg bytes;{ nimZeroMem((void*)(&result), sizeof(tyObject_Result__EU2D85u1tT2g3bs9aUSzTHw));
|
|
#line 155 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
|
|
#line 172 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
{
|
|
#line 172 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
|
|
#line 172 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
|
|
#line 172 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
if (!!(((NU64)(((NU64) (outval)) & 9223372036854775808ULL) == 0ULL))) goto LA3_;
|
|
|
|
#line 173 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
|
|
#line 173 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
chckNil((void*)(&result)); nimZeroMem((void*)(&result), sizeof(tyObject_Result__EU2D85u1tT2g3bs9aUSzTHw)); result.o = NIM_FALSE; result._o_1.e = ((tyEnum_VarintError__z9coCVKRSy09c3xCpPfzuFKg) 1); goto BeforeRet_;
|
|
}
|
|
LA3_: ;
|
|
|
|
#line 175 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
|
|
#line 175 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
bytes = toBytes__iuJK1yQKhkDEFO4aAbuyeA(outval);
|
|
#line 176 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
(*outlen) = ((NI) (bytes.len));
|
|
#line 177 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
{ NI TM__BEZ6VAYlsKWY2hLQE9cF1AQ_2; tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA T9_; NI TM__BEZ6VAYlsKWY2hLQE9cF1AQ_3;
|
|
#line 177 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
|
|
#line 177 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
if (!((*outlen) <= pbytesLen_0)) goto LA7_;
|
|
|
|
#line 178 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
|
|
#line 178 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
|
|
#line 2406 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/system.nim"
|
|
if (nimSubInt((*outlen), ((NI) 1), &TM__BEZ6VAYlsKWY2hLQE9cF1AQ_2)) { raiseOverflow(); };
|
|
#line 178 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
T9_ = dotdot___BokNSDrKN1xmV1nA01G9brAsystem(((NI) 0), (NI)(TM__BEZ6VAYlsKWY2hLQE9cF1AQ_2));
|
|
#line 154 "/home/runner/work/nim-waku/nim-waku/vendor/nim-stew/stew/leb128.nim"
|
|
if (nimSubInt(bytes.len, ((NI8) 1), &TM__BEZ6VAYlsKWY2hLQE9cF1AQ_3)) { raiseOverflow(); }; if (TM__BEZ6VAYlsKWY2hLQE9cF1AQ_3 < -128 || TM__BEZ6VAYlsKWY2hLQE9cF1AQ_3 > 127){ raiseOverflow(); } if (((NI) ((NI8)(TM__BEZ6VAYlsKWY2hLQE9cF1AQ_3)))-((NI) 0) != -1 && (((NI) ((NI8)(TM__BEZ6VAYlsKWY2hLQE9cF1AQ_3)))-((NI) 0) < -1 || ((NI) 0) < 0 || ((NI) 0) > 9 || ((NI) ((NI8)(TM__BEZ6VAYlsKWY2hLQE9cF1AQ_3))) < 0 || ((NI) ((NI8)(TM__BEZ6VAYlsKWY2hLQE9cF1AQ_3))) > 9)){ raiseIndexError(); }
|
|
#line 178 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
X5BX5Deq___PcCQmAfdUds9cWGauPahR7Q(pbytes, pbytesLen_0, T9_, (NU8*)((bytes.data)+(((NI) 0))), (((NI) ((NI8)(TM__BEZ6VAYlsKWY2hLQE9cF1AQ_3))))-(((NI) 0))+1);
|
|
chckNil((void*)(&result)); nimZeroMem((void*)(&result), sizeof(tyObject_Result__EU2D85u1tT2g3bs9aUSzTHw)); result.o = NIM_TRUE; }
|
|
goto LA5_;
|
|
LA7_: ;
|
|
{ chckNil((void*)(&result)); nimZeroMem((void*)(&result), sizeof(tyObject_Result__EU2D85u1tT2g3bs9aUSzTHw)); result.o = NIM_FALSE; result._o_1.e = ((tyEnum_VarintError__z9coCVKRSy09c3xCpPfzuFKg) 4); }
|
|
LA5_: ;
|
|
}BeforeRet_: ;
|
|
return result;}
|
|
|
|
#line 151 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
N_LIB_PRIVATE N_NIMCALL(tyObject_Result__EU2D85u1tT2g3bs9aUSzTHw, putUVarint__h0KNoWke9cXqQmQoqHzdBfg)(NU8* pbytes, NI pbytesLen_0, NI* outlen, NU64 outval) { tyObject_Result__EU2D85u1tT2g3bs9aUSzTHw result; tyObject_Leb128Buf__9bzW7WZ9baNLvEUq6EAZWcQQ bytes;{ nimZeroMem((void*)(&result), sizeof(tyObject_Result__EU2D85u1tT2g3bs9aUSzTHw));
|
|
#line 155 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
|
|
#line 172 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
{
|
|
#line 172 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
|
|
#line 172 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
|
|
#line 172 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
if (!!(((NU64)(outval & 9223372036854775808ULL) == 0ULL))) goto LA3_;
|
|
|
|
#line 173 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
|
|
#line 173 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
chckNil((void*)(&result)); nimZeroMem((void*)(&result), sizeof(tyObject_Result__EU2D85u1tT2g3bs9aUSzTHw)); result.o = NIM_FALSE; result._o_1.e = ((tyEnum_VarintError__z9coCVKRSy09c3xCpPfzuFKg) 1); goto BeforeRet_;
|
|
}
|
|
LA3_: ;
|
|
|
|
#line 175 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
|
|
#line 175 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
bytes = toBytes__hhUsu00DKWf733XDSXxiMg(outval);
|
|
#line 176 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
(*outlen) = ((NI) (bytes.len));
|
|
#line 177 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
{ NI TM__BEZ6VAYlsKWY2hLQE9cF1AQ_4; tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA T9_; NI TM__BEZ6VAYlsKWY2hLQE9cF1AQ_5;
|
|
#line 177 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
|
|
#line 177 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
if (!((*outlen) <= pbytesLen_0)) goto LA7_;
|
|
|
|
#line 178 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
|
|
#line 178 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
|
|
#line 2406 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/system.nim"
|
|
if (nimSubInt((*outlen), ((NI) 1), &TM__BEZ6VAYlsKWY2hLQE9cF1AQ_4)) { raiseOverflow(); };
|
|
#line 178 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
T9_ = dotdot___BokNSDrKN1xmV1nA01G9brAsystem(((NI) 0), (NI)(TM__BEZ6VAYlsKWY2hLQE9cF1AQ_4));
|
|
#line 154 "/home/runner/work/nim-waku/nim-waku/vendor/nim-stew/stew/leb128.nim"
|
|
if (nimSubInt(bytes.len, ((NI8) 1), &TM__BEZ6VAYlsKWY2hLQE9cF1AQ_5)) { raiseOverflow(); }; if (TM__BEZ6VAYlsKWY2hLQE9cF1AQ_5 < -128 || TM__BEZ6VAYlsKWY2hLQE9cF1AQ_5 > 127){ raiseOverflow(); } if (((NI) ((NI8)(TM__BEZ6VAYlsKWY2hLQE9cF1AQ_5)))-((NI) 0) != -1 && (((NI) ((NI8)(TM__BEZ6VAYlsKWY2hLQE9cF1AQ_5)))-((NI) 0) < -1 || ((NI) 0) < 0 || ((NI) 0) > 9 || ((NI) ((NI8)(TM__BEZ6VAYlsKWY2hLQE9cF1AQ_5))) < 0 || ((NI) ((NI8)(TM__BEZ6VAYlsKWY2hLQE9cF1AQ_5))) > 9)){ raiseIndexError(); }
|
|
#line 178 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
X5BX5Deq___PcCQmAfdUds9cWGauPahR7Q(pbytes, pbytesLen_0, T9_, (NU8*)((bytes.data)+(((NI) 0))), (((NI) ((NI8)(TM__BEZ6VAYlsKWY2hLQE9cF1AQ_5))))-(((NI) 0))+1);
|
|
chckNil((void*)(&result)); nimZeroMem((void*)(&result), sizeof(tyObject_Result__EU2D85u1tT2g3bs9aUSzTHw)); result.o = NIM_TRUE; }
|
|
goto LA5_;
|
|
LA7_: ;
|
|
{ chckNil((void*)(&result)); nimZeroMem((void*)(&result), sizeof(tyObject_Result__EU2D85u1tT2g3bs9aUSzTHw)); result.o = NIM_FALSE; result._o_1.e = ((tyEnum_VarintError__z9coCVKRSy09c3xCpPfzuFKg) 4); }
|
|
LA5_: ;
|
|
}BeforeRet_: ;
|
|
return result;}
|
|
|
|
#line 151 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
N_LIB_PRIVATE N_NIMCALL(tyObject_Result__EU2D85u1tT2g3bs9aUSzTHw, putUVarint__6fSC1OMzKIBn5lnSoZxaJg)(NU8* pbytes, NI pbytesLen_0, NI* outlen, NU64 outval) { tyObject_Result__EU2D85u1tT2g3bs9aUSzTHw result; tyObject_Leb128Buf__9bzW7WZ9baNLvEUq6EAZWcQQ bytes; nimZeroMem((void*)(&result), sizeof(tyObject_Result__EU2D85u1tT2g3bs9aUSzTHw));
|
|
#line 155 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
|
|
#line 175 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
|
|
#line 175 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
bytes = toBytes__hhUsu00DKWf733XDSXxiMg(outval);
|
|
#line 176 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
(*outlen) = ((NI) (bytes.len));
|
|
#line 177 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
{ NI TM__BEZ6VAYlsKWY2hLQE9cF1AQ_6; tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA T5_; NI TM__BEZ6VAYlsKWY2hLQE9cF1AQ_7;
|
|
#line 177 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
|
|
#line 177 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
if (!((*outlen) <= pbytesLen_0)) goto LA3_;
|
|
|
|
#line 178 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
|
|
#line 178 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
|
|
#line 2406 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/system.nim"
|
|
if (nimSubInt((*outlen), ((NI) 1), &TM__BEZ6VAYlsKWY2hLQE9cF1AQ_6)) { raiseOverflow(); };
|
|
#line 178 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
T5_ = dotdot___BokNSDrKN1xmV1nA01G9brAsystem(((NI) 0), (NI)(TM__BEZ6VAYlsKWY2hLQE9cF1AQ_6));
|
|
#line 154 "/home/runner/work/nim-waku/nim-waku/vendor/nim-stew/stew/leb128.nim"
|
|
if (nimSubInt(bytes.len, ((NI8) 1), &TM__BEZ6VAYlsKWY2hLQE9cF1AQ_7)) { raiseOverflow(); }; if (TM__BEZ6VAYlsKWY2hLQE9cF1AQ_7 < -128 || TM__BEZ6VAYlsKWY2hLQE9cF1AQ_7 > 127){ raiseOverflow(); } if (((NI) ((NI8)(TM__BEZ6VAYlsKWY2hLQE9cF1AQ_7)))-((NI) 0) != -1 && (((NI) ((NI8)(TM__BEZ6VAYlsKWY2hLQE9cF1AQ_7)))-((NI) 0) < -1 || ((NI) 0) < 0 || ((NI) 0) > 9 || ((NI) ((NI8)(TM__BEZ6VAYlsKWY2hLQE9cF1AQ_7))) < 0 || ((NI) ((NI8)(TM__BEZ6VAYlsKWY2hLQE9cF1AQ_7))) > 9)){ raiseIndexError(); }
|
|
#line 178 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
X5BX5Deq___PcCQmAfdUds9cWGauPahR7Q(pbytes, pbytesLen_0, T5_, (NU8*)((bytes.data)+(((NI) 0))), (((NI) ((NI8)(TM__BEZ6VAYlsKWY2hLQE9cF1AQ_7))))-(((NI) 0))+1);
|
|
chckNil((void*)(&result)); nimZeroMem((void*)(&result), sizeof(tyObject_Result__EU2D85u1tT2g3bs9aUSzTHw)); result.o = NIM_TRUE; }
|
|
goto LA1_;
|
|
LA3_: ;
|
|
{ chckNil((void*)(&result)); nimZeroMem((void*)(&result), sizeof(tyObject_Result__EU2D85u1tT2g3bs9aUSzTHw)); result.o = NIM_FALSE; result._o_1.e = ((tyEnum_VarintError__z9coCVKRSy09c3xCpPfzuFKg) 4); }
|
|
LA1_: ;
|
|
return result;}
|
|
|
|
#line 151 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
N_LIB_PRIVATE N_NIMCALL(tyObject_Result__EU2D85u1tT2g3bs9aUSzTHw, putUVarint__79azrOXTpUUttfPZGnOajHw)(NU8* pbytes, NI pbytesLen_0, NI* outlen, NU outval) { tyObject_Result__EU2D85u1tT2g3bs9aUSzTHw result; tyObject_Leb128Buf__GUQ4yCTJYfeDKXfLstDw9cg bytes; nimZeroMem((void*)(&result), sizeof(tyObject_Result__EU2D85u1tT2g3bs9aUSzTHw));
|
|
#line 155 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
|
|
#line 175 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
|
|
#line 175 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
bytes = toBytes__iuJK1yQKhkDEFO4aAbuyeA(outval);
|
|
#line 176 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
(*outlen) = ((NI) (bytes.len));
|
|
#line 177 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
{ NI TM__BEZ6VAYlsKWY2hLQE9cF1AQ_8; tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA T5_; NI TM__BEZ6VAYlsKWY2hLQE9cF1AQ_9;
|
|
#line 177 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
|
|
#line 177 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
if (!((*outlen) <= pbytesLen_0)) goto LA3_;
|
|
|
|
#line 178 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
|
|
#line 178 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
|
|
#line 2406 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/system.nim"
|
|
if (nimSubInt((*outlen), ((NI) 1), &TM__BEZ6VAYlsKWY2hLQE9cF1AQ_8)) { raiseOverflow(); };
|
|
#line 178 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
T5_ = dotdot___BokNSDrKN1xmV1nA01G9brAsystem(((NI) 0), (NI)(TM__BEZ6VAYlsKWY2hLQE9cF1AQ_8));
|
|
#line 154 "/home/runner/work/nim-waku/nim-waku/vendor/nim-stew/stew/leb128.nim"
|
|
if (nimSubInt(bytes.len, ((NI8) 1), &TM__BEZ6VAYlsKWY2hLQE9cF1AQ_9)) { raiseOverflow(); }; if (TM__BEZ6VAYlsKWY2hLQE9cF1AQ_9 < -128 || TM__BEZ6VAYlsKWY2hLQE9cF1AQ_9 > 127){ raiseOverflow(); } if (((NI) ((NI8)(TM__BEZ6VAYlsKWY2hLQE9cF1AQ_9)))-((NI) 0) != -1 && (((NI) ((NI8)(TM__BEZ6VAYlsKWY2hLQE9cF1AQ_9)))-((NI) 0) < -1 || ((NI) 0) < 0 || ((NI) 0) > 9 || ((NI) ((NI8)(TM__BEZ6VAYlsKWY2hLQE9cF1AQ_9))) < 0 || ((NI) ((NI8)(TM__BEZ6VAYlsKWY2hLQE9cF1AQ_9))) > 9)){ raiseIndexError(); }
|
|
#line 178 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
X5BX5Deq___PcCQmAfdUds9cWGauPahR7Q(pbytes, pbytesLen_0, T5_, (NU8*)((bytes.data)+(((NI) 0))), (((NI) ((NI8)(TM__BEZ6VAYlsKWY2hLQE9cF1AQ_9))))-(((NI) 0))+1);
|
|
chckNil((void*)(&result)); nimZeroMem((void*)(&result), sizeof(tyObject_Result__EU2D85u1tT2g3bs9aUSzTHw)); result.o = NIM_TRUE; }
|
|
goto LA1_;
|
|
LA3_: ;
|
|
{ chckNil((void*)(&result)); nimZeroMem((void*)(&result), sizeof(tyObject_Result__EU2D85u1tT2g3bs9aUSzTHw)); result.o = NIM_FALSE; result._o_1.e = ((tyEnum_VarintError__z9coCVKRSy09c3xCpPfzuFKg) 4); }
|
|
LA1_: ;
|
|
return result;}
|
|
|
|
#line 105 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
N_LIB_PRIVATE N_NIMCALL(tyObject_Result__EU2D85u1tT2g3bs9aUSzTHw, getUVarint__irgrvfGvsIuSOWcovCjqrQ)(NU8* pbytes, NI pbytesLen_0, NI* outlen, NU64* outval) { tyObject_Result__EU2D85u1tT2g3bs9aUSzTHw result; tyTuple__lQTEq64iYzLA0LTdjMrTyA parsed; tyTuple__lQTEq64iYzLA0LTdjMrTyA _;{ nimZeroMem((void*)(&result), sizeof(tyObject_Result__EU2D85u1tT2g3bs9aUSzTHw));
|
|
#line 109 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
|
|
#line 130 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
(*outlen) = ((NI) 0);
|
|
#line 131 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
(*outval) = 0ULL;
|
|
#line 133 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
|
|
#line 133 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
parsed = fromBytes__7hWUjMBxLj9cxfulyDO6OAA(pbytes, pbytesLen_0);
|
|
#line 135 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
{
|
|
#line 135 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
if (!(parsed.Field1 == ((NI8) 0))) goto LA3_;
|
|
|
|
#line 136 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
|
|
#line 136 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
chckNil((void*)(&result)); nimZeroMem((void*)(&result), sizeof(tyObject_Result__EU2D85u1tT2g3bs9aUSzTHw)); result.o = NIM_FALSE; result._o_1.e = ((tyEnum_VarintError__z9coCVKRSy09c3xCpPfzuFKg) 2); goto BeforeRet_;
|
|
}
|
|
LA3_: ;
|
|
|
|
#line 137 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
{
|
|
#line 137 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
if (!(parsed.Field1 < ((NI8) 0))) goto LA7_;
|
|
|
|
#line 138 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
|
|
#line 138 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
chckNil((void*)(&result)); nimZeroMem((void*)(&result), sizeof(tyObject_Result__EU2D85u1tT2g3bs9aUSzTHw)); result.o = NIM_FALSE; result._o_1.e = ((tyEnum_VarintError__z9coCVKRSy09c3xCpPfzuFKg) 1); goto BeforeRet_;
|
|
}
|
|
LA7_: ;
|
|
|
|
#line 144 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
{ NI T11_;
|
|
#line 144 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
|
|
#line 144 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
|
|
#line 144 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
|
|
#line 144 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
T11_ = (NI)0; T11_ = vsizeof__LNrGVKzYZfjqZfKsinkR9bwvarint(parsed.Field0); if (!!((T11_ == ((NI) (parsed.Field1))))) goto LA12_;
|
|
|
|
#line 145 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
|
|
#line 145 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
chckNil((void*)(&result)); nimZeroMem((void*)(&result), sizeof(tyObject_Result__EU2D85u1tT2g3bs9aUSzTHw)); result.o = NIM_FALSE; result._o_1.e = ((tyEnum_VarintError__z9coCVKRSy09c3xCpPfzuFKg) 3); goto BeforeRet_;
|
|
}
|
|
LA12_: ;
|
|
|
|
#line 147 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
_ = parsed;
|
|
#line 147 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
(*outval) = _.Field0;
|
|
#line 147 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
(*outlen) = ((NI) (_.Field1)); chckNil((void*)(&result)); nimZeroMem((void*)(&result), sizeof(tyObject_Result__EU2D85u1tT2g3bs9aUSzTHw)); result.o = NIM_TRUE; }BeforeRet_: ;
|
|
return result;}
|
|
|
|
#line 101 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
static N_INLINE(NI, vsizeof__2zTrmYvoZcmBNl78sO7TzQvarint)(NU32 x_0) { NI result; NI8 T1_; result = (NI)0;
|
|
#line 102 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
|
|
#line 103 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
|
|
#line 103 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
T1_ = (NI8)0; T1_ = len__WD9a0uECGrMHWiosRqbXCUA(x_0); result = ((NI) (T1_)); return result;}
|
|
|
|
#line 105 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
N_LIB_PRIVATE N_NIMCALL(tyObject_Result__EU2D85u1tT2g3bs9aUSzTHw, getUVarint__2jxG3MQKi8ath9apRdHCjlw)(NU8* pbytes, NI pbytesLen_0, NI* outlen, NU32* outval) { tyObject_Result__EU2D85u1tT2g3bs9aUSzTHw result; tyTuple__VUQsm9bkd3EZ53SlvlfA4ZQ parsed; tyTuple__VUQsm9bkd3EZ53SlvlfA4ZQ _;{ nimZeroMem((void*)(&result), sizeof(tyObject_Result__EU2D85u1tT2g3bs9aUSzTHw));
|
|
#line 109 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
|
|
#line 130 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
(*outlen) = ((NI) 0);
|
|
#line 131 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
(*outval) = ((NU32) 0);
|
|
#line 133 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
|
|
#line 133 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
parsed = fromBytes__IwPEtyYwTpDiRz9by9bukxfQ(pbytes, pbytesLen_0);
|
|
#line 135 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
{
|
|
#line 135 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
if (!(parsed.Field1 == ((NI8) 0))) goto LA3_;
|
|
|
|
#line 136 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
|
|
#line 136 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
chckNil((void*)(&result)); nimZeroMem((void*)(&result), sizeof(tyObject_Result__EU2D85u1tT2g3bs9aUSzTHw)); result.o = NIM_FALSE; result._o_1.e = ((tyEnum_VarintError__z9coCVKRSy09c3xCpPfzuFKg) 2); goto BeforeRet_;
|
|
}
|
|
LA3_: ;
|
|
|
|
#line 137 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
{
|
|
#line 137 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
if (!(parsed.Field1 < ((NI8) 0))) goto LA7_;
|
|
|
|
#line 138 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
|
|
#line 138 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
chckNil((void*)(&result)); nimZeroMem((void*)(&result), sizeof(tyObject_Result__EU2D85u1tT2g3bs9aUSzTHw)); result.o = NIM_FALSE; result._o_1.e = ((tyEnum_VarintError__z9coCVKRSy09c3xCpPfzuFKg) 1); goto BeforeRet_;
|
|
}
|
|
LA7_: ;
|
|
|
|
#line 144 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
{ NI T11_;
|
|
#line 144 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
|
|
#line 144 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
|
|
#line 144 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
|
|
#line 144 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
T11_ = (NI)0; T11_ = vsizeof__2zTrmYvoZcmBNl78sO7TzQvarint(parsed.Field0); if (!!((T11_ == ((NI) (parsed.Field1))))) goto LA12_;
|
|
|
|
#line 145 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
|
|
#line 145 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
chckNil((void*)(&result)); nimZeroMem((void*)(&result), sizeof(tyObject_Result__EU2D85u1tT2g3bs9aUSzTHw)); result.o = NIM_FALSE; result._o_1.e = ((tyEnum_VarintError__z9coCVKRSy09c3xCpPfzuFKg) 3); goto BeforeRet_;
|
|
}
|
|
LA12_: ;
|
|
|
|
#line 147 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
_ = parsed;
|
|
#line 147 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
(*outval) = _.Field0;
|
|
#line 147 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
(*outlen) = ((NI) (_.Field1)); chckNil((void*)(&result)); nimZeroMem((void*)(&result), sizeof(tyObject_Result__EU2D85u1tT2g3bs9aUSzTHw)); result.o = NIM_TRUE; }BeforeRet_: ;
|
|
return result;}
|
|
|
|
#line 151 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
N_LIB_PRIVATE N_NIMCALL(tyObject_Result__EU2D85u1tT2g3bs9aUSzTHw, putUVarint__6wgd02z9bcJswAgk9b5FA4sA)(NU8* pbytes, NI pbytesLen_0, NI* outlen, NU32 outval) { tyObject_Result__EU2D85u1tT2g3bs9aUSzTHw result; tyObject_Leb128Buf__IkNc4bkGf4WAP3MnRXuR6A bytes; nimZeroMem((void*)(&result), sizeof(tyObject_Result__EU2D85u1tT2g3bs9aUSzTHw));
|
|
#line 155 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
|
|
#line 175 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
|
|
#line 175 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
bytes = toBytes__dFw3qTueyDF4xOoJG1kSPw(outval);
|
|
#line 176 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
(*outlen) = ((NI) (bytes.len));
|
|
#line 177 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
{ NI TM__BEZ6VAYlsKWY2hLQE9cF1AQ_13; tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA T5_; NI TM__BEZ6VAYlsKWY2hLQE9cF1AQ_14;
|
|
#line 177 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
|
|
#line 177 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
if (!((*outlen) <= pbytesLen_0)) goto LA3_;
|
|
|
|
#line 178 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
|
|
#line 178 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
|
|
#line 2406 "/home/runner/work/nim-waku/nim-waku/vendor/nimbus-build-system/vendor/Nim/lib/system.nim"
|
|
if (nimSubInt((*outlen), ((NI) 1), &TM__BEZ6VAYlsKWY2hLQE9cF1AQ_13)) { raiseOverflow(); };
|
|
#line 178 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
T5_ = dotdot___BokNSDrKN1xmV1nA01G9brAsystem(((NI) 0), (NI)(TM__BEZ6VAYlsKWY2hLQE9cF1AQ_13));
|
|
#line 154 "/home/runner/work/nim-waku/nim-waku/vendor/nim-stew/stew/leb128.nim"
|
|
if (nimSubInt(bytes.len, ((NI8) 1), &TM__BEZ6VAYlsKWY2hLQE9cF1AQ_14)) { raiseOverflow(); }; if (TM__BEZ6VAYlsKWY2hLQE9cF1AQ_14 < -128 || TM__BEZ6VAYlsKWY2hLQE9cF1AQ_14 > 127){ raiseOverflow(); } if (((NI) ((NI8)(TM__BEZ6VAYlsKWY2hLQE9cF1AQ_14)))-((NI) 0) != -1 && (((NI) ((NI8)(TM__BEZ6VAYlsKWY2hLQE9cF1AQ_14)))-((NI) 0) < -1 || ((NI) 0) < 0 || ((NI) 0) > 4 || ((NI) ((NI8)(TM__BEZ6VAYlsKWY2hLQE9cF1AQ_14))) < 0 || ((NI) ((NI8)(TM__BEZ6VAYlsKWY2hLQE9cF1AQ_14))) > 4)){ raiseIndexError(); }
|
|
#line 178 "/home/runner/work/nim-waku/nim-waku/vendor/nim-libp2p/libp2p/varint.nim"
|
|
X5BX5Deq___PcCQmAfdUds9cWGauPahR7Q(pbytes, pbytesLen_0, T5_, (NU8*)((bytes.data)+(((NI) 0))), (((NI) ((NI8)(TM__BEZ6VAYlsKWY2hLQE9cF1AQ_14))))-(((NI) 0))+1);
|
|
chckNil((void*)(&result)); nimZeroMem((void*)(&result), sizeof(tyObject_Result__EU2D85u1tT2g3bs9aUSzTHw)); result.o = NIM_TRUE; }
|
|
goto LA1_;
|
|
LA3_: ;
|
|
{ chckNil((void*)(&result)); nimZeroMem((void*)(&result), sizeof(tyObject_Result__EU2D85u1tT2g3bs9aUSzTHw)); result.o = NIM_FALSE; result._o_1.e = ((tyEnum_VarintError__z9coCVKRSy09c3xCpPfzuFKg) 4); }
|
|
LA1_: ;
|
|
return result;}
|
|
N_LIB_PRIVATE N_NIMCALL(void, libp2p_varintDatInit000)(void) {
|
|
|
|
#line 999999 "generated_not_to_break_here"
|
|
static TNimNode* TM__BEZ6VAYlsKWY2hLQE9cF1AQ_10_5[5];
|
|
NI TM__BEZ6VAYlsKWY2hLQE9cF1AQ_12;
|
|
static char* NIM_CONST TM__BEZ6VAYlsKWY2hLQE9cF1AQ_11[5] = {
|
|
"Error",
|
|
"Overflow",
|
|
"Incomplete",
|
|
"Overlong",
|
|
"Overrun"};
|
|
static TNimNode TM__BEZ6VAYlsKWY2hLQE9cF1AQ_0[6];NTI__z9coCVKRSy09c3xCpPfzuFKg_.size = sizeof(tyEnum_VarintError__z9coCVKRSy09c3xCpPfzuFKg);
|
|
NTI__z9coCVKRSy09c3xCpPfzuFKg_.kind = 14;
|
|
NTI__z9coCVKRSy09c3xCpPfzuFKg_.base = 0;
|
|
NTI__z9coCVKRSy09c3xCpPfzuFKg_.flags = 3;
|
|
NTI__z9coCVKRSy09c3xCpPfzuFKg_.name = "VarintError";
|
|
NTI__z9coCVKRSy09c3xCpPfzuFKg_.nextType = nimTypeRoot; nimTypeRoot=&NTI__z9coCVKRSy09c3xCpPfzuFKg_;
|
|
for (TM__BEZ6VAYlsKWY2hLQE9cF1AQ_12 = 0; TM__BEZ6VAYlsKWY2hLQE9cF1AQ_12 < 5; TM__BEZ6VAYlsKWY2hLQE9cF1AQ_12++) {
|
|
TM__BEZ6VAYlsKWY2hLQE9cF1AQ_0[TM__BEZ6VAYlsKWY2hLQE9cF1AQ_12+0].kind = 1;
|
|
TM__BEZ6VAYlsKWY2hLQE9cF1AQ_0[TM__BEZ6VAYlsKWY2hLQE9cF1AQ_12+0].offset = TM__BEZ6VAYlsKWY2hLQE9cF1AQ_12;
|
|
TM__BEZ6VAYlsKWY2hLQE9cF1AQ_0[TM__BEZ6VAYlsKWY2hLQE9cF1AQ_12+0].name = TM__BEZ6VAYlsKWY2hLQE9cF1AQ_11[TM__BEZ6VAYlsKWY2hLQE9cF1AQ_12];
|
|
TM__BEZ6VAYlsKWY2hLQE9cF1AQ_10_5[TM__BEZ6VAYlsKWY2hLQE9cF1AQ_12] = &TM__BEZ6VAYlsKWY2hLQE9cF1AQ_0[TM__BEZ6VAYlsKWY2hLQE9cF1AQ_12+0];
|
|
}
|
|
TM__BEZ6VAYlsKWY2hLQE9cF1AQ_0[5].len = 5; TM__BEZ6VAYlsKWY2hLQE9cF1AQ_0[5].kind = 2; TM__BEZ6VAYlsKWY2hLQE9cF1AQ_0[5].sons = &TM__BEZ6VAYlsKWY2hLQE9cF1AQ_10_5[0];
|
|
NTI__z9coCVKRSy09c3xCpPfzuFKg_.node = &TM__BEZ6VAYlsKWY2hLQE9cF1AQ_0[5];
|
|
}
|
|
|