Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix nightly clippy warnings #1551

Merged
merged 17 commits into from
Jan 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ jobs:
features: "v4_14,xml_validation,blueprint",
test_sys: false,
}
- { name: "gsk4", features: "v4_14,broadway", test_sys: true }
- { name: "gdk4", features: "v4_12,gl", test_sys: true }
- { name: "gsk4", features: "v4_14,broadway,vulkan", test_sys: true }
- { name: "gdk4", features: "v4_14,gl", test_sys: true }
- {
name: "gdk4-wayland",
features: "v4_12,wayland_crate,egl,xkb_crate",
features: "v4_12,wayland_crate,egl",
test_sys: true,
}
- { name: "gdk4-x11", features: "v4_4,xlib,egl", test_sys: false }
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/windows-msvc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
python-version: "3.x"

- name: Install Python Dependencies
run: pip install meson ninja
run: pip install meson ninja setuptools packaging

- name: Setup MSVC
uses: bus1/cabuild/action/msdevshell@v1
Expand All @@ -75,7 +75,7 @@ jobs:
working-directory: /gtk
if: steps.cache.outputs.cache-hit != 'true'
run: |
meson setup builddir --prefix=C:/gnome -Dbackend_max_links=1 -Ddemos=false -Dbuild-tests=false -Dmedia-gstreamer=disabled -Dbuild-examples=false -Dglib:tests=false -Dharfbuzz:tests=disabled -Dharfbuzz:docs=disabled -Dgraphene:tests=false -Dgdk-pixbuf:tests=false -Dcairo:tests=disabled
meson setup builddir --prefix=C:/gnome -Dbackend_max_links=1 -Ddemos=false -Dbuild-tests=false -Dvulkan=disabled -Dmedia-gstreamer=disabled -Dbuild-examples=false -Dglib:tests=false -Dharfbuzz:tests=disabled -Dharfbuzz:docs=disabled -Dgraphene:tests=false -Dgdk-pixbuf:tests=false -Dcairo:tests=disabled

- name: Build and install GTK
working-directory: /gtk
Expand Down
2 changes: 0 additions & 2 deletions gdk4-wayland/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ v4_10 = ["ffi/v4_10", "v4_4", "gdk/v4_10"]
v4_12 = ["ffi/v4_12", "v4_10", "gdk/v4_12"]
wayland_crate = ["wayland-client", "wayland-backend"]
egl = ["khronos-egl"]
xkb_crate = ["xkb"]

[package.metadata.docs.rs]
all-features = true
Expand All @@ -34,7 +33,6 @@ libc = "0.2"
wayland-client = {version = "0.31.0", optional = true}
wayland-backend = {version = "0.3.0", optional = true, features = ["client_system"]}
khronos-egl = {version = "6.0", optional = true}
xkb = {version = "0.3", optional = true}

[dev-dependencies]
gir-format-check = "^0.1"
2 changes: 1 addition & 1 deletion gdk4-wayland/Gir.toml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ status = "generate"
manual = true
[[object.function]]
name = "get_xkb_keymap"
manual = true
ignore = true

