aboutsummaryrefslogtreecommitdiff
path: root/src/allocators.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/allocators.zig')
-rw-r--r--src/allocators.zig8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/allocators.zig b/src/allocators.zig
index 1d3b30c0b..facab925e 100644
--- a/src/allocators.zig
+++ b/src/allocators.zig
@@ -13,8 +13,8 @@ pub fn sliceRange(slice: []const u8, buffer: []const u8) ?[2]u32 {
return if (@intFromPtr(buffer.ptr) <= @intFromPtr(slice.ptr) and
(@intFromPtr(slice.ptr) + slice.len) <= (@intFromPtr(buffer.ptr) + buffer.len))
[2]u32{
- @truncate(u32, @intFromPtr(slice.ptr) - @intFromPtr(buffer.ptr)),
- @truncate(u32, slice.len),
+ @as(u32, @truncate(@intFromPtr(slice.ptr) - @intFromPtr(buffer.ptr))),
+ @as(u32, @truncate(slice.len)),
}
else
null;
@@ -427,7 +427,7 @@ pub fn BSSStringList(comptime _count: usize, comptime _item_length: usize) type
var result = IndexType{ .index = std.math.maxInt(u31), .is_overflow = instance.slice_buf_used > max_index };
if (result.is_overflow) {
- result.index = @intCast(u31, self.overflow_list.len());
+ result.index = @as(u31, @intCast(self.overflow_list.len()));
} else {
result.index = instance.slice_buf_used;
instance.slice_buf_used += 1;
@@ -693,7 +693,7 @@ pub fn BSSMap(comptime ValueType: type, comptime count: anytype, comptime store_
if (!result.index.is_overflow) {
instance.key_list_slices[result.index.index] = slice;
} else {
- if (@intCast(u31, instance.key_list_overflow.items.len) > result.index.index) {
+ if (@as(u31, @intCast(instance.key_list_overflow.items.len)) > result.index.index) {
const existing_slice = instance.key_list_overflow.items[result.index.index];
if (!isKeyStaticallyAllocated(existing_slice)) {
self.map.allocator.free(existing_slice);