glfw: dont use @errSetCast

This commit is contained in:
Lee Cannon 2022-02-08 02:08:26 +00:00 committed by Stephen Gutekanst
parent 3e79a12f3d
commit 2e9347399d
10 changed files with 74 additions and 87 deletions

View file

@ -66,7 +66,7 @@ pub inline fn create(image: Image, xhot: i32, yhot: i32) error{PlatformError}!Cu
if (c.glfwCreateCursor(&img, @intCast(c_int, xhot), @intCast(c_int, yhot))) |cursor| return Cursor{ .ptr = cursor };
getError() catch |err| return switch (err) {
Error.NotInitialized => unreachable,
Error.PlatformError => @errSetCast(error{PlatformError}, err),
Error.PlatformError => |e| e,
else => unreachable,
};
unreachable;
@ -87,7 +87,7 @@ pub inline fn createStandard(shape: Shape) error{PlatformError}!Cursor {
getError() catch |err| return switch (err) {
Error.NotInitialized => unreachable,
Error.InvalidEnum => unreachable,
Error.PlatformError => @errSetCast(error{PlatformError}, err),
Error.PlatformError => |e| e,
else => unreachable,
};
unreachable;