[[object]]
name = "GdkWayland.WaylandDisplay"
Expand Down
1 change: 0 additions & 1 deletion gdk4-wayland/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ gdk-wayland = { git = "https://github.com/gtk-rs/gtk4-rs.git", package = "gdk4-w
| `v4_4` | Enable the new APIs part of GTK 4.4 |
| `wayland_crate` | Integration with the [wayland-client](https://crates.io/crates/wayland-client) crate |
| `egl` | Integration with the [khronos-egl](https://crates.io/crates/khronos-egl) crate |
| `xkb_crate` | Integration with [xkb](https://crates.io/crates/xkb) crate |

### See Also

Expand Down
4 changes: 2 additions & 2 deletions gdk4-wayland/src/auto/versions.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ 428c880ecf0b)
from gir-files (https://github.com/gtk-rs/gir-files @ 20031a537e40)
Generated by gir (https://github.com/gtk-rs/gir @ 1c7a6b57a5fc)
from gir-files (https://github.com/gtk-rs/gir-files @ 21b29d0e0c1a)
4 changes: 2 additions & 2 deletions gdk4-wayland/src/auto/wayland_toplevel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ impl WaylandToplevel {
) {
let toplevel = from_glib_borrow(toplevel);
let handle: Borrowed<glib::GString> = from_glib_borrow(handle);
let callback: &P = &*(user_data as *mut _);
let callback = &*(user_data as *mut P);
(*callback)(&toplevel, handle.as_str())
}
let callback = Some(callback_func::<P> as _);
unsafe extern "C" fn destroy_func_func<P: Fn(&WaylandToplevel, &str) + 'static>(
data: glib::ffi::gpointer,
) {
let _callback: Box_<P> = Box_::from_raw(data as *mut _);
let _callback = Box_::from_raw(data as *mut P);
}
let destroy_call3 = Some(destroy_func_func::<P> as _);
let super_callback0: Box_<P> = callback_data;
Expand Down
3 changes: 0 additions & 3 deletions gdk4-wayland/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ pub use khronos_egl;
#[cfg(feature = "wayland_crate")]
#[cfg_attr(docsrs, doc(cfg(feature = "wayland_crate")))]
pub use wayland_client;
#[cfg(all(feature = "v4_4", feature = "xkb_crate"))]
#[cfg_attr(docsrs, doc(cfg(all(feature = "v4_4", feature = "xkb_crate"))))]
pub use xkb;

mod auto;

Expand Down
4 changes: 0 additions & 4 deletions gdk4-wayland/src/prelude.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,5 @@

#[doc(hidden)]
pub use gdk::prelude::*;
#[doc(hidden)]
pub use gio::prelude::*;
#[doc(hidden)]
pub use glib::prelude::*;

pub use crate::wayland_surface::WaylandSurfaceExtManual;
25 changes: 2 additions & 23 deletions gdk4-wayland/src/wayland_device.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
// Take a look at the license at the top of the repository in the LICENSE file.

#[cfg(any(feature = "wayland_crate", feature = "xkb_crate"))]
#[cfg_attr(
docsrs,
doc(cfg(any(feature = "wayland_crate", feature = "xkb_crate")))
)]
#[cfg(feature = "wayland_crate")]
#[cfg_attr(docsrs, doc(cfg(feature = "wayland_crate")))]
use glib::translate::*;
#[cfg(feature = "wayland_crate")]
#[cfg_attr(docsrs, doc(cfg(feature = "wayland_crate")))]
Expand All @@ -13,9 +10,6 @@ use wayland_client::{
protocol::{wl_keyboard::WlKeyboard, wl_pointer::WlPointer, wl_seat::WlSeat},
Proxy,
};
#[cfg(all(feature = "v4_4", feature = "xkb_crate"))]
#[cfg_attr(docsrs, doc(cfg(all(feature = "v4_4", feature = "xkb_crate"))))]
use xkb::Keymap;

#[cfg(feature = "wayland_crate")]
#[cfg_attr(docsrs, doc(cfg(feature = "wayland_crate")))]
Expand Down Expand Up @@ -80,19 +74,4 @@ impl WaylandDevice {
}
}
}

#[cfg(all(feature = "v4_4", feature = "xkb_crate"))]
#[cfg_attr(docsrs, doc(cfg(all(feature = "v4_4", feature = "xkb_crate"))))]
#[doc(alias = "gdk_wayland_device_get_xkb_keymap")]
#[doc(alias = "get_xkb_keymap")]
pub fn xkb_keymap(&self) -> Option<Keymap> {
unsafe {
let ptr = ffi::gdk_wayland_device_get_xkb_keymap(self.to_glib_none().0);
if ptr.is_null() {
None
} else {
Some(Keymap::from_ptr(ptr as _))
}
}
}
}
10 changes: 5 additions & 5 deletions gdk4-wayland/sys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,39 +31,39 @@ pub struct _GdkWaylandDeviceClass {
_marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
}

pub type GdkWaylandDeviceClass = *mut _GdkWaylandDeviceClass;
pub type GdkWaylandDeviceClass = _GdkWaylandDeviceClass;

