diff --git a/packages/cjit/src/types.zig b/packages/cjit/src/types.zig index f74678c..26dd4fc 100644 --- a/packages/cjit/src/types.zig +++ b/packages/cjit/src/types.zig @@ -170,7 +170,7 @@ pub fn isCompatible(comptime ZigType: type, c_type: Type) bool { .unsigned_long => zig_int.signedness == .unsigned and zig_int.bits == 64, .unsigned_long_long => zig_int.signedness == .unsigned and zig_int.bits == 64, - .char => zig_int.bits = 8, + .char => zig_int.bits == 8, else => false, }, diff --git a/packages/media/src/png.zig b/packages/media/src/png.zig index f1eab2b..6eb7681 100644 --- a/packages/media/src/png.zig +++ b/packages/media/src/png.zig @@ -451,7 +451,7 @@ pub const ChunkType = enum(u32) { _, fn fromName(name: *const [4]u8) u32 { - return @bitCast(name.*); + return std.mem.bytesToValue(u32, name); } pub fn fromBytes(bytes: *const [4]u8) ChunkType { @@ -459,18 +459,18 @@ pub const ChunkType = enum(u32) { } pub fn toBytes(self: ChunkType) [4]u8 { - return @bitCast(@intFromEnum(self)); + return std.mem.toBytes(self); } - pub fn ancillary(self: ChunkType) bool { + pub fn isAncillary(self: ChunkType) bool { return self.toBytes()[0] & 0b0010_0000 != 0; } - pub fn private(self: ChunkType) bool { + pub fn isPrivate(self: ChunkType) bool { return self.toBytes()[1] & 0b0010_0000 != 0; } - pub fn safeToCopy(self: ChunkType) bool { + pub fn isSafeToCopy(self: ChunkType) bool { return self.toBytes()[3] & 0b0010_0000 != 0; } @@ -493,7 +493,7 @@ pub const StandardKeyword = enum { Description, /// Copyright notice Copyright, - /// Time Time of original image creation + /// Time of original image creation Creation, /// Software used to create the image Software,