deps: update to Zig 0.10

This commit is contained in:
Isaac Freund
2022-11-05 00:29:51 +01:00
parent f370202b68
commit 09f3f141ae
30 changed files with 81 additions and 148 deletions

View File

@ -49,7 +49,7 @@ pub fn listInputs(
if (prev) try input_list.appendSlice("\n");
prev = true;
try writer.print("{s}\n\tconfigured: {s}\n", .{
try writer.print("{s}\n\tconfigured: {}\n", .{
device.identifier,
configured,
});
@ -110,7 +110,7 @@ pub fn listInputConfigs(
try writer.print("\tpointer-accel: {d}\n", .{pointer_accel.value});
}
if (input_config.scroll_method) |scroll_method| {
try writer.print("\tscroll-method: {s}\n", .{scroll_method});
try writer.print("\tscroll-method: {s}\n", .{@tagName(scroll_method)});
}
if (input_config.scroll_button) |scroll_button| {
try writer.print("\tscroll-button: {s}\n", .{
@ -195,7 +195,7 @@ pub fn input(
input_config.scroll_method = meta.stringToEnum(InputConfig.ScrollMethod, args[3]) orelse
return Error.UnknownOption;
} else if (mem.eql(u8, "scroll-button", args[2])) {
const ret = c.libevdev_event_code_from_name(c.EV_KEY, args[3]);
const ret = c.libevdev_event_code_from_name(c.EV_KEY, args[3].ptr);
if (ret < 1) return Error.InvalidButton;
input_config.scroll_button = InputConfig.ScrollButton{ .button = @intCast(u32, ret) };
} else {

View File

@ -44,7 +44,7 @@ pub fn keyboardLayout(
const rule_names = xkb.RuleNames{
.layout = result.args[0],
// TODO(zig) these should coerce without this hack with the selfhosted compiler.
// TODO(zig) these should eventually coerce without this hack.
.rules = if (result.flags.rules) |s| s else null,
.model = if (result.flags.model) |s| s else null,
.variant = if (result.flags.variant) |s| s else null,

View File

@ -242,7 +242,7 @@ fn pointerMappingExists(
}
fn parseEventCode(name: [:0]const u8, out: *?[]const u8) !u32 {
const event_code = c.libevdev_event_code_from_name(c.EV_KEY, name);
const event_code = c.libevdev_event_code_from_name(c.EV_KEY, name.ptr);
if (event_code < 1) {
out.* = try fmt.allocPrint(util.gpa, "unknown button {s}", .{name});
return Error.Other;