Minor fixes
This commit is contained in:
@@ -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 => zig_int.signedness == .unsigned and zig_int.bits == 64,
|
||||||
.unsigned_long_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,
|
else => false,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -451,7 +451,7 @@ pub const ChunkType = enum(u32) {
|
|||||||
_,
|
_,
|
||||||
|
|
||||||
fn fromName(name: *const [4]u8) 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 {
|
pub fn fromBytes(bytes: *const [4]u8) ChunkType {
|
||||||
@@ -459,18 +459,18 @@ pub const ChunkType = enum(u32) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn toBytes(self: ChunkType) [4]u8 {
|
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;
|
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;
|
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;
|
return self.toBytes()[3] & 0b0010_0000 != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -493,7 +493,7 @@ pub const StandardKeyword = enum {
|
|||||||
Description,
|
Description,
|
||||||
/// Copyright notice
|
/// Copyright notice
|
||||||
Copyright,
|
Copyright,
|
||||||
/// Time Time of original image creation
|
/// Time of original image creation
|
||||||
Creation,
|
Creation,
|
||||||
/// Software used to create the image
|
/// Software used to create the image
|
||||||
Software,
|
Software,
|
||||||
|
|||||||
Reference in New Issue
Block a user