mirror of
https://github.com/zoriya/zig-wayland.git
synced 2026-06-08 20:45:20 +00:00
Make List.next/List.prev nullable
libwayland sets these to null on removal
This commit is contained in:
@@ -321,8 +321,8 @@ pub const ProtocolLogger = opaque {
|
||||
};
|
||||
|
||||
pub const List = extern struct {
|
||||
prev: *List,
|
||||
next: *List,
|
||||
prev: ?*List,
|
||||
next: ?*List,
|
||||
|
||||
pub fn init(list: *List) void {
|
||||
list.* = .{ .prev = list, .next = list };
|
||||
@@ -342,7 +342,7 @@ pub const List = extern struct {
|
||||
pub fn remove(elm: *elm) void {
|
||||
elm.prev.next = elm.next;
|
||||
elm.next.prev = elm.prev;
|
||||
elm = undefined;
|
||||
elm.* = .{ .prev = null, .next = null };
|
||||
}
|
||||
|
||||
pub fn length(list: *const List) usize {
|
||||
|
||||
Reference in New Issue
Block a user