From 707162611ed2e9b3f3544e5e7a28f4ca1ad92a4e Mon Sep 17 00:00:00 2001 From: 4lDO2 <4lDO2@protonmail.com> Date: Sun, 8 Sep 2024 21:06:03 +0200 Subject: [PATCH] Future-proof repr(packed) => repr(C, packed). --- src/allocator.rs | 4 ++-- src/block.rs | 6 +++--- src/dir.rs | 2 +- src/header.rs | 2 +- src/key.rs | 2 +- src/node.rs | 2 +- src/tree.rs | 4 ++-- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/allocator.rs b/src/allocator.rs index 89fc163281..c50cc2f59c 100644 --- a/src/allocator.rs +++ b/src/allocator.rs @@ -123,7 +123,7 @@ impl Allocator { } } -#[repr(packed)] +#[repr(C, packed)] pub struct AllocEntry { index: Le, count: Le, @@ -187,7 +187,7 @@ impl fmt::Debug for AllocEntry { } /// Alloc log node -#[repr(packed)] +#[repr(C, packed)] pub struct AllocList { pub prev: BlockPtr, pub entries: [AllocEntry; ALLOC_LIST_ENTRIES], diff --git a/src/block.rs b/src/block.rs index d4f75ee725..6fbdcab251 100644 --- a/src/block.rs +++ b/src/block.rs @@ -125,7 +125,7 @@ impl> BlockData { } } -#[repr(packed)] +#[repr(C, packed)] pub struct BlockList { pub ptrs: [BlockPtr; BLOCK_LIST_ENTRIES], } @@ -176,7 +176,7 @@ impl ops::DerefMut for BlockList { } } -#[repr(packed)] +#[repr(C, packed)] pub struct BlockPtr { addr: Le, hash: Le, @@ -253,7 +253,7 @@ impl fmt::Debug for BlockPtr { } } -#[repr(packed)] +#[repr(C, packed)] pub struct BlockRaw([u8; BLOCK_SIZE as usize]); unsafe impl BlockTrait for BlockRaw { diff --git a/src/dir.rs b/src/dir.rs index cea613d1c8..1a93c1a553 100644 --- a/src/dir.rs +++ b/src/dir.rs @@ -3,7 +3,7 @@ use core::{mem, ops, slice, str}; use crate::{BlockLevel, BlockTrait, Node, TreePtr, RECORD_LEVEL, DIR_ENTRY_MAX_LENGTH}; -#[repr(packed)] +#[repr(C, packed)] pub struct DirEntry { node_ptr: TreePtr, name: [u8; DIR_ENTRY_MAX_LENGTH], diff --git a/src/header.rs b/src/header.rs index def5f1f487..ecc501e456 100644 --- a/src/header.rs +++ b/src/header.rs @@ -10,7 +10,7 @@ pub const HEADER_RING: u64 = 256; /// The header of the filesystem #[derive(Clone, Copy)] -#[repr(packed)] +#[repr(C, packed)] pub struct Header { /// Signature, should be SIGNATURE pub signature: [u8; 8], diff --git a/src/key.rs b/src/key.rs index 9c18623349..7a0eb2fecf 100644 --- a/src/key.rs +++ b/src/key.rs @@ -40,7 +40,7 @@ impl Salt { /// The key slot, containing the salt and encrypted key that are used with one password #[derive(Clone, Copy, Default)] -#[repr(packed)] +#[repr(C, packed)] pub struct KeySlot { salt: Salt, encrypted_key: EncryptedKey, diff --git a/src/node.rs b/src/node.rs index 136072d7d7..44933b9de9 100644 --- a/src/node.rs +++ b/src/node.rs @@ -80,7 +80,7 @@ type BlockListL3 = BlockList; type BlockListL4 = BlockList; /// A file/folder node -#[repr(packed)] +#[repr(C, packed)] pub struct Node { pub mode: Le, pub uid: Le, diff --git a/src/tree.rs b/src/tree.rs index 48b011c085..63df18318b 100644 --- a/src/tree.rs +++ b/src/tree.rs @@ -45,7 +45,7 @@ impl TreeData { } } -#[repr(packed)] +#[repr(C, packed)] pub struct TreeList { pub ptrs: [BlockPtr; TREE_LIST_ENTRIES], } @@ -85,7 +85,7 @@ impl ops::DerefMut for TreeList { } } -#[repr(packed)] +#[repr(C, packed)] pub struct TreePtr { id: Le, phantom: PhantomData,