mirror of
https://github.com/ziglang/zig.git
synced 2024-12-03 18:38:45 +00:00
fix std.ascii type error and inverted logic
previously: ``` ...\lib\zig\std\ascii.zig:203:20: error: unable to perform binary not operation on type 'comptime_int' return c | ~0b00100000; ^ ```
This commit is contained in:
parent
a824a8c687
commit
5703ab1d0c
@ -200,7 +200,7 @@ pub fn isBlank(c: u8) bool {
|
||||
|
||||
pub fn toUpper(c: u8) u8 {
|
||||
if (isLower(c)) {
|
||||
return c | ~0b00100000;
|
||||
return c & 0b11011111;
|
||||
} else {
|
||||
return c;
|
||||
}
|
||||
@ -208,7 +208,7 @@ pub fn toUpper(c: u8) u8 {
|
||||
|
||||
pub fn toLower(c: u8) u8 {
|
||||
if (isUpper(c)) {
|
||||
return c & 0b00100000;
|
||||
return c | 0b00100000;
|
||||
} else {
|
||||
return c;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user