diff options
| author | mlugg <mlugg@mlugg.co.uk> | 2023-11-14 09:10:53 +0000 |
|---|---|---|
| committer | mlugg <mlugg@mlugg.co.uk> | 2023-11-19 11:11:49 +0000 |
| commit | b35589343894791a48b1423aa6d4a59b4858dfdb (patch) | |
| tree | 62fb0542c4e49dd8748294bcfb75cf0c12fa5e23 /src/codegen/spirv.zig | |
| parent | 172c2797bdd5f939e53acc26ea6820896e62733a (diff) | |
| download | zig-b35589343894791a48b1423aa6d4a59b4858dfdb.tar.gz zig-b35589343894791a48b1423aa6d4a59b4858dfdb.zip | |
compiler: correct unnecessary uses of 'var'
Diffstat (limited to 'src/codegen/spirv.zig')
| -rw-r--r-- | src/codegen/spirv.zig | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/codegen/spirv.zig b/src/codegen/spirv.zig index dcb3329c57..8bee639b60 100644 --- a/src/codegen/spirv.zig +++ b/src/codegen/spirv.zig @@ -1284,7 +1284,7 @@ const DeclGen = struct { const elem_ty = ty.childType(mod); const elem_ty_ref = try self.resolveType(elem_ty, .indirect); - var total_len = std.math.cast(u32, ty.arrayLenIncludingSentinel(mod)) orelse { + const total_len = std.math.cast(u32, ty.arrayLenIncludingSentinel(mod)) orelse { return self.fail("array type of {} elements is too large", .{ty.arrayLenIncludingSentinel(mod)}); }; const ty_ref = if (!elem_ty.hasRuntimeBitsIgnoreComptime(mod)) blk: { @@ -2115,7 +2115,7 @@ const DeclGen = struct { const child_ty = ty.childType(mod); const vector_len = ty.vectorLen(mod); - var constituents = try self.gpa.alloc(IdRef, vector_len); + const constituents = try self.gpa.alloc(IdRef, vector_len); defer self.gpa.free(constituents); for (constituents, 0..) |*constituent, i| { @@ -2312,7 +2312,7 @@ const DeclGen = struct { if (ty.isVector(mod)) { const child_ty = ty.childType(mod); const vector_len = ty.vectorLen(mod); - var constituents = try self.gpa.alloc(IdRef, vector_len); + const constituents = try self.gpa.alloc(IdRef, vector_len); defer self.gpa.free(constituents); for (constituents, 0..) |*constituent, i| { @@ -2727,7 +2727,7 @@ const DeclGen = struct { const child_ty = ty.childType(mod); const vector_len = ty.vectorLen(mod); - var constituents = try self.gpa.alloc(IdRef, vector_len); + const constituents = try self.gpa.alloc(IdRef, vector_len); defer self.gpa.free(constituents); for (constituents, 0..) |*constituent, i| { |
