From f1ae31ae86476ffeb1b46edbdc499048d68e57e6 Mon Sep 17 00:00:00 2001 From: Stephen Gutekanst Date: Fri, 9 Sep 2022 21:23:20 -0700 Subject: [PATCH] ecs: improve compatibility with self-hosted compiler Signed-off-by: Stephen Gutekanst --- libs/ecs/src/entities.zig | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libs/ecs/src/entities.zig b/libs/ecs/src/entities.zig index 4bd9c7f2..3291f384 100644 --- a/libs/ecs/src/entities.zig +++ b/libs/ecs/src/entities.zig @@ -78,7 +78,7 @@ pub const ArchetypeStorage = struct { gpa.free(storage.columns); } - fn debugValidateRow(storage: *ArchetypeStorage, gpa: Allocator, comptime row: anytype) void { + fn debugValidateRow(storage: *ArchetypeStorage, gpa: Allocator, row: anytype) void { inline for (std.meta.fields(@TypeOf(row))) |field, index| { const column = storage.columns[index]; if (typeId(field.field_type) != column.typeId) { @@ -102,7 +102,7 @@ pub const ArchetypeStorage = struct { return row_index; } - pub fn append(storage: *ArchetypeStorage, gpa: Allocator, comptime row: anytype) !u32 { + pub fn append(storage: *ArchetypeStorage, gpa: Allocator, row: anytype) !u32 { if (is_debug) storage.debugValidateRow(gpa, row); try storage.ensureUnusedCapacity(gpa, 1); @@ -174,7 +174,7 @@ pub const ArchetypeStorage = struct { } /// Sets the entire row's values in the table. - pub fn setRow(storage: *ArchetypeStorage, gpa: Allocator, row_index: u32, comptime row: anytype) void { + pub fn setRow(storage: *ArchetypeStorage, gpa: Allocator, row_index: u32, row: anytype) void { if (is_debug) storage.debugValidateRow(gpa, row); const fields = std.meta.fields(@TypeOf(row)); @@ -188,7 +188,7 @@ pub const ArchetypeStorage = struct { } /// Sets the value of the named components (columns) for the given row in the table. - pub fn set(storage: *ArchetypeStorage, gpa: Allocator, row_index: u32, name: []const u8, comptime component: anytype) void { + pub fn set(storage: *ArchetypeStorage, gpa: Allocator, row_index: u32, name: []const u8, component: anytype) void { const ColumnType = @TypeOf(component); if (@sizeOf(ColumnType) == 0) return; for (storage.columns) |column| {