Future-proof repr(packed) => repr(C, packed).

This commit is contained in:
4lDO2
2024-09-08 21:06:03 +02:00
parent 5c8f22b069
commit 707162611e
7 changed files with 11 additions and 11 deletions
+2 -2
View File
@@ -123,7 +123,7 @@ impl Allocator {
}
}
#[repr(packed)]
#[repr(C, packed)]
pub struct AllocEntry {
index: Le<u64>,
count: Le<i64>,
@@ -187,7 +187,7 @@ impl fmt::Debug for AllocEntry {
}
/// Alloc log node
#[repr(packed)]
#[repr(C, packed)]
pub struct AllocList {
pub prev: BlockPtr<AllocList>,
pub entries: [AllocEntry; ALLOC_LIST_ENTRIES],
+3 -3
View File
@@ -125,7 +125,7 @@ impl<T: ops::Deref<Target = [u8]>> BlockData<T> {
}
}
#[repr(packed)]
#[repr(C, packed)]
pub struct BlockList<T> {
pub ptrs: [BlockPtr<T>; BLOCK_LIST_ENTRIES],
}
@@ -176,7 +176,7 @@ impl<T> ops::DerefMut for BlockList<T> {
}
}
#[repr(packed)]
#[repr(C, packed)]
pub struct BlockPtr<T> {
addr: Le<u64>,
hash: Le<u64>,
@@ -253,7 +253,7 @@ impl<T> fmt::Debug for BlockPtr<T> {
}
}
#[repr(packed)]
#[repr(C, packed)]
pub struct BlockRaw([u8; BLOCK_SIZE as usize]);
unsafe impl BlockTrait for BlockRaw {
+1 -1
View File
@@ -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<Node>,
name: [u8; DIR_ENTRY_MAX_LENGTH],
+1 -1
View File
@@ -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],
+1 -1
View File
@@ -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,
+1 -1
View File
@@ -80,7 +80,7 @@ type BlockListL3 = BlockList<BlockListL2>;
type BlockListL4 = BlockList<BlockListL3>;
/// A file/folder node
#[repr(packed)]
#[repr(C, packed)]
pub struct Node {
pub mode: Le<u16>,
pub uid: Le<u32>,
+2 -2
View File
@@ -45,7 +45,7 @@ impl<T> TreeData<T> {
}
}
#[repr(packed)]
#[repr(C, packed)]
pub struct TreeList<T> {
pub ptrs: [BlockPtr<T>; TREE_LIST_ENTRIES],
}
@@ -85,7 +85,7 @@ impl<T> ops::DerefMut for TreeList<T> {
}
}
#[repr(packed)]
#[repr(C, packed)]
pub struct TreePtr<T> {
id: Le<u32>,
phantom: PhantomData<T>,