diff options
Diffstat (limited to 'src/codegen/spirv/Module.zig')
| -rw-r--r-- | src/codegen/spirv/Module.zig | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/codegen/spirv/Module.zig b/src/codegen/spirv/Module.zig index 9d8cca9445..e61ac754ee 100644 --- a/src/codegen/spirv/Module.zig +++ b/src/codegen/spirv/Module.zig @@ -451,8 +451,8 @@ pub fn constInt(self: *Module, ty_ref: CacheRef, value: anytype) !IdRef { return try self.resolveId(.{ .int = .{ .ty = ty_ref, .value = switch (ty.signedness) { - .signed => Value{ .int64 = @intCast(i64, value) }, - .unsigned => Value{ .uint64 = @intCast(u64, value) }, + .signed => Value{ .int64 = @as(i64, @intCast(value)) }, + .unsigned => Value{ .uint64 = @as(u64, @intCast(value)) }, }, } }); } @@ -516,7 +516,7 @@ pub fn allocDecl(self: *Module, kind: DeclKind) !Decl.Index { .begin_dep = undefined, .end_dep = undefined, }); - const index = @enumFromInt(Decl.Index, @intCast(u32, self.decls.items.len - 1)); + const index = @as(Decl.Index, @enumFromInt(@as(u32, @intCast(self.decls.items.len - 1)))); switch (kind) { .func => {}, // If the decl represents a global, also allocate a global node. @@ -540,9 +540,9 @@ pub fn globalPtr(self: *Module, index: Decl.Index) ?*Global { /// Declare ALL dependencies for a decl. pub fn declareDeclDeps(self: *Module, decl_index: Decl.Index, deps: []const Decl.Index) !void { - const begin_dep = @intCast(u32, self.decl_deps.items.len); + const begin_dep = @as(u32, @intCast(self.decl_deps.items.len)); try self.decl_deps.appendSlice(self.gpa, deps); - const end_dep = @intCast(u32, self.decl_deps.items.len); + const end_dep = @as(u32, @intCast(self.decl_deps.items.len)); const decl = self.declPtr(decl_index); decl.begin_dep = begin_dep; @@ -550,13 +550,13 @@ pub fn declareDeclDeps(self: *Module, decl_index: Decl.Index, deps: []const Decl } pub fn beginGlobal(self: *Module) u32 { - return @intCast(u32, self.globals.section.instructions.items.len); + return @as(u32, @intCast(self.globals.section.instructions.items.len)); } pub fn endGlobal(self: *Module, global_index: Decl.Index, begin_inst: u32) void { const global = self.globalPtr(global_index).?; global.begin_inst = begin_inst; - global.end_inst = @intCast(u32, self.globals.section.instructions.items.len); + global.end_inst = @as(u32, @intCast(self.globals.section.instructions.items.len)); } pub fn declareEntryPoint(self: *Module, decl_index: Decl.Index, name: []const u8) !void { |
