Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to 0.14.0-dev.43+96501d338 #143

Merged
merged 1 commit into from
Jun 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/vulkan/parse.zig
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ fn parseContainer(allocator: Allocator, ty: *xml.Element, is_union: bool, api: r
}

if (member.getAttribute("optional")) |optionals| {
var optional_it = mem.split(u8, optionals, ",");
var optional_it = mem.splitScalar(u8, optionals, ',');
if (optional_it.next()) |first_optional| {
members[i].is_optional = mem.eql(u8, first_optional, "true");
} else {
Expand All @@ -223,7 +223,7 @@ fn parseContainer(allocator: Allocator, ty: *xml.Element, is_union: bool, api: r
if (ty.getAttribute("structextends")) |extends| {
const n_structs = std.mem.count(u8, extends, ",") + 1;
maybe_extends = try allocator.alloc([]const u8, n_structs);
var struct_extends = std.mem.split(u8, extends, ",");
var struct_extends = std.mem.splitScalar(u8, extends, ',');
var j: usize = 0;
while (struct_extends.next()) |struct_extend| {
maybe_extends.?[j] = struct_extend;
Expand Down Expand Up @@ -303,7 +303,7 @@ fn parsePointerMeta(fields: Fields, type_info: *registry.TypeInfo, elem: *xml.El
var len_attribute_depth: usize = 0;

if (elem.getAttribute("len")) |lens| {
var it = mem.split(u8, lens, ",");
var it = mem.splitScalar(u8, lens, ',');
var current_type_info = type_info;

while (true) switch (current_type_info.*) {
Expand Down Expand Up @@ -347,7 +347,7 @@ fn parsePointerMeta(fields: Fields, type_info: *registry.TypeInfo, elem: *xml.El
var current_depth: usize = 0;

if (elem.getAttribute("optional")) |optionals| {
var it = mem.split(u8, optionals, ",");
var it = mem.splitScalar(u8, optionals, ',');
var current_type_info = type_info;
while (true) switch (current_type_info.*) {
inline .pointer, .array => |*info| {
Expand Down Expand Up @@ -498,7 +498,7 @@ fn splitCommaAlloc(allocator: Allocator, text: []const u8) ![][]const u8 {
}

const codes = try allocator.alloc([]const u8, n_codes);
var it = mem.split(u8, text, ",");
var it = mem.splitScalar(u8, text, ',');
for (codes) |*code| {
code.* = it.next().?;
}
Expand Down Expand Up @@ -539,7 +539,7 @@ fn parseCommand(allocator: Allocator, elem: *xml.Element, api: registry.Api) !re
};

if (param.getAttribute("optional")) |optionals| {
var optional_it = mem.split(u8, optionals, ",");
var optional_it = mem.splitScalar(u8, optionals, ',');
if (optional_it.next()) |first_optional| {
params[i].is_optional = mem.eql(u8, first_optional, "true");
} else {
Expand Down Expand Up @@ -951,7 +951,7 @@ fn parseExtension(allocator: Allocator, extension: *xml.Element, api: registry.A
}

fn splitFeatureLevel(ver: []const u8, split: []const u8) !registry.FeatureLevel {
var it = mem.split(u8, ver, split);
var it = mem.splitSequence(u8, ver, split);

const major = it.next() orelse return error.InvalidFeatureLevel;
const minor = it.next() orelse return error.InvalidFeatureLevel;
Expand All @@ -968,7 +968,7 @@ fn splitFeatureLevel(ver: []const u8, split: []const u8) !registry.FeatureLevel
fn requiredByApi(elem: *xml.Element, api: registry.Api) bool {
const apis = elem.getAttribute("api") orelse return true; // If the 'api' element is not present, assume required.

var it = mem.split(u8, apis, ",");
var it = mem.splitScalar(u8, apis, ',');
while (it.next()) |required_by_api| {
if (std.mem.eql(u8, @tagName(api), required_by_api)) return true;
}
Expand Down