From c2c379b870a767c6e35c234cb69beedf4f6f1bc4 Mon Sep 17 00:00:00 2001 From: Dorota Czaplejewicz Date: Tue, 9 Mar 2021 14:59:23 +0000 Subject: [PATCH] Rust: Remove unnecessary no_mangle statements to silence warnings --- src/drawing.rs | 1 - src/imservice.rs | 2 +- src/layout.rs | 1 - src/locale.rs | 1 - src/manager.rs | 1 - src/popover.rs | 1 - src/ui_manager.rs | 1 - src/vkeyboard.rs | 1 - 8 files changed, 1 insertion(+), 8 deletions(-) diff --git a/src/drawing.rs b/src/drawing.rs index 5a0f91ad..58210268 100644 --- a/src/drawing.rs +++ b/src/drawing.rs @@ -24,7 +24,6 @@ mod c { #[derive(Clone, Copy)] pub struct EekRenderer(*const c_void); - #[no_mangle] extern "C" { // Button and View inside CButtonPlace are safe to pass to C // as long as they don't outlive the call diff --git a/src/imservice.rs b/src/imservice.rs index e8723e2f..3a87de4b 100644 --- a/src/imservice.rs +++ b/src/imservice.rs @@ -32,9 +32,9 @@ pub mod c { #[repr(transparent)] pub struct InputMethod(*const c_void); - #[no_mangle] extern "C" { fn imservice_destroy_im(im: *mut c::InputMethod); + #[allow(improper_ctypes)] // IMService will never be dereferenced in C pub fn imservice_connect_listeners(im: *mut InputMethod, imservice: *const IMService); pub fn eek_input_method_commit_string(im: *mut InputMethod, text: *const c_char); diff --git a/src/layout.rs b/src/layout.rs index 03b20039..c464a522 100644 --- a/src/layout.rs +++ b/src/layout.rs @@ -52,7 +52,6 @@ pub mod c { #[derive(Copy, Clone)] pub struct EekGtkKeyboard(pub *const gtk_sys::GtkWidget); - #[no_mangle] extern "C" { #[allow(improper_ctypes)] pub fn eek_gtk_keyboard_emit_feedback( diff --git a/src/locale.rs b/src/locale.rs index 03e6bd9c..63ff6fca 100644 --- a/src/locale.rs +++ b/src/locale.rs @@ -24,7 +24,6 @@ mod c { #[repr(C)] pub struct GnomeXkbInfo(*const c_void); - #[no_mangle] extern "C" { // from libc pub fn strcoll(cs: *const c_char, ct: *const c_char) -> c_int; diff --git a/src/manager.rs b/src/manager.rs index 42d1ce26..55fc561a 100644 --- a/src/manager.rs +++ b/src/manager.rs @@ -9,7 +9,6 @@ pub mod c { #[derive(Clone, Copy)] pub struct Manager(*const c_void); - #[no_mangle] extern "C" { pub fn eekboard_context_service_set_overlay( manager: Manager, diff --git a/src/popover.rs b/src/popover.rs index 7535ecb1..92103869 100644 --- a/src/popover.rs +++ b/src/popover.rs @@ -29,7 +29,6 @@ use ::logging::Warn; mod c { use std::os::raw::c_char; - #[no_mangle] extern "C" { pub fn popover_open_settings_panel(panel: *const c_char); } diff --git a/src/ui_manager.rs b/src/ui_manager.rs index a9196c1b..3aa3f0b1 100644 --- a/src/ui_manager.rs +++ b/src/ui_manager.rs @@ -19,7 +19,6 @@ pub mod c { #[repr(transparent)] pub struct UIManager(*const c_void); - #[no_mangle] extern "C" { pub fn server_context_service_update_visible(imservice: *const UIManager, active: u32); pub fn server_context_service_release_visibility(imservice: *const UIManager); diff --git a/src/vkeyboard.rs b/src/vkeyboard.rs index 54f3142f..aff822a7 100644 --- a/src/vkeyboard.rs +++ b/src/vkeyboard.rs @@ -37,7 +37,6 @@ pub mod c { } } - #[no_mangle] extern "C" { // From libc, to let KeyMap get deallocated. fn close(fd: u32);