Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions program/src/processor/initialize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ pub fn initialize(accounts: &mut [AccountView], instruction_data: &[u8]) -> Prog
}

/// The instruction data for the `Initialize` instruction.
#[repr(C)]
struct Initialize {
pub seed: [u8; 16],
pub encoding: u8,
Expand Down
1 change: 1 addition & 0 deletions program/src/processor/set_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ fn update_header<'a>(
}

/// The instruction data for the `SetData` instruction.
#[repr(C)]
struct SetData {
pub encoding: u8,
pub compression: u8,
Expand Down
1 change: 1 addition & 0 deletions program/src/processor/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ pub fn write(accounts: &mut [AccountView], instruction_data: &[u8]) -> ProgramRe
}

/// Instruction data expected by the `Write` instruction.
#[repr(C)]
struct Write<'a> {
/// Offset to write to.
offset: &'a [u8; 4],
Expand Down
1 change: 1 addition & 0 deletions program/src/state/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ pub struct UrlData<'a>(pub &'a str);
///
/// External data contains a reference (address) to an external account
/// and an offset and an optional length to specify the data range.
#[repr(C)]
pub struct ExternalData {
/// Address of the external account.
pub address: Address,
Expand Down
3 changes: 2 additions & 1 deletion program/src/state/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,9 @@ impl Zeroable for u32 {
const ZERO: Self = 0;
}

/// Trait for types that are considered `None` when their value
/// Wrapper for types that are considered `None` when their value
/// is equal to `Zeroable::ZERO`.
#[repr(transparent)]
#[derive(Clone, Debug)]
pub struct ZeroableOption<T: Zeroable>(T);

Expand Down
Loading