Skip to content

Commit

Permalink
Fix clippy unnecessary_cast lint
Browse files Browse the repository at this point in the history
Removed the case where `bindings.rs` defined the constants as `u32`, but
allowed the lint where it instead uses a type alias defined as
`libc::c_uint` (which tecnically may not be 32-bit).
  • Loading branch information
ids1024 authored and Drakulix committed Sep 27, 2024
1 parent 7403bdf commit 8474859
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/buffer_object.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(clippy::unnecessary_cast)]

use crate::{AsRaw, Device, DeviceDestroyedError, Format, Modifier, Ptr, WeakPtr};

#[cfg(feature = "drm-support")]
Expand Down
8 changes: 4 additions & 4 deletions src/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ impl<T: AsFd> Device<T> {
let ptr = unsafe {
ffi::gbm_bo_import(
*self.ffi,
ffi::GBM_BO_IMPORT_WL_BUFFER as u32,
ffi::GBM_BO_IMPORT_WL_BUFFER,
buffer.id().as_ptr() as *mut _,
usage.bits(),
)
Expand Down Expand Up @@ -298,7 +298,7 @@ impl<T: AsFd> Device<T> {
) -> IoResult<BufferObject<U>> {
let ptr = ffi::gbm_bo_import(
*self.ffi,
ffi::GBM_BO_IMPORT_EGL_IMAGE as u32,
ffi::GBM_BO_IMPORT_EGL_IMAGE,
buffer,
usage.bits(),
);
Expand Down Expand Up @@ -337,7 +337,7 @@ impl<T: AsFd> Device<T> {
let ptr = unsafe {
ffi::gbm_bo_import(
*self.ffi,
ffi::GBM_BO_IMPORT_FD as u32,
ffi::GBM_BO_IMPORT_FD,
&mut fd_data as *mut ffi::gbm_import_fd_data as *mut _,
usage.bits(),
)
Expand Down Expand Up @@ -385,7 +385,7 @@ impl<T: AsFd> Device<T> {
let ptr = unsafe {
ffi::gbm_bo_import(
*self.ffi,
ffi::GBM_BO_IMPORT_FD_MODIFIER as u32,
ffi::GBM_BO_IMPORT_FD_MODIFIER,
&mut fd_data as *mut ffi::gbm_import_fd_modifier_data as *mut _,
usage.bits(),
)
Expand Down

0 comments on commit 8474859

Please sign in to comment.