fix missing renames

This commit is contained in:
Vinzenz Schroeter 2025-06-23 21:16:22 +02:00
parent 323ba6128e
commit 5a849a87c7
6 changed files with 53 additions and 63 deletions

View file

@ -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.
///

View file

@ -14,7 +14,7 @@ wrap_fields!(Cp437GridCommand;
wrap_origin_accessors!(Cp437GridCommand);
wrap_functions!(cmd_cp437grid;
wrap_functions!(associate Cp437GridCommand;
/// Show text on the screen.
///

View file

@ -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.
///