#[repr(C)]
pub struct _GdkWaylandDisplayClass {
_data: [u8; 0],
_marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
}

pub type GdkWaylandDisplayClass = *mut _GdkWaylandDisplayClass;
pub type GdkWaylandDisplayClass = _GdkWaylandDisplayClass;

#[repr(C)]
pub struct _GdkWaylandGLContextClass {
_data: [u8; 0],
_marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
}

pub type GdkWaylandGLContextClass = *mut _GdkWaylandGLContextClass;
pub type GdkWaylandGLContextClass = _GdkWaylandGLContextClass;

#[repr(C)]
pub struct _GdkWaylandMonitorClass {
_data: [u8; 0],
_marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
}

pub type GdkWaylandMonitorClass = *mut _GdkWaylandMonitorClass;
pub type GdkWaylandMonitorClass = _GdkWaylandMonitorClass;

#[repr(C)]
pub struct _GdkWaylandSeatClass {
_data: [u8; 0],
_marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
}

pub type GdkWaylandSeatClass = *mut _GdkWaylandSeatClass;
pub type GdkWaylandSeatClass = _GdkWaylandSeatClass;

// Classes
#[repr(C)]
Expand Down
4 changes: 2 additions & 2 deletions gdk4-wayland/sys/versions.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ 428c880ecf0b)
from gir-files (https://github.com/gtk-rs/gir-files @ 20031a537e40)
Generated by gir (https://github.com/gtk-rs/gir @ 1c7a6b57a5fc)
from gir-files (https://github.com/gtk-rs/gir-files @ 21b29d0e0c1a)
4 changes: 2 additions & 2 deletions gdk4-win32/src/auto/versions.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ 428c880ecf0b)
from gir-files (https://github.com/gtk-rs/gir-files @ 20031a537e40)
Generated by gir (https://github.com/gtk-rs/gir @ 1c7a6b57a5fc)
from gir-files (https://github.com/gtk-rs/gir-files @ 21b29d0e0c1a)
1 change: 1 addition & 0 deletions gdk4-win32/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ pub use windows;
mod rt;

#[allow(clippy::upper_case_acronyms)]
#[allow(unused_imports)]
mod auto;

pub mod prelude;
Expand Down
4 changes: 0 additions & 4 deletions gdk4-win32/src/prelude.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,3 @@

#[doc(hidden)]
pub use gdk::prelude::*;
#[doc(hidden)]
pub use gio::prelude::*;
#[doc(hidden)]
pub use glib::prelude::*;
2 changes: 1 addition & 1 deletion gdk4-win32/src/win32_display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ impl Win32Display {
) -> i32 {
let f: &F = &*(box_ as *const F);
f(
&from_glib_borrow(display as *mut ffi::GdkWin32Display),
&from_glib_borrow(display),
&mut *(msg as *mut MSG),
&mut *return_value,
)
Expand Down
16 changes: 8 additions & 8 deletions gdk4-win32/sys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,63 +42,63 @@ pub struct _GdkWin32DisplayClass {
_marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
}

pub type GdkWin32DisplayClass = *mut _GdkWin32DisplayClass;
pub type GdkWin32DisplayClass = _GdkWin32DisplayClass;

#[repr(C)]
pub struct _GdkWin32DisplayManagerClass {
_data: [u8; 0],
_marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
}

pub type GdkWin32DisplayManagerClass = *mut _GdkWin32DisplayManagerClass;
pub type GdkWin32DisplayManagerClass = _GdkWin32DisplayManagerClass;

#[repr(C)]
pub struct _GdkWin32DragClass {
_data: [u8; 0],
_marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
}

pub type GdkWin32DragClass = *mut _GdkWin32DragClass;
pub type GdkWin32DragClass = _GdkWin32DragClass;

#[repr(C)]
pub struct _GdkWin32GLContextClass {
_data: [u8; 0],
_marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
}

pub type GdkWin32GLContextClass = *mut _GdkWin32GLContextClass;
pub type GdkWin32GLContextClass = _GdkWin32GLContextClass;

#[repr(C)]
pub struct _GdkWin32HCursorClass {
_data: [u8; 0],
_marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
}

pub type GdkWin32HCursorClass = *mut _GdkWin32HCursorClass;
pub type GdkWin32HCursorClass = _GdkWin32HCursorClass;

#[repr(C)]
pub struct _GdkWin32MonitorClass {
_data: [u8; 0],
_marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
}

pub type GdkWin32MonitorClass = *mut _GdkWin32MonitorClass;
pub type GdkWin32MonitorClass = _GdkWin32MonitorClass;

#[repr(C)]
pub struct _GdkWin32ScreenClass {
_data: [u8; 0],
_marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
}

pub type GdkWin32ScreenClass = *mut _GdkWin32ScreenClass;
pub type GdkWin32ScreenClass = _GdkWin32ScreenClass;

#[repr(C)]
pub struct _GdkWin32SurfaceClass {
_data: [u8; 0],
_marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
}

pub type GdkWin32SurfaceClass = *mut _GdkWin32SurfaceClass;
pub type GdkWin32SurfaceClass = _GdkWin32SurfaceClass;

// Classes
#[repr(C)]
Expand Down
4 changes: 2 additions & 2 deletions gdk4-win32/sys/versions.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ 428c880ecf0b)
from gir-files (https://github.com/gtk-rs/gir-files @ 20031a537e40)
Generated by gir (https://github.com/gtk-rs/gir @ 1c7a6b57a5fc)
from gir-files (https://github.com/gtk-rs/gir-files @ 21b29d0e0c1a)
4 changes: 2 additions & 2 deletions gdk4-x11/src/auto/versions.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ 428c880ecf0b)
from gir-files (https://github.com/gtk-rs/gir-files @ 20031a537e40)
Generated by gir (https://github.com/gtk-rs/gir @ 1c7a6b57a5fc)
from gir-files (https://github.com/gtk-rs/gir-files @ 21b29d0e0c1a)
4 changes: 0 additions & 4 deletions gdk4-x11/src/prelude.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,3 @@

#[doc(hidden)]
pub use gdk::prelude::*;
#[doc(hidden)]
pub use gio::prelude::*;
#[doc(hidden)]
pub use glib::prelude::*;
3 changes: 3 additions & 0 deletions gdk4-x11/src/x11_display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ impl X11Display {
#[cfg_attr(docsrs, doc(cfg(feature = "xlib")))]
#[doc(alias = "gdk_x11_display_get_xdisplay")]
#[doc(alias = "get_xdisplay")]
#[allow(clippy::missing_safety_doc)]
pub unsafe fn xdisplay(&self) -> *mut xlib::Display {
ffi::gdk_x11_display_get_xdisplay(self.to_glib_none().0) as *mut xlib::Display
}
Expand All @@ -62,13 +63,15 @@ impl X11Display {
#[cfg_attr(docsrs, doc(cfg(feature = "xlib")))]
#[doc(alias = "gdk_x11_display_get_xscreen")]
#[doc(alias = "get_xscreen")]
#[allow(clippy::missing_safety_doc)]
pub unsafe fn xscreen(&self) -> *mut xlib::Screen {
ffi::gdk_x11_display_get_xscreen(self.to_glib_none().0) as *mut xlib::Screen
}

#[cfg(feature = "xlib")]
#[cfg_attr(docsrs, doc(cfg(feature = "xlib")))]
#[doc(alias = "xevent")]
#[allow(clippy::missing_safety_doc)]
pub unsafe fn connect_xevent<F: Fn(&Self, *mut xlib::XEvent) -> glib::Propagation + 'static>(
&self,
f: F,
Expand Down
1 change: 1 addition & 0 deletions gdk4-x11/src/x11_screen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ impl X11Screen {
#[cfg_attr(docsrs, doc(cfg(feature = "xlib")))]
#[doc(alias = "gdk_x11_screen_get_xscreen")]
#[doc(alias = "get_xscreen")]
#[allow(clippy::missing_safety_doc)]
pub unsafe fn xscreen(&self) -> *mut xlib::Screen {
ffi::gdk_x11_screen_get_xscreen(self.to_glib_none().0) as *mut xlib::Screen
}
Expand Down
Loading
Loading