Skip to content

Commit

Permalink
rustfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Enet4 committed Jul 27, 2024
1 parent 1442841 commit fb0249a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 14 deletions.
2 changes: 1 addition & 1 deletion dos_x/src/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,4 @@ macro_rules! println {
$crate::djgpp::stdio::printf(msg.as_ptr() as *const core::ffi::c_char);
}
};
}
}
19 changes: 9 additions & 10 deletions dos_x/src/vga.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ pub unsafe fn put_pixel(x: u32, y: u32, c: u8) {
}

/// Draw a solid horizontal line at the given coordinates.
///
///
/// ### Safety
///
///
/// This function does not check whether the video mode is set correctly.
/// A video buffer of size 64_000 bytes
/// in VGA mode 13h is assumed.
Expand Down Expand Up @@ -104,9 +104,9 @@ pub unsafe fn draw_vline(x: i32, y: i32, length: u32, c: u8) {
}

/// Draw a solid rectangle at the given coordinates.
///
///
/// ### Safety
///
///
/// This function does not check whether the video mode is set correctly.
/// A video buffer of size 64_000 bytes
/// in VGA mode 13h is assumed.
Expand All @@ -129,12 +129,11 @@ pub unsafe fn draw_rect(x: i32, y: i32, width: u32, height: u32, c: u8) {
/// in VGA mode 13h is assumed.
#[inline]
pub unsafe fn blit_rect(
data: &[u8],
data_dim: (u32, u32),
origin: (u32, u32, u32, u32),
target: (i32, i32)
data: &[u8],
data_dim: (u32, u32),
origin: (u32, u32, u32, u32),
target: (i32, i32),
) {

let (data_width, data_height) = data_dim;
let (x, y, width, height) = origin;
let (target_x, target_y) = target;
Expand All @@ -152,7 +151,7 @@ pub unsafe fn blit_rect(
dosmemput(
data.as_ptr().byte_offset(src as isize),
width as usize,
VGA_BUFFER_ADDR + target as u32
VGA_BUFFER_ADDR + target as u32,
);

// next row
Expand Down
4 changes: 1 addition & 3 deletions examples/opl/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ fn dos_main() {
let args = dos_x::argv();

let vgm_filename = if args.len() > 1 {
unsafe {
Some(CStr::from_ptr(args[1]))
}
unsafe { Some(CStr::from_ptr(args[1])) }
} else {
None
};
Expand Down

0 comments on commit fb0249a

Please sign in to comment.