Skip to content

Commit

Permalink
fix invalid use of var
Browse files Browse the repository at this point in the history
  • Loading branch information
Snektron committed Nov 21, 2023
1 parent 6d46195 commit 35f2ee7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions generator/vulkan/parse.zig
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub fn parseXml(backing_allocator: Allocator, root: *xml.Element, api: registry.

const allocator = arena.allocator();

var reg = registry.Registry{
const reg = registry.Registry{
.decls = try parseDeclarations(allocator, root, api),
.api_constants = try parseApiConstants(allocator, root, api),
.tags = try parseTags(allocator, root),
Expand All @@ -38,8 +38,8 @@ pub fn parseXml(backing_allocator: Allocator, root: *xml.Element, api: registry.
}

fn parseDeclarations(allocator: Allocator, root: *xml.Element, api: registry.Api) ![]registry.Declaration {
var types_elem = root.findChildByTag("types") orelse return error.InvalidRegistry;
var commands_elem = root.findChildByTag("commands") orelse return error.InvalidRegistry;
const types_elem = root.findChildByTag("types") orelse return error.InvalidRegistry;
const commands_elem = root.findChildByTag("commands") orelse return error.InvalidRegistry;

const decl_upper_bound = types_elem.children.len + commands_elem.children.len;
const decls = try allocator.alloc(registry.Declaration, decl_upper_bound);
Expand Down
2 changes: 1 addition & 1 deletion generator/xml.zig
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ const Parser = struct {
begin = prev_nl + 1;
}

var end = mem.indexOfScalarPos(u8, self.source, self.offset, '\n') orelse self.source.len;
const end = mem.indexOfScalarPos(u8, self.source, self.offset, '\n') orelse self.source.len;
return self.source[begin..end];
}
};
Expand Down

0 comments on commit 35f2ee7

Please sign in to comment.