stm32/ipcc: naming

This commit is contained in:
xoviat 2023-05-20 10:20:35 -05:00
parent 5e86188c25
commit 383bef1711

View File

@ -30,29 +30,29 @@ impl Default for LinkedListNode {
}
impl LinkedListNode {
pub unsafe fn init_head(mut listHead: *mut LinkedListNode) {
(*listHead).next = listHead;
(*listHead).prev = listHead;
pub unsafe fn init_head(mut list_head: *mut LinkedListNode) {
(*list_head).next = list_head;
(*list_head).prev = list_head;
}
pub unsafe fn is_empty(mut listHead: *mut LinkedListNode) -> bool {
interrupt::free(|_| ((*listHead).next) == listHead)
pub unsafe fn is_empty(mut list_head: *mut LinkedListNode) -> bool {
interrupt::free(|_| ((*list_head).next) == list_head)
}
pub unsafe fn insert_head(mut listHead: *mut LinkedListNode, mut node: *mut LinkedListNode) {
pub unsafe fn insert_head(mut list_head: *mut LinkedListNode, mut node: *mut LinkedListNode) {
interrupt::free(|_| {
(*node).next = (*listHead).next;
(*node).prev = listHead;
(*listHead).next = node;
(*node).next = (*list_head).next;
(*node).prev = list_head;
(*list_head).next = node;
(*(*node).next).prev = node;
});
}
pub unsafe fn insert_tail(mut listHead: *mut LinkedListNode, mut node: *mut LinkedListNode) {
pub unsafe fn insert_tail(mut list_head: *mut LinkedListNode, mut node: *mut LinkedListNode) {
interrupt::free(|_| {
(*node).next = listHead;
(*node).prev = (*listHead).prev;
(*listHead).prev = node;
(*node).next = list_head;
(*node).prev = (*list_head).prev;
(*list_head).prev = node;
(*(*node).prev).next = node;
});
}
@ -64,17 +64,17 @@ impl LinkedListNode {
});
}
pub unsafe fn remove_head(mut listHead: *mut LinkedListNode, mut node: *mut *mut LinkedListNode) {
pub unsafe fn remove_head(mut list_head: *mut LinkedListNode, mut node: *mut *mut LinkedListNode) {
interrupt::free(|_| {
*node = (*listHead).next;
Self::remove_node((*listHead).next);
*node = (*list_head).next;
Self::remove_node((*list_head).next);
});
}
pub unsafe fn remove_tail(mut listHead: *mut LinkedListNode, mut node: *mut *mut LinkedListNode) {
pub unsafe fn remove_tail(mut list_head: *mut LinkedListNode, mut node: *mut *mut LinkedListNode) {
interrupt::free(|_| {
*node = (*listHead).prev;
Self::remove_node((*listHead).prev);
*node = (*list_head).prev;
Self::remove_node((*list_head).prev);
});
}
@ -96,13 +96,13 @@ impl LinkedListNode {
});
}
pub unsafe fn get_size(mut listHead: *mut LinkedListNode) -> usize {
pub unsafe fn get_size(mut list_head: *mut LinkedListNode) -> usize {
interrupt::free(|_| {
let mut size = 0;
let mut temp: *mut LinkedListNode = core::ptr::null_mut::<LinkedListNode>();
temp = (*listHead).next;
while temp != listHead {
temp = (*list_head).next;
while temp != list_head {
size += 1;
temp = (*temp).next
}