Skip to content
This repository was archived by the owner on Mar 4, 2024. It is now read-only.

WIP: Don't derive Copy for FFI structs with pointers #289

Closed
wants to merge 1 commit into from
Closed
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
1 change: 0 additions & 1 deletion atk/src/auto/util.rs
Original file line number Diff line number Diff line change
@@ -2,7 +2,6 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT

use glib::translate::*;
use std::fmt;

glib::wrapper! {
2 changes: 1 addition & 1 deletion atk/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 @ 21213ed)
Generated by gir (https://github.com/gtk-rs/gir @ cbdc2e47c+)
from gir-files (https://github.com/gtk-rs/gir-files @ 21f7670)
18 changes: 9 additions & 9 deletions atk/sys/src/lib.rs
Original file line number Diff line number Diff line change
@@ -373,7 +373,7 @@ impl ::std::fmt::Debug for AtkActionIface {
}

#[repr(C)]
#[derive(Copy, Clone)]
#[derive(Clone)]
pub struct AtkAttribute {
pub name: *mut c_char,
pub value: *mut c_char,
@@ -652,7 +652,7 @@ pub struct _AtkImplementor(c_void);
pub type AtkImplementor = *mut _AtkImplementor;

#[repr(C)]
#[derive(Copy, Clone)]
#[derive(Clone)]
pub struct AtkKeyEventStruct {
pub type_: c_int,
pub state: c_uint,
@@ -844,7 +844,7 @@ impl ::std::fmt::Debug for AtkPlugClass {
}

#[repr(C)]
#[derive(Copy, Clone)]
#[derive(Clone)]
pub struct AtkPropertyValues {
pub property_name: *const c_char,
pub old_value: gobject::GValue,
@@ -1282,7 +1282,7 @@ impl ::std::fmt::Debug for AtkTextIface {
}

#[repr(C)]
#[derive(Copy, Clone)]
#[derive(Clone)]
pub struct AtkTextRange {
pub bounds: AtkTextRectangle,
pub start_offset: c_int,
@@ -1475,7 +1475,7 @@ impl ::std::fmt::Debug for AtkNoOpObjectFactory {
}

#[repr(C)]
#[derive(Copy, Clone)]
#[derive(Clone)]
pub struct AtkObject {
pub parent: gobject::GObject,
pub description: *mut c_char,
@@ -1529,7 +1529,7 @@ impl ::std::fmt::Debug for AtkPlug {
}

#[repr(C)]
#[derive(Copy, Clone)]
#[derive(Clone)]
pub struct AtkRegistry {
pub parent: gobject::GObject,
pub factory_type_registry: *mut glib::GHashTable,
@@ -1547,7 +1547,7 @@ impl ::std::fmt::Debug for AtkRegistry {
}

#[repr(C)]
#[derive(Copy, Clone)]
#[derive(Clone)]
pub struct AtkRelation {
pub parent: gobject::GObject,
pub target: *mut glib::GPtrArray,
@@ -1565,7 +1565,7 @@ impl ::std::fmt::Debug for AtkRelation {
}

#[repr(C)]
#[derive(Copy, Clone)]
#[derive(Clone)]
pub struct AtkRelationSet {
pub parent: gobject::GObject,
pub relations: *mut glib::GPtrArray,
@@ -1581,7 +1581,7 @@ impl ::std::fmt::Debug for AtkRelationSet {
}

#[repr(C)]
#[derive(Copy, Clone)]
#[derive(Clone)]
pub struct AtkSocket {
pub parent: AtkObject,
pub embedded_plug_id: *mut c_char,
4 changes: 3 additions & 1 deletion atk/sys/tests/abi.rs
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@
use atk_sys::*;
use std::env;
use std::error::Error;
use std::ffi::OsString;
use std::mem::{align_of, size_of};
use std::path::Path;
use std::process::Command;
@@ -69,7 +70,8 @@ fn pkg_config_cflags(packages: &[&str]) -> Result<Vec<String>, Box<dyn Error>> {
if packages.is_empty() {
return Ok(Vec::new());
}
let mut cmd = Command::new("pkg-config");
let pkg_config = env::var_os("PKG_CONFIG").unwrap_or_else(|| OsString::from("pkg-config"));
let mut cmd = Command::new(pkg_config);
cmd.arg("--cflags");
cmd.args(packages);
let out = cmd.output()?;
2 changes: 1 addition & 1 deletion atk/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 @ 21213ed)
Generated by gir (https://github.com/gtk-rs/gir @ cbdc2e47c+)
from gir-files (https://github.com/gtk-rs/gir-files @ 21f7670)
2 changes: 1 addition & 1 deletion gdk-pixbuf/src/auto/pixbuf_format.rs
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ glib::wrapper! {
pub struct PixbufFormat(Boxed<ffi::GdkPixbufFormat>);

match fn {
copy => |ptr| ffi::gdk_pixbuf_format_copy(mut_override(ptr)),
copy => |ptr| ffi::gdk_pixbuf_format_copy(ptr),
free => |ptr| ffi::gdk_pixbuf_format_free(ptr),
get_type => || ffi::gdk_pixbuf_format_get_type(),
}
2 changes: 1 addition & 1 deletion gdk-pixbuf/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 @ 21213ed)
Generated by gir (https://github.com/gtk-rs/gir @ cbdc2e47c+)
from gir-files (https://github.com/gtk-rs/gir-files @ 21f7670)
6 changes: 3 additions & 3 deletions gdk-pixbuf/sys/src/lib.rs
Original file line number Diff line number Diff line change
@@ -132,7 +132,7 @@ impl ::std::fmt::Debug for GdkPixbufAnimationIterClass {
}

#[repr(C)]
#[derive(Copy, Clone)]
#[derive(Clone)]
pub struct GdkPixbufFormat {
pub name: *mut c_char,
pub signature: *mut GdkPixbufModulePattern,
@@ -185,7 +185,7 @@ impl ::std::fmt::Debug for GdkPixbufLoaderClass {
}

#[repr(C)]
#[derive(Copy, Clone)]
#[derive(Clone)]
pub struct GdkPixbufModule {
pub module_name: *mut c_char,
pub module_path: *mut c_char,
@@ -259,7 +259,7 @@ impl ::std::fmt::Debug for GdkPixbufModule {
}

#[repr(C)]
#[derive(Copy, Clone)]
#[derive(Clone)]
pub struct GdkPixbufModulePattern {
pub prefix: *mut c_char,
pub mask: *mut c_char,
4 changes: 3 additions & 1 deletion gdk-pixbuf/sys/tests/abi.rs
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@
use gdk_pixbuf_sys::*;
use std::env;
use std::error::Error;
use std::ffi::OsString;
use std::mem::{align_of, size_of};
use std::path::Path;
use std::process::Command;
@@ -69,7 +70,8 @@ fn pkg_config_cflags(packages: &[&str]) -> Result<Vec<String>, Box<dyn Error>> {
if packages.is_empty() {
return Ok(Vec::new());
}
let mut cmd = Command::new("pkg-config");
let pkg_config = env::var_os("PKG_CONFIG").unwrap_or_else(|| OsString::from("pkg-config"));
let mut cmd = Command::new(pkg_config);
cmd.arg("--cflags");
cmd.args(packages);
let out = cmd.output()?;
2 changes: 1 addition & 1 deletion gdk-pixbuf/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 @ 21213ed)
Generated by gir (https://github.com/gtk-rs/gir @ cbdc2e47c+)
from gir-files (https://github.com/gtk-rs/gir-files @ 21f7670)
2 changes: 2 additions & 0 deletions gdk/src/auto/device_pad.rs
Original file line number Diff line number Diff line change
@@ -7,6 +7,8 @@ use crate::Device;
#[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
use crate::DevicePadFeature;
use glib::object::IsA;
#[cfg(any(feature = "v3_22", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
use glib::translate::*;
use std::fmt;

2 changes: 2 additions & 0 deletions gdk/src/auto/drawing_context.rs
Original file line number Diff line number Diff line change
@@ -5,6 +5,8 @@
#[cfg(any(feature = "v3_22", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
use crate::Window;
#[cfg(any(feature = "v3_22", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
use glib::translate::*;
use std::fmt;

4 changes: 4 additions & 0 deletions gdk/src/auto/enums.rs
Original file line number Diff line number Diff line change
@@ -2,11 +2,15 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT

#[cfg(any(feature = "v3_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v3_16")))]
use glib::error::ErrorDomain;
use glib::translate::*;
use glib::value::FromValue;
use glib::value::FromValueOptional;
use glib::value::SetValue;
#[cfg(any(feature = "v3_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v3_16")))]
use glib::Quark;
use glib::StaticType;
use glib::Type;
2 changes: 2 additions & 0 deletions gdk/src/auto/gl_context.rs
Original file line number Diff line number Diff line change
@@ -8,6 +8,8 @@ use crate::Display;
#[cfg(any(feature = "v3_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v3_16")))]
use crate::Window;
#[cfg(any(feature = "v3_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v3_16")))]
use glib::translate::*;
use std::fmt;
#[cfg(any(feature = "v3_16", feature = "dox"))]
2 changes: 2 additions & 0 deletions gdk/src/auto/seat.rs
Original file line number Diff line number Diff line change
@@ -35,6 +35,8 @@ use glib::signal::connect_raw;
#[cfg(any(feature = "v3_20", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))]
use glib::signal::SignalHandlerId;
#[cfg(any(feature = "v3_20", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))]
use glib::translate::*;
#[cfg(any(feature = "v3_20", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))]
2 changes: 1 addition & 1 deletion gdk/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 @ 21213ed)
Generated by gir (https://github.com/gtk-rs/gir @ cbdc2e47c+)
from gir-files (https://github.com/gtk-rs/gir-files @ 21f7670)
Loading