Minor fixes
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user