mirror of
https://github.com/zoriya/zig-wayland.git
synced 2026-06-09 13:01:17 +00:00
Use a stronger cast on pointer args
We need to cast alignment and constness in some cases. Don't worry, this is totally safe
This commit is contained in:
+1
-1
@@ -71,7 +71,7 @@ pub fn Dispatcher(comptime Obj: type, comptime Data: type) type {
|
||||
inline for (@typeInfo(payload_field.field_type).Struct.fields) |f, i| {
|
||||
@field(payload_data, f.name) = switch (@sizeOf(f.field_type)) {
|
||||
4 => @bitCast(f.field_type, args[i].u),
|
||||
8 => @ptrCast(f.field_type, args[i].s),
|
||||
8 => @intToPtr(f.field_type, @ptrToInt(args[i].s)),
|
||||
else => unreachable,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user