Future-proof repr(packed) => repr(C, packed).
This commit is contained in:
+2
-2
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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>,
|
||||
|
||||
Reference in New Issue
Block a user