From 0e25730e634ac36c7d0b638084ab94de547a1e86 Mon Sep 17 00:00:00 2001 From: s-ol Date: Wed, 5 Mar 2025 17:12:48 +0100 Subject: update for Zig 0.14.0 --- README.md | 6 +++--- src/config.zig | 2 +- src/main.zig | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 104f0d9..3e43db4 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ GLSL uniforms are accessible as `/$UNIFORM_NAME`. The OSC type must match the GL uniform float time = 0; uniform dvec3 color; - + + ---- /time f 123.56 /color ddd 0.5 0.1 0.1 @@ -21,7 +21,7 @@ Vectors and matrices can be indexed using integers or the GLSL swizzling keys (x uniform vec3 color; uniform mat3 mat; - + + ---- /color/r f 0.5 /mat/0/y f 123 @@ -34,7 +34,7 @@ When built with ffmpeg, images and videos can be loaded as 2D or 3D textures: uniform sampler3D videoA; uniform sampler2DArray videoB; - + + ---- /image s "image.jpg" /videoA s "subdir/video_a.mp4" diff --git a/src/config.zig b/src/config.zig index 93ac897..f8613bd 100644 --- a/src/config.zig +++ b/src/config.zig @@ -188,7 +188,7 @@ fn parseEnum(parser: *c.yaml_parser_t, comptime T: type) !T { const data = event.data.scalar; const value: []const u8 = data.value[0..data.length]; - inline for (@typeInfo(T).Enum.fields) |field| { + inline for (@typeInfo(T).@"enum".fields) |field| { if (std.mem.eql(u8, value, field.name)) return @field(T, field.name); } diff --git a/src/main.zig b/src/main.zig index 57eecd1..ae567bd 100644 --- a/src/main.zig +++ b/src/main.zig @@ -192,7 +192,7 @@ fn loadFile(config: *const cfg.Config, writer: anytype, dir: []const u8, filenam var wrote_line = false; while (try reader.readUntilDelimiterOrEof(&buf, '\n')) |line| { if (std.mem.startsWith(u8, line, "#pragma ")) { - var parts = std.mem.split(u8, line, " "); + var parts = std.mem.splitScalar(u8, line, ' '); _ = parts.next(); const pragma = parts.next().?; -- cgit v1.2.3