authorgravatar for topolarity@tapscott.meCody Tapscott <topolarity@tapscott.me> 2022-02-13 14:16:40-07:00
committergravatar for topolarity@tapscott.meCody Tapscott <topolarity@tapscott.me> 2022-02-13 14:16:40-07:00
log7edf3d9f2d53f5b1c5e31ee1294ff9b52337760b
treecd917fd39e4532d640cfe5e149418183542347b9
parent45aed7171c5cafb06671714ac1b15fdcf056d040

Cast abi_size to usize


1 files changed, 3 insertions(+), 3 deletions(-)

src/value.zig+3-3
......@@ -1046,7 +1046,7 @@ pub const Value = extern union {
10461046 var bigint_buffer: BigIntSpace = undefined;
10471047 const bigint = val.toBigInt(&bigint_buffer);
10481048 const bits = ty.intInfo(target).bits;
1049 const abi_size = ty.abiSize(target);
1049 const abi_size = @intCast(usize, ty.abiSize(target));
10501050 bigint.writeTwosComplement(buffer, bits, abi_size, target.cpu.arch.endian());
10511051 },
10521052 .Enum => {
......@@ -1055,7 +1055,7 @@ pub const Value = extern union {
10551055 var bigint_buffer: BigIntSpace = undefined;
10561056 const bigint = int_val.toBigInt(&bigint_buffer);
10571057 const bits = ty.intInfo(target).bits;
1058 const abi_size = ty.abiSize(target);
1058 const abi_size = @intCast(usize, ty.abiSize(target));
10591059 bigint.writeTwosComplement(buffer, bits, abi_size, target.cpu.arch.endian());
10601060 },
10611061 .Float => switch (ty.floatBits(target)) {
......@@ -1098,7 +1098,7 @@ pub const Value = extern union {
10981098 const Limb = std.math.big.Limb;
10991099 const limb_count = (buffer.len + @sizeOf(Limb) - 1) / @sizeOf(Limb);
11001100 const limbs_buffer = try arena.alloc(Limb, limb_count);
1101 const abi_size = ty.abiSize(target);
1101 const abi_size = @intCast(usize, ty.abiSize(target));
11021102 var bigint = BigIntMutable.init(limbs_buffer, 0);
11031103 bigint.readTwosComplement(buffer, int_info.bits, abi_size, endian, int_info.signedness);
11041104 return fromBigInt(arena, bigint.toConst());