all: fix issue with glfw vulkan createWindowSurface; update to new for loop syntax (#713)
This commit is contained in:
parent
5aecbb0ee6
commit
2b6f3fb1d9
14 changed files with 28 additions and 27 deletions
|
|
@ -67,7 +67,7 @@ pub const ArchetypeStorage = struct {
|
|||
}
|
||||
|
||||
fn debugValidateRow(storage: *ArchetypeStorage, gpa: Allocator, row: anytype) void {
|
||||
inline for (std.meta.fields(@TypeOf(row))) |field, index| {
|
||||
inline for (std.meta.fields(@TypeOf(row)), 0..) |field, index| {
|
||||
const column = storage.columns[index];
|
||||
if (typeId(field.type) != column.type_id) {
|
||||
const msg = std.mem.concat(gpa, u8, &.{
|
||||
|
|
@ -148,7 +148,7 @@ pub const ArchetypeStorage = struct {
|
|||
if (is_debug) storage.debugValidateRow(gpa, row);
|
||||
|
||||
const fields = std.meta.fields(@TypeOf(row));
|
||||
inline for (fields) |field, index| {
|
||||
inline for (fields, 0..) |field, index| {
|
||||
const ColumnType = field.type;
|
||||
if (@sizeOf(ColumnType) == 0) continue;
|
||||
|
||||
|
|
@ -335,7 +335,7 @@ pub fn Entities(comptime all_components: anytype) type {
|
|||
pub const Query = Query: {
|
||||
const namespaces = std.meta.fields(@TypeOf(all_components));
|
||||
var fields: [namespaces.len]std.builtin.Type.UnionField = undefined;
|
||||
inline for (namespaces) |namespace, i| {
|
||||
inline for (namespaces, 0..) |namespace, i| {
|
||||
const component_enum = std.meta.FieldEnum(namespace.type);
|
||||
fields[i] = .{
|
||||
.name = namespace.name,
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ pub fn Messages(comptime messages: anytype) type {
|
|||
pub fn MessagesTag(comptime messages: anytype) type {
|
||||
var fields: []const EnumField = &[0]EnumField{};
|
||||
const message_fields = std.meta.fields(@TypeOf(messages));
|
||||
inline for (message_fields) |message_field, index| {
|
||||
inline for (message_fields, 0..) |message_field, index| {
|
||||
fields = fields ++ [_]std.builtin.Type.EnumField{.{
|
||||
.name = message_field.name,
|
||||
.value = index,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue