Skip to content

Commit

Permalink
all: mark extern blocks as unsafe
Browse files Browse the repository at this point in the history
  • Loading branch information
mahkoh committed Oct 20, 2024
1 parent 0cbaf44 commit 448b9e3
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/libinput.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ pub struct LibInput {
li: *mut libinput,
}

extern "C" {
unsafe extern "C" {
fn jay_libinput_log_handler_bridge();
}

Expand Down
2 changes: 1 addition & 1 deletion src/libinput/sys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pub struct libinput_tablet_tool(u8);
pub struct libinput_event_touch(u8);

#[link(name = "input")]
extern "C" {
unsafe extern "C" {
pub fn libinput_log_set_handler(libinput: *mut libinput, log_handler: libinput_log_handler);
pub fn libinput_log_set_priority(libinput: *mut libinput, priority: libinput_log_priority);
pub fn libinput_path_create_context(
Expand Down
8 changes: 4 additions & 4 deletions src/pango.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ struct cairo_surface_t(u8);
struct cairo_t(u8);

#[link(name = "cairo")]
extern "C" {
unsafe extern "C" {
fn cairo_image_surface_create(
format: cairo_format_t,
width: c::c_int,
Expand All @@ -47,7 +47,7 @@ extern "C" {
struct PangoContext_(u8);

#[link(name = "pangocairo-1.0")]
extern "C" {
unsafe extern "C" {
fn pango_cairo_create_context(cr: *mut cairo_t) -> *mut PangoContext_;
fn pango_cairo_show_layout(cr: *mut cairo_t, layout: *mut PangoLayout_);
}
Expand All @@ -56,7 +56,7 @@ extern "C" {
struct GObject(u8);

#[link(name = "gobject-2.0")]
extern "C" {
unsafe extern "C" {
fn g_object_unref(object: *mut GObject);
}

Expand All @@ -66,7 +66,7 @@ struct PangoFontDescription_(u8);
struct PangoLayout_(u8);

#[link(name = "pango-1.0")]
extern "C" {
unsafe extern "C" {
fn pango_font_description_from_string(str: *const c::c_char) -> *mut PangoFontDescription_;
fn pango_font_description_free(desc: *mut PangoFontDescription_);
fn pango_font_description_get_size(desc: *mut PangoFontDescription_) -> c::c_int;
Expand Down
2 changes: 1 addition & 1 deletion src/udev.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ struct udev_list_entry(u8);
struct udev_device(u8);

#[link(name = "udev")]
extern "C" {
unsafe extern "C" {
fn udev_new() -> *mut udev;
fn udev_unref(udev: *mut udev) -> *mut udev;

Expand Down
2 changes: 1 addition & 1 deletion src/video/gbm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ struct gbm_import_fd_modifier_data {
}

#[link(name = "gbm")]
extern "C" {
unsafe extern "C" {
fn gbm_create_device(fd: c::c_int) -> *mut Device;
fn gbm_device_destroy(dev: *mut Device);

Expand Down
4 changes: 2 additions & 2 deletions src/xkbcommon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ impl Default for xkb_rule_names {
}

#[link(name = "xkbcommon")]
extern "C" {
unsafe extern "C" {
fn xkb_context_new(flags: xkb_context_flags) -> *mut xkb_context;
fn xkb_context_unref(context: *mut xkb_context);
fn xkb_context_set_log_verbosity(context: *mut xkb_context, verbosity: c::c_int);
Expand Down Expand Up @@ -121,7 +121,7 @@ pub struct XkbContext {
ids: KeymapIds,
}

extern "C" {
unsafe extern "C" {
fn jay_xkbcommon_log_handler_bridge();
}

Expand Down

0 comments on commit 448b9e3

Please sign in to comment.