Naming pass for byte order conversion
This commit is contained in:
1 parent
0a2b3f91ab
commit
6cdf3d8d22
3 files changed
+23
-19
No files matched your search
+2
-2
@@ -766,7 +766,7 @@ impl Entry {
|
||||
let buf_unit = usize::from(type_.byte_len());
|
||||
let mul_of_ty = buffer.len() / buf_unit * buf_unit;
|
||||
|
||||
let cls = type_.byte_order_class();
|
||||
let cls = type_.endian_bytes();
|
||||
let native = ByteOrder::native();
|
||||
|
||||
while total_bytes > 0 {
|
||||
@@ -777,7 +777,7 @@ impl Entry {
|
||||
let buffer = &mut buffer[..now as usize];
|
||||
reader.inner().read_exact(buffer)?;
|
||||
|
||||
reader.byte_order.convert_class(cls, buffer, native);
|
||||
reader.byte_order.convert_endian_bytes(cls, buffer, native);
|
||||
collect(buffer);
|
||||
}
|
||||
|
||||
|
||||
+5
-5
@@ -538,13 +538,13 @@ fn fix_endianness(buf: &mut [u8], byte_order: ByteOrder, bit_depth: u8) {
|
||||
let host = ByteOrder::native();
|
||||
|
||||
let class = match bit_depth {
|
||||
0..=8 => crate::tags::ByteOrderClass::One,
|
||||
9..=16 => crate::tags::ByteOrderClass::Two,
|
||||
17..=32 => crate::tags::ByteOrderClass::Four,
|
||||
_ => crate::tags::ByteOrderClass::Eight,
|
||||
0..=8 => crate::tags::EndianBytes::One,
|
||||
9..=16 => crate::tags::EndianBytes::Two,
|
||||
17..=32 => crate::tags::EndianBytes::Four,
|
||||
_ => crate::tags::EndianBytes::Eight,
|
||||
};
|
||||
|
||||
host.convert_class(class, buf, byte_order);
|
||||
host.convert_endian_bytes(class, buf, byte_order);
|
||||
}
|
||||
|
||||
impl<R: Read + Seek> Decoder<R> {
|
||||
|
||||
Reference in new issue
Block a user