Skip to content

Commit

Permalink
Zero is one :)
Browse files Browse the repository at this point in the history
  • Loading branch information
Elsie19 committed Jan 12, 2025
1 parent 54c2cec commit 9527ecc
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,9 @@ impl Type<'_> {
/// Returns byte size for values of the type
pub fn size(&self) -> u64 {
match self {
Self::Byte | Self::SignedByte | Self::UnsignedByte => 1,
Self::Byte | Self::SignedByte | Self::UnsignedByte | Self::Zero => 1,
Self::Halfword | Self::SignedHalfword | Self::UnsignedHalfword => 2,
// TODO: I don't actually know if [`Zero`] is 4.
Self::Word | Self::Single | Self::Zero => 4,
Self::Word | Self::Single => 4,
Self::Long | Self::Double => 8,
Self::Aggregate(td) => {
// TODO: correct for alignment
Expand Down

0 comments on commit 9527ecc

Please sign in to comment.