mirror of
https://github.com/fairyglade/ly.git
synced 2025-12-20 19:24:53 +00:00
Merge branch 'master' into master
This commit is contained in:
@@ -34,24 +34,24 @@ pub fn alphaBlit(x: usize, y: usize, tb_width: usize, tb_height: usize, cells: [
|
||||
}
|
||||
}
|
||||
|
||||
fn toBigNumber(char: u8, bigclock: Bigclock) []const u21 {
|
||||
fn toBigNumber(char: u8, bigclock: Bigclock) [SIZE]u21 {
|
||||
const locale_chars = switch (bigclock) {
|
||||
.fa => fa.locale_chars,
|
||||
.en => en.locale_chars,
|
||||
.none => unreachable,
|
||||
};
|
||||
return switch (char) {
|
||||
'0' => &locale_chars.ZERO,
|
||||
'1' => &locale_chars.ONE,
|
||||
'2' => &locale_chars.TWO,
|
||||
'3' => &locale_chars.THREE,
|
||||
'4' => &locale_chars.FOUR,
|
||||
'5' => &locale_chars.FIVE,
|
||||
'6' => &locale_chars.SIX,
|
||||
'7' => &locale_chars.SEVEN,
|
||||
'8' => &locale_chars.EIGHT,
|
||||
'9' => &locale_chars.NINE,
|
||||
':' => &locale_chars.S,
|
||||
else => &locale_chars.E,
|
||||
'0' => locale_chars.ZERO,
|
||||
'1' => locale_chars.ONE,
|
||||
'2' => locale_chars.TWO,
|
||||
'3' => locale_chars.THREE,
|
||||
'4' => locale_chars.FOUR,
|
||||
'5' => locale_chars.FIVE,
|
||||
'6' => locale_chars.SIX,
|
||||
'7' => locale_chars.SEVEN,
|
||||
'8' => locale_chars.EIGHT,
|
||||
'9' => locale_chars.NINE,
|
||||
':' => locale_chars.S,
|
||||
else => locale_chars.E,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ pub const SIZE = WIDTH * HEIGHT;
|
||||
pub const X: u32 = if (builtin.os.tag == .linux or builtin.os.tag.isBSD()) 0x2593 else '#';
|
||||
pub const O: u32 = 0;
|
||||
|
||||
// zig fmt: off
|
||||
pub const LocaleChars = struct {
|
||||
ZERO: [SIZE]u21,
|
||||
ONE: [SIZE]u21,
|
||||
@@ -20,4 +21,5 @@ pub const LocaleChars = struct {
|
||||
NINE: [SIZE]u21,
|
||||
S: [SIZE]u21,
|
||||
E: [SIZE]u21,
|
||||
};
|
||||
};
|
||||
// zig fmt: on
|
||||
|
||||
@@ -44,7 +44,6 @@ err_perm_user: []const u8 = "failed to downgrade user permissions",
|
||||
err_pwnam: []const u8 = "failed to get user info",
|
||||
err_sleep: []const u8 = "failed to execute sleep command",
|
||||
err_tty_ctrl: []const u8 = "tty control transfer failed",
|
||||
err_unknown: []const u8 = "an unknown error occurred",
|
||||
err_user_gid: []const u8 = "failed to set user GID",
|
||||
err_user_init: []const u8 = "failed to initialize user",
|
||||
err_user_uid: []const u8 = "failed to set user UID",
|
||||
|
||||
@@ -967,6 +967,6 @@ fn getAuthErrorMsg(err: anyerror, lang: Lang) []const u8 {
|
||||
error.PamSystemError => lang.err_pam_sys,
|
||||
error.PamUserUnknown => lang.err_pam_user_unknown,
|
||||
error.PamAbort => lang.err_pam_abort,
|
||||
else => lang.err_unknown,
|
||||
else => @errorName(err),
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user