forked from mirror/vulkan-zig
Remove additional null termination
[`std.builtin.Type.StructField.name`](https://ziglang.org/documentation/master/std/#std.builtin.Type.StructField) has type `[:0]const u8`
This commit is contained in:
@@ -1496,8 +1496,7 @@ fn Renderer(comptime WriterType: type) type {
|
|||||||
\\pub fn load({[params]s}) Self {{
|
\\pub fn load({[params]s}) Self {{
|
||||||
\\ var self: Self = .{{ .dispatch = .{{}} }};
|
\\ var self: Self = .{{ .dispatch = .{{}} }};
|
||||||
\\ inline for (std.meta.fields(Dispatch)) |field| {{
|
\\ inline for (std.meta.fields(Dispatch)) |field| {{
|
||||||
\\ const name: [*:0]const u8 = @ptrCast(field.name ++ "\x00");
|
\\ const cmd_ptr = loader({[first_arg]s}, field.name.ptr) orelse undefined;
|
||||||
\\ const cmd_ptr = loader({[first_arg]s}, name) orelse undefined;
|
|
||||||
\\ @field(self.dispatch, field.name) = @ptrCast(cmd_ptr);
|
\\ @field(self.dispatch, field.name) = @ptrCast(cmd_ptr);
|
||||||
\\ }}
|
\\ }}
|
||||||
\\ return self;
|
\\ return self;
|
||||||
|
|||||||
Reference in New Issue
Block a user