fix missing renames
This commit is contained in:
parent
323ba6128e
commit
5a849a87c7
6 changed files with 53 additions and 63 deletions
|
@ -14,7 +14,7 @@ wrap_fields!(CharGridCommand;
|
|||
|
||||
wrap_origin_accessors!(CharGridCommand);
|
||||
|
||||
wrap_functions!(cmd_chargrid;
|
||||
wrap_functions!(associate CharGridCommand;
|
||||
|
||||
/// Show UTF-8 encoded text on the screen.
|
||||
///
|
||||
|
|
|
@ -14,7 +14,7 @@ wrap_fields!(Cp437GridCommand;
|
|||
|
||||
wrap_origin_accessors!(Cp437GridCommand);
|
||||
|
||||
wrap_functions!(cmd_cp437grid;
|
||||
wrap_functions!(associate Cp437GridCommand;
|
||||
|
||||
/// Show text on the screen.
|
||||
///
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
use crate::{
|
||||
macros::{derive_clone, derive_free, wrap_functions},
|
||||
macros::{derive_clone, derive_free, wrap_functions, wrap_methods},
|
||||
mem::{
|
||||
heap_clone, heap_drop, heap_move, heap_move_nonnull, heap_move_ok,
|
||||
heap_remove,
|
||||
|
@ -11,7 +11,6 @@ use servicepoint::{
|
|||
HardResetCommand, Packet, TypedCommand,
|
||||
};
|
||||
use std::ptr::{null_mut, NonNull};
|
||||
use crate::macros::wrap_methods;
|
||||
|
||||
/// Pointer to one of the available command structs.
|
||||
#[repr(C)]
|
||||
|
@ -168,11 +167,12 @@ impl Drop for GenericCommand {
|
|||
CommandTag::BitmapLegacy => heap_drop(self.data.bitmap_legacy),
|
||||
}
|
||||
}
|
||||
|
||||
*self = Self::INVALID;
|
||||
}
|
||||
}
|
||||
|
||||
wrap_functions!(associate GenericCommand;
|
||||
|
||||
/// Tries to turn a [Packet] into a [GenericCommand].
|
||||
///
|
||||
/// The packet is dropped in the process.
|
||||
|
@ -181,7 +181,7 @@ wrap_functions!(associate GenericCommand;
|
|||
fn try_from_packet(
|
||||
packet: NonNull<Packet>,
|
||||
) -> NonNull<GenericCommand> {
|
||||
let packet = *unsafe { Box::from_raw(packet.as_ptr()) };
|
||||
let packet = unsafe { heap_remove(packet) };
|
||||
let result = servicepoint::TypedCommand::try_from(packet)
|
||||
.map(|value| match value {
|
||||
TypedCommand::Clear(clear) => GenericCommand {
|
||||
|
@ -252,10 +252,9 @@ wrap_functions!(associate GenericCommand;
|
|||
});
|
||||
heap_move_nonnull(result)
|
||||
}
|
||||
|
||||
);
|
||||
|
||||
wrap_methods!{GenericCommand;
|
||||
wrap_methods! { GenericCommand;
|
||||
/// Tries to turn a [GenericCommand] into a [Packet].
|
||||
/// The [GenericCommand] gets consumed.
|
||||
///
|
||||
|
|
|
@ -11,7 +11,7 @@ use std::ptr::NonNull;
|
|||
|
||||
wrap_grid!(Bitmap, bool);
|
||||
|
||||
wrap_functions!(bitmap;
|
||||
wrap_functions!(associate Bitmap;
|
||||
/// Creates a new [Bitmap] with the specified dimensions.
|
||||
///
|
||||
/// # Arguments
|
||||
|
|
|
@ -10,28 +10,19 @@ use std::ptr::NonNull;
|
|||
|
||||
wrap_grid!(Cp437Grid, u8);
|
||||
|
||||
wrap_functions!(cp437grid;
|
||||
|
||||
wrap_functions!(associate Cp437Grid;
|
||||
/// Creates a new [Cp437Grid] with the specified dimensions.
|
||||
///
|
||||
/// returns: [Cp437Grid] initialized to 0.
|
||||
fn new(
|
||||
width: usize,
|
||||
height: usize,
|
||||
) -> NonNull<Cp437Grid> {
|
||||
fn new(width: usize, height: usize) -> NonNull<Cp437Grid> {
|
||||
heap_move_nonnull(Cp437Grid::new(width, height))
|
||||
}
|
||||
|
||||
/// Loads a [Cp437Grid] with the specified dimensions from the provided data.
|
||||
fn load(
|
||||
width: usize,
|
||||
height: usize,
|
||||
data: ByteSlice,
|
||||
) -> *mut Cp437Grid {
|
||||
fn load(width: usize, height: usize, data: ByteSlice) -> *mut Cp437Grid {
|
||||
let data = unsafe { data.as_slice() };
|
||||
heap_move_some(Cp437Grid::load(width, height, data))
|
||||
}
|
||||
|
||||
);
|
||||
|
||||
wrap_methods!(Cp437Grid;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue