diff options
| author | Cody Tapscott <topolarity@tapscott.me> | 2022-02-13 14:16:40 -0700 |
|---|---|---|
| committer | Cody Tapscott <topolarity@tapscott.me> | 2022-02-13 14:16:40 -0700 |
| commit | 7edf3d9f2d53f5b1c5e31ee1294ff9b52337760b (patch) | |
| tree | cd917fd39e4532d640cfe5e149418183542347b9 | |
| parent | 45aed7171c5cafb06671714ac1b15fdcf056d040 (diff) | |
| download | zig-7edf3d9f2d53f5b1c5e31ee1294ff9b52337760b.tar.gz zig-7edf3d9f2d53f5b1c5e31ee1294ff9b52337760b.zip | |
Cast abi_size to usize
| -rw-r--r-- | src/value.zig | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/value.zig b/src/value.zig index a3dd6501e4..d07179359f 100644 --- a/src/value.zig +++ b/src/value.zig @@ -1046,7 +1046,7 @@ pub const Value = extern union { var bigint_buffer: BigIntSpace = undefined; const bigint = val.toBigInt(&bigint_buffer); const bits = ty.intInfo(target).bits; - const abi_size = ty.abiSize(target); + const abi_size = @intCast(usize, ty.abiSize(target)); bigint.writeTwosComplement(buffer, bits, abi_size, target.cpu.arch.endian()); }, .Enum => { @@ -1055,7 +1055,7 @@ pub const Value = extern union { var bigint_buffer: BigIntSpace = undefined; const bigint = int_val.toBigInt(&bigint_buffer); const bits = ty.intInfo(target).bits; - const abi_size = ty.abiSize(target); + const abi_size = @intCast(usize, ty.abiSize(target)); bigint.writeTwosComplement(buffer, bits, abi_size, target.cpu.arch.endian()); }, .Float => switch (ty.floatBits(target)) { @@ -1098,7 +1098,7 @@ pub const Value = extern union { const Limb = std.math.big.Limb; const limb_count = (buffer.len + @sizeOf(Limb) - 1) / @sizeOf(Limb); const limbs_buffer = try arena.alloc(Limb, limb_count); - const abi_size = ty.abiSize(target); + const abi_size = @intCast(usize, ty.abiSize(target)); var bigint = BigIntMutable.init(limbs_buffer, 0); bigint.readTwosComplement(buffer, int_info.bits, abi_size, endian, int_info.signedness); return fromBigInt(arena, bigint.toConst()); |
