diff options
author | Julien Dessaux | 2023-12-18 07:26:01 +0100 |
---|---|---|
committer | Julien Dessaux | 2023-12-18 15:16:51 +0100 |
commit | 83af8ab1249b98bb5cf691b88bfc947d1d688710 (patch) | |
tree | aa6833315a336959fbca035b82106ce81d5e5add /src/pointer.zig | |
parent | Updated README for last zig version (diff) | |
download | zigfunge98-83af8ab1249b98bb5cf691b88bfc947d1d688710.tar.gz zigfunge98-83af8ab1249b98bb5cf691b88bfc947d1d688710.tar.bz2 zigfunge98-83af8ab1249b98bb5cf691b88bfc947d1d688710.zip |
zig 0.11 changes
Diffstat (limited to '')
-rw-r--r-- | src/pointer.zig | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/pointer.zig b/src/pointer.zig index 75bc5ae..eeb1204 100644 --- a/src/pointer.zig +++ b/src/pointer.zig @@ -245,21 +245,26 @@ pub const Pointer = struct { // 18 i = 0; while (i < p.ss.data.items.len) : (i += 1) { - try p.ss.toss.push(@intCast(i64, p.ss.data.items[i].data.items.len)); + try p.ss.toss.push(@intCast(p.ss.data.items[i].data.items.len)); } - try p.ss.toss.push(@intCast(i64, height)); + try p.ss.toss.push(@intCast(height)); // 17 - try p.ss.toss.push(@intCast(i64, p.ss.data.items.len) + 1); + try p.ss.toss.push(@intCast(p.ss.data.items.len + 1)); // 16 const ts = if (p.timestamp) |v| v else std.time.timestamp(); - const now = std.time.epoch.EpochSeconds{ .secs = @intCast(u64, ts) }; + const now = std.time.epoch.EpochSeconds{ .secs = @intCast(ts) }; const epochDay = now.getEpochDay(); const daySeconds = now.getDaySeconds(); - try p.ss.toss.push(@intCast(i64, daySeconds.getHoursIntoDay()) * 256 * 256 + @intCast(i64, daySeconds.getMinutesIntoHour()) * 256 + @intCast(i64, daySeconds.getSecondsIntoMinute())); + const hours: i64 = @intCast(daySeconds.getHoursIntoDay()); + const minutes: i64 = @intCast(daySeconds.getMinutesIntoHour()); + const seconds: i64 = @intCast(daySeconds.getSecondsIntoMinute()); + try p.ss.toss.push(hours * 256 * 256 + minutes * 256 + seconds); // 15 const yearAndDay = epochDay.calculateYearDay(); + const year: i64 = @intCast(yearAndDay.year); const monthAndDay = yearAndDay.calculateMonthDay(); - try p.ss.toss.push(@intCast(i64, yearAndDay.year - 1900) * 256 * 256 + @intCast(i64, monthAndDay.month.numeric()) * 256 + @intCast(i64, monthAndDay.day_index)); + const month: i64 = @intCast(monthAndDay.month.numeric()); + try p.ss.toss.push((year - 1900) * 256 * 256 + month * 256 + monthAndDay.day_index); // 14 try p.ss.toss.pushVector([2]i64{ fieldSize[2] - 1, fieldSize[3] - 1 }); // 13 @@ -289,7 +294,7 @@ pub const Pointer = struct { // 1 try p.ss.toss.push(0b00000); // TODO update when implementing t, i, o and = if (n > 0) { - try p.ss.toss.yCommandPick(@intCast(usize, n), height); + try p.ss.toss.yCommandPick(@intCast(n), height); } }, '(' => { |