chore: ensure code compiles on zig master

This commit is contained in:
Rekai Nyangadzayi Musuka 2021-10-28 11:06:11 -03:00
parent fc3cbaaefa
commit 811fa0c1b5
1 changed files with 3 additions and 3 deletions

View File

@ -13,13 +13,13 @@ const PIXELBUF_LEN = disp.PIXELBUF_LEN;
pub const Scheduler = struct { pub const Scheduler = struct {
pixels_ptr: *[PIXELBUF_LEN]u8, pixels_ptr: *[PIXELBUF_LEN]u8,
timestamp: u64, timestamp: u64,
queue: PriorityQueue(Event), queue: PriorityQueue(Event, lessThan),
pub fn new(alloc: *Allocator, pixels_ptr: *[PIXELBUF_LEN]u8) Scheduler { pub fn new(alloc: *Allocator, pixels_ptr: *[PIXELBUF_LEN]u8) Scheduler {
var queue = Scheduler{ var queue = Scheduler{
.timestamp = 0, .timestamp = 0,
.pixels_ptr = pixels_ptr, .pixels_ptr = pixels_ptr,
.queue = PriorityQueue(Event).init(alloc, less_than), .queue = PriorityQueue(Event, lessThan).init(alloc),
}; };
queue.pushEvent(.{ queue.pushEvent(.{
@ -88,7 +88,7 @@ pub const EventKind = enum {
DelayTimer, DelayTimer,
}; };
fn less_than(a: Event, b: Event) Order { fn lessThan(a: Event, b: Event) Order {
return std.math.order(a.timestamp, b.timestamp); return std.math.order(a.timestamp, b.timestamp);
} }