| 1 | :100644 100644 d49352c9c20cea1ca91beb90979e8d4a1670a01c 5b519a35eb2ea8842573d82f13ab965ca8724b69 M	README.md |
| 2 | :100644 100644 b301658a8bea70ef336e7f426c284017b6f48465 9c975af044191b87fcd54769c29bf94a22f9123f M	apps/Calculator/main.zig |
| 3 | :100644 100644 f6990eea8b8db29a2ab4113d5d3d422454108ec9 90c6e9a60ff739b96f9ba78b65e2c6584cbaa2fe M	apps/ImageViewer/main.zig |
| 4 | :100644 100644 30850c59cddc295497c3939b6076bb09c8d36de7 cf55d583ce85b9e026f94f6eabcf1490a450c9fb M	build.zig |
| 5 | :100644 100644 731b5b15f743db7aa587fc5f8b8d98d16df106d8 c2d6942489853658391c971988c85317e0da07d2 M	demos/7guis/1counter.zig |
| 6 | :100644 100644 c6121d73b6adfe4e03889291ca323d0842187b22 da65c9ce2b7ba832d1b748e2ea0bbb6f363f94f4 M	demos/logl/hello-window.zig |
| 7 | :100644 100644 49c152d836ca8470b153957ba90a4376aa2bbbf0 13704daad693cc0054559ff70f5f3e242ecad273 M	src/main.zig |
| 8 | :100644 100644 55ee6c75e23a130d4cca5825925c92438e3c3865 8044e605443388554cecc57cf4fb2b5c4f41987e M	zigmod.lock |
| 9 | :100644 100644 1ce887547a4c312badf1429dc2afbfb2c5647776 e24cb55669911d7502b4e7e9add98995586834cf M	zigmod.yml |
| 10 | |
| 11 | diff --git a/README.md b/README.md |
| 12 | index d49352c9c20cea1ca91beb90979e8d4a1670a01c..5b519a35eb2ea8842573d82f13ab965ca8724b69 100644 |
| 13 | --- a/README.md |
| 14 | +++ b/README.md |
| 15 | @@ -21,7 +21,7 @@ Source-Available, All rights reserved. (c) 2023 Meghan Denny |
| 16 | Will likely be MPL-2.0 in the future. |
| 17 | |
| 18 | ## Credits |
| 19 | -- Zig 0.13.0 |
| 20 | +- Zig 0.14.1 |
| 21 | - See [`zigmod.yml`](./zigmod.yml) and [`zigmod.lock`](./zigmod.lock) |
| 22 | |
| 23 | ## Building |
| 24 | diff --git a/apps/Calculator/main.zig b/apps/Calculator/main.zig |
| 25 | index b301658a8bea70ef336e7f426c284017b6f48465..9c975af044191b87fcd54769c29bf94a22f9123f 100644 |
| 26 | --- a/apps/Calculator/main.zig |
| 27 | +++ b/apps/Calculator/main.zig |
| 28 | @@ -201,7 +201,7 @@ pub const SquareButton = struct { |
| 29 | fn onclickNum(comptime n: f64) mag.e.Button.OnClickFn { |
| 30 | const S = struct { |
| 31 | fn onclick(app: *App, state: ?*anyopaque) u32 { |
| 32 | - const b = extras.ptrCast(BadTextbox, state.?); |
| 33 | + const b: *BadTextbox = @ptrCast(@alignCast(state.?)); |
| 34 | if (b.active_operator) |_| { |
| 35 | b.active_num = .two; |
| 36 | |
| 37 | @@ -231,7 +231,7 @@ fn onclickNum(comptime n: f64) mag.e.Button.OnClickFn { |
| 38 | } |
| 39 | |
| 40 | fn onclickDot(app: *App, state: ?*anyopaque) u32 { |
| 41 | - const b = extras.ptrCast(BadTextbox, state.?); |
| 42 | + const b: *BadTextbox = @ptrCast(@alignCast(state.?)); |
| 43 | b.dot = 0; |
| 44 | b.update(app); |
| 45 | return 1; |
| 46 | @@ -240,7 +240,7 @@ fn onclickDot(app: *App, state: ?*anyopaque) u32 { |
| 47 | fn onclickOp(comptime o: BadTextbox.Op) mag.e.Button.OnClickFn { |
| 48 | const S = struct { |
| 49 | fn onclick(app: *App, state: ?*anyopaque) u32 { |
| 50 | - const b = extras.ptrCast(BadTextbox, state.?); |
| 51 | + const b: *BadTextbox = @ptrCast(@alignCast(state.?)); |
| 52 | toggleOpButton(app, b, o); |
| 53 | b.active_operator = o; |
| 54 | b.dot = null; |
| 55 | @@ -281,7 +281,7 @@ fn toggleOpButtonOnly(app: *const App, op: BadTextbox.Op, to: enum { on, off }) |
| 56 | } |
| 57 | |
| 58 | fn onclickNeg(app: *App, state: ?*anyopaque) u32 { |
| 59 | - const b = extras.ptrCast(BadTextbox, state.?); |
| 60 | + const b: *BadTextbox = @ptrCast(@alignCast(state.?)); |
| 61 | switch (b.active_num) { |
| 62 | .one => b.num1 *= -1, |
| 63 | .two => b.num2 *= -1, |
| 64 | @@ -291,7 +291,7 @@ fn onclickNeg(app: *App, state: ?*anyopaque) u32 { |
| 65 | } |
| 66 | |
| 67 | fn onclickRoot2(app: *App, state: ?*anyopaque) u32 { |
| 68 | - const b = extras.ptrCast(BadTextbox, state.?); |
| 69 | + const b: *BadTextbox = @ptrCast(@alignCast(state.?)); |
| 70 | switch (b.active_num) { |
| 71 | .one => b.num1 = @sqrt(b.num1), |
| 72 | .two => b.num2 = @sqrt(b.num2), |
| 73 | @@ -301,7 +301,7 @@ fn onclickRoot2(app: *App, state: ?*anyopaque) u32 { |
| 74 | } |
| 75 | |
| 76 | fn onclickRoot3(app: *App, state: ?*anyopaque) u32 { |
| 77 | - const b = extras.ptrCast(BadTextbox, state.?); |
| 78 | + const b: *BadTextbox = @ptrCast(@alignCast(state.?)); |
| 79 | switch (b.active_num) { |
| 80 | .one => b.num1 = std.math.cbrt(b.num1), |
| 81 | .two => b.num2 = std.math.cbrt(b.num2), |
| 82 | @@ -311,7 +311,7 @@ fn onclickRoot3(app: *App, state: ?*anyopaque) u32 { |
| 83 | } |
| 84 | |
| 85 | fn onclickEql(app: *App, state: ?*anyopaque) u32 { |
| 86 | - const b = extras.ptrCast(BadTextbox, state.?); |
| 87 | + const b: *BadTextbox = @ptrCast(@alignCast(state.?)); |
| 88 | if (b.active_num == .one) { |
| 89 | return 0; |
| 90 | } |
| 91 | @@ -338,7 +338,7 @@ fn onclickEql(app: *App, state: ?*anyopaque) u32 { |
| 92 | } |
| 93 | |
| 94 | fn onclickClear(app: *App, state: ?*anyopaque) u32 { |
| 95 | - const b = extras.ptrCast(BadTextbox, state.?); |
| 96 | + const b: *BadTextbox = @ptrCast(@alignCast(state.?)); |
| 97 | b.active_num = .one; |
| 98 | b.num1 = 0; |
| 99 | b.num2 = 0; |
| 100 | diff --git a/apps/ImageViewer/main.zig b/apps/ImageViewer/main.zig |
| 101 | index f6990eea8b8db29a2ab4113d5d3d422454108ec9..90c6e9a60ff739b96f9ba78b65e2c6584cbaa2fe 100644 |
| 102 | --- a/apps/ImageViewer/main.zig |
| 103 | +++ b/apps/ImageViewer/main.zig |
| 104 | @@ -16,7 +16,7 @@ pub fn main() !void { |
| 105 | |
| 106 | extras.assertLog(std.os.argv.len == 2, "must pass a file to open as an argument", .{}); |
| 107 | const file_name = std.mem.sliceTo(std.os.argv[1], 0); |
| 108 | - extras.assertLog(file_name.len <= std.fs.MAX_PATH_BYTES, "file argument longer than MAX_PATH_BYTES", .{}); |
| 109 | + extras.assertLog(file_name.len <= std.fs.max_path_bytes, "file argument longer than max_path_bytes", .{}); |
| 110 | |
| 111 | var app = try App.init(alloc, 300, 200, try std.fmt.allocPrintZ(alloc, "{s} — {s}", .{ file_name, build_options.name })); |
| 112 | defer app.deinit(); |
| 113 | diff --git a/build.zig b/build.zig |
| 114 | index 30850c59cddc295497c3939b6076bb09c8d36de7..cf55d583ce85b9e026f94f6eabcf1490a450c9fb 100644 |
| 115 | --- a/build.zig |
| 116 | +++ b/build.zig |
| 117 | @@ -3,6 +3,8 @@ const string = []const u8; |
| 118 | const deps = @import("./deps.zig"); |
| 119 | |
| 120 | pub fn build(b: *std.Build) void { |
| 121 | + b.reference_trace = 256; |
| 122 | + |
| 123 | const target = b.standardTargetOptions(.{}); |
| 124 | const mode = b.option(std.builtin.Mode, "mode", "") orelse .Debug; |
| 125 | const doall = b.option(bool, "all", "Build all apps, default only selected steps") orelse false; |
| 126 | diff --git a/demos/7guis/1counter.zig b/demos/7guis/1counter.zig |
| 127 | index 731b5b15f743db7aa587fc5f8b8d98d16df106d8..c2d6942489853658391c971988c85317e0da07d2 100644 |
| 128 | --- a/demos/7guis/1counter.zig |
| 129 | +++ b/demos/7guis/1counter.zig |
| 130 | @@ -72,7 +72,7 @@ pub const A = struct { |
| 131 | |
| 132 | fn onclick(app: *const App, state: ?*anyopaque) u32 { |
| 133 | _ = app; |
| 134 | - const a = extras.ptrCast(A, state.?); |
| 135 | + const a: *A = @ptrCast(@alignCast(state.?)); |
| 136 | a.count += 1; |
| 137 | return 1; |
| 138 | } |
| 139 | diff --git a/demos/logl/hello-window.zig b/demos/logl/hello-window.zig |
| 140 | index c6121d73b6adfe4e03889291ca323d0842187b22..da65c9ce2b7ba832d1b748e2ea0bbb6f363f94f4 100644 |
| 141 | --- a/demos/logl/hello-window.zig |
| 142 | +++ b/demos/logl/hello-window.zig |
| 143 | @@ -167,7 +167,7 @@ fn WhitePixel(dpy: *c.Display, scr: c_int) c_ulong { |
| 144 | return ScreenOfDisplay(dpy, scr).*.white_pixel; |
| 145 | } |
| 146 | |
| 147 | -// #define RootWindow(dpy, scr) 	(ScreenOfDisplay(dpy,scr)->root) |
| 148 | +// #define RootWindow(dpy, scr) (ScreenOfDisplay(dpy,scr)->root) |
| 149 | fn RootWindow(dpy: *c.Display, scr: c_int) c.Window { |
| 150 | return ScreenOfDisplay(dpy, scr).*.root; |
| 151 | } |
| 152 | diff --git a/src/main.zig b/src/main.zig |
| 153 | index 49c152d836ca8470b153957ba90a4376aa2bbbf0..13704daad693cc0054559ff70f5f3e242ecad273 100644 |
| 154 | --- a/src/main.zig |
| 155 | +++ b/src/main.zig |
| 156 | @@ -860,7 +860,7 @@ pub fn App2() type { |
| 157 | } |
| 158 | |
| 159 | pub fn get(self: *const Self, element: Element, comptime T: type) *T { |
| 160 | - return extras.ptrCast(T, self.attr(element, .data)); |
| 161 | + return @ptrCast(@alignCast(self.attr(element, .data))); |
| 162 | } |
| 163 | |
| 164 | pub fn bounds(self: *const Self, element: Element) Rectangle { |
| 165 | diff --git a/zigmod.lock b/zigmod.lock |
| 166 | index 55ee6c75e23a130d4cca5825925c92438e3c3865..8044e605443388554cecc57cf4fb2b5c4f41987e 100644 |
| 167 | --- a/zigmod.lock |
| 168 | +++ b/zigmod.lock |
| 169 | @@ -1,8 +1,8 @@ |
| 170 | 2 |
| 171 | -git https://github.com/nektro/zig-color commit-b1df1f0d3561f2ff59ccddacd9b5c8efdaec2cf2 |
| 172 | -git https://github.com/nektro/zig-extras commit-100510135aa7be25b8b465ac32450678de009103 |
| 173 | -git https://github.com/nektro/zig-time commit-b9a93152af3ba73e5f681f73a67f0d676e2ad433 |
| 174 | -git https://github.com/nektro/zig-tracer commit-662774eedca41771f9ebd1ab45cfdc8e4319d4b4 |
| 175 | -git https://github.com/nektro/zig-xml commit-05aeff20237e0ea0556e4ac0f519a278e45b0cfb |
| 176 | -git https://github.com/ziglibs/known-folders commit-aa24df42183ad415d10bc0a33e6238c437fc0f59 |
| 177 | +git https://github.com/nektro/zig-color commit-eaf93f7c177e4bd0d6a258e88998e442cd905a69 |
| 178 | +git https://github.com/nektro/zig-extras commit-cc8fb7cb1654df835a48473d67c001a44d2a6ea9 |
| 179 | +git https://github.com/nektro/zig-time commit-25165db8e626434ab6eae2cff64ba5e72e4fa062 |
| 180 | +git https://github.com/nektro/zig-tracer commit-cc75b7f652c7cd51cbfa6e3c7e8155cd153bb68b |
| 181 | +git https://github.com/nektro/zig-xml commit-fc07c763a98fa7961b65b0a2b95a2d0fa061fafb |
| 182 | +git https://github.com/ziglibs/known-folders commit-ab5cf5feb936fa3b72c95d3ad0c0c67791937ba1 |
| 183 | git https://github.com/zigimg/zigimg commit-d9dbbe22b5f7b5f1f4772169ed93ffeed8e8124d |
| 184 | diff --git a/zigmod.yml b/zigmod.yml |
| 185 | index 1ce887547a4c312badf1429dc2afbfb2c5647776..e24cb55669911d7502b4e7e9add98995586834cf 100644 |
| 186 | --- a/zigmod.yml |
| 187 | +++ b/zigmod.yml |
| 188 | @@ -1,7 +1,7 @@ |
| 189 | id: l862p8h05u3xp3w5ydtuhks9wtd961ktm8ivzhdkso0ylf1i |
| 190 | name: magnolia |
| 191 | main: src/main.zig |
| 192 | -min_zig_version: 0.13.0 |
| 193 | +min_zig_version: 0.14.1 |
| 194 | |
| 195 | root_dependencies: |
| 196 | - src: git https://github.com/nektro/zig-extras |