MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / fxFromBigInt64

Function fxFromBigInt64

xs/sources/xsBigInt.c:867–893  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

865}
866
867void fxFromBigInt64(txMachine* the, txSlot* slot, txS8 it)
868{
869 txU1 sign = 0;
870 txU8 value = 0;
871 if (it < 0) {
872 if (it & 0x7FFFFFFFFFFFFFFFll)
873 value = -it;
874 else
875 value = (txU8)it;
876 sign = 1;
877 }
878 else
879 value = it;
880 if (value > 0x00000000FFFFFFFFll) {
881 slot->value.bigint.data = fxNewChunk(the, 2 * sizeof(txU4));
882 slot->value.bigint.data[0] = (txU4)value;
883 slot->value.bigint.data[1] = (txU4)(value >> 32);
884 slot->value.bigint.size = 2;
885 }
886 else {
887 slot->value.bigint.data = fxNewChunk(the, sizeof(txU4));
888 slot->value.bigint.data[0] = (txU4)value;
889 slot->value.bigint.size = 1;
890 }
891 slot->value.bigint.sign = sign;
892 slot->kind = XS_BIGINT_KIND;
893}
894
895void fxFromBigUint64(txMachine* the, txSlot* slot, txU8 value)
896{

Callers 6

xs_directorystorage_readFunction · 0.85
xs_directorystorage_readFunction · 0.85
xs_directorystorage_readFunction · 0.85
xs_storage_domain_readFunction · 0.85
xsffi.cFile · 0.85
fxBigInt64GetterFunction · 0.85

Calls 1

fxNewChunkFunction · 0.85

Tested by

no test coverage detected