Change some const raw pointers to mutable

We cast them to a mutable pointer of another type right afterwards
anyway.
This commit is contained in:
Sebastian Dröge 2019-01-16 13:35:40 +02:00
parent 931c485150
commit 58ccf666a6
10 changed files with 13 additions and 13 deletions

View file

@ -384,7 +384,7 @@ where
fn override_vfuncs(&mut self) { fn override_vfuncs(&mut self) {
<gst::ElementClass as IsSubclassable<T>>::override_vfuncs(self); <gst::ElementClass as IsSubclassable<T>>::override_vfuncs(self);
unsafe { unsafe {
let klass = &mut *(self as *const Self as *mut ffi::GstAggregatorClass); let klass = &mut *(self as *mut Self as *mut ffi::GstAggregatorClass);
klass.flush = Some(aggregator_flush::<T>); klass.flush = Some(aggregator_flush::<T>);
klass.clip = Some(aggregator_clip::<T>); klass.clip = Some(aggregator_clip::<T>);
klass.finish_buffer = Some(aggregator_finish_buffer::<T>); klass.finish_buffer = Some(aggregator_finish_buffer::<T>);

View file

@ -87,7 +87,7 @@ unsafe impl<T: ObjectSubclass + AggregatorPadImpl> IsSubclassable<T> for Aggrega
fn override_vfuncs(&mut self) { fn override_vfuncs(&mut self) {
<gst::PadClass as IsSubclassable<T>>::override_vfuncs(self); <gst::PadClass as IsSubclassable<T>>::override_vfuncs(self);
unsafe { unsafe {
let klass = &mut *(self as *const Self as *mut ffi::GstAggregatorPadClass); let klass = &mut *(self as *mut Self as *mut ffi::GstAggregatorPadClass);
klass.flush = Some(aggregator_pad_flush::<T>); klass.flush = Some(aggregator_pad_flush::<T>);
klass.skip_buffer = Some(aggregator_pad_skip_buffer::<T>); klass.skip_buffer = Some(aggregator_pad_skip_buffer::<T>);
} }

View file

@ -169,7 +169,7 @@ where
fn override_vfuncs(&mut self) { fn override_vfuncs(&mut self) {
<gst::ElementClass as IsSubclassable<T>>::override_vfuncs(self); <gst::ElementClass as IsSubclassable<T>>::override_vfuncs(self);
unsafe { unsafe {
let klass = &mut *(self as *const Self as *mut ffi::GstBaseSinkClass); let klass = &mut *(self as *mut Self as *mut ffi::GstBaseSinkClass);
klass.start = Some(base_sink_start::<T>); klass.start = Some(base_sink_start::<T>);
klass.stop = Some(base_sink_stop::<T>); klass.stop = Some(base_sink_stop::<T>);
klass.render = Some(base_sink_render::<T>); klass.render = Some(base_sink_render::<T>);

View file

@ -215,7 +215,7 @@ where
fn override_vfuncs(&mut self) { fn override_vfuncs(&mut self) {
<gst::ElementClass as IsSubclassable<T>>::override_vfuncs(self); <gst::ElementClass as IsSubclassable<T>>::override_vfuncs(self);
unsafe { unsafe {
let klass = &mut *(self as *const Self as *mut ffi::GstBaseSrcClass); let klass = &mut *(self as *mut Self as *mut ffi::GstBaseSrcClass);
klass.start = Some(base_src_start::<T>); klass.start = Some(base_src_start::<T>);
klass.stop = Some(base_src_stop::<T>); klass.stop = Some(base_src_stop::<T>);
klass.is_seekable = Some(base_src_is_seekable::<T>); klass.is_seekable = Some(base_src_is_seekable::<T>);

View file

@ -282,7 +282,7 @@ where
fn override_vfuncs(&mut self) { fn override_vfuncs(&mut self) {
<gst::ElementClass as IsSubclassable<T>>::override_vfuncs(self); <gst::ElementClass as IsSubclassable<T>>::override_vfuncs(self);
unsafe { unsafe {
let klass = &mut *(self as *const Self as *mut ffi::GstBaseTransformClass); let klass = &mut *(self as *mut Self as *mut ffi::GstBaseTransformClass);
klass.start = Some(base_transform_start::<T>); klass.start = Some(base_transform_start::<T>);
klass.stop = Some(base_transform_stop::<T>); klass.stop = Some(base_transform_stop::<T>);
klass.transform_caps = Some(base_transform_transform_caps::<T>); klass.transform_caps = Some(base_transform_transform_caps::<T>);
@ -309,7 +309,7 @@ pub unsafe trait BaseTransformClassSubclassExt: Sized + 'static {
<T as ObjectSubclass>::Instance: PanicPoison, <T as ObjectSubclass>::Instance: PanicPoison,
{ {
unsafe { unsafe {
let klass = &mut *(self as *const Self as *mut ffi::GstBaseTransformClass); let klass = &mut *(self as *mut Self as *mut ffi::GstBaseTransformClass);
klass.passthrough_on_same_caps = passthrough_on_same_caps.to_glib(); klass.passthrough_on_same_caps = passthrough_on_same_caps.to_glib();
klass.transform_ip_on_passthrough = transform_ip_on_passthrough.to_glib(); klass.transform_ip_on_passthrough = transform_ip_on_passthrough.to_glib();

View file

@ -72,7 +72,7 @@ where
fn override_vfuncs(&mut self) { fn override_vfuncs(&mut self) {
<::ElementClass as IsSubclassable<T>>::override_vfuncs(self); <::ElementClass as IsSubclassable<T>>::override_vfuncs(self);
unsafe { unsafe {
let klass = &mut *(self as *const Self as *mut ffi::GstBinClass); let klass = &mut *(self as *mut Self as *mut ffi::GstBinClass);
klass.add_element = Some(bin_add_element::<T>); klass.add_element = Some(bin_add_element::<T>);
klass.remove_element = Some(bin_remove_element::<T>); klass.remove_element = Some(bin_remove_element::<T>);
klass.handle_message = Some(bin_handle_message::<T>); klass.handle_message = Some(bin_handle_message::<T>);

View file

@ -185,7 +185,7 @@ pub unsafe trait ElementClassSubclassExt: Sized + 'static {
fn add_pad_template(&mut self, pad_template: PadTemplate) { fn add_pad_template(&mut self, pad_template: PadTemplate) {
unsafe { unsafe {
ffi::gst_element_class_add_pad_template( ffi::gst_element_class_add_pad_template(
self as *const Self as *mut ffi::GstElementClass, self as *mut Self as *mut ffi::GstElementClass,
pad_template.to_glib_none().0, pad_template.to_glib_none().0,
); );
} }
@ -200,7 +200,7 @@ pub unsafe trait ElementClassSubclassExt: Sized + 'static {
) { ) {
unsafe { unsafe {
ffi::gst_element_class_set_metadata( ffi::gst_element_class_set_metadata(
self as *const Self as *mut ffi::GstElementClass, self as *mut Self as *mut ffi::GstElementClass,
long_name.to_glib_none().0, long_name.to_glib_none().0,
classification.to_glib_none().0, classification.to_glib_none().0,
description.to_glib_none().0, description.to_glib_none().0,
@ -220,7 +220,7 @@ where
<glib::ObjectClass as IsSubclassable<T>>::override_vfuncs(self); <glib::ObjectClass as IsSubclassable<T>>::override_vfuncs(self);
unsafe { unsafe {
let klass = &mut *(self as *const Self as *mut ffi::GstElementClass); let klass = &mut *(self as *mut Self as *mut ffi::GstElementClass);
klass.change_state = Some(element_change_state::<T>); klass.change_state = Some(element_change_state::<T>);
klass.request_new_pad = Some(element_request_new_pad::<T>); klass.request_new_pad = Some(element_request_new_pad::<T>);
klass.release_pad = Some(element_release_pad::<T>); klass.release_pad = Some(element_release_pad::<T>);

View file

@ -19,7 +19,7 @@ unsafe impl<T: ObjectSubclass + GhostPadImpl> IsSubclassable<T> for GhostPadClas
fn override_vfuncs(&mut self) { fn override_vfuncs(&mut self) {
<::PadClass as IsSubclassable<T>>::override_vfuncs(self); <::PadClass as IsSubclassable<T>>::override_vfuncs(self);
unsafe { unsafe {
let _klass = &mut *(self as *const Self as *mut ffi::GstGhostPadClass); let _klass = &mut *(self as *mut Self as *mut ffi::GstGhostPadClass);
// Nothing to do here // Nothing to do here
} }
} }

View file

@ -55,7 +55,7 @@ unsafe impl<T: ObjectSubclass + PadImpl> IsSubclassable<T> for PadClass {
<glib::ObjectClass as IsSubclassable<T>>::override_vfuncs(self); <glib::ObjectClass as IsSubclassable<T>>::override_vfuncs(self);
unsafe { unsafe {
let klass = &mut *(self as *const Self as *mut ffi::GstPadClass); let klass = &mut *(self as *mut Self as *mut ffi::GstPadClass);
klass.linked = Some(pad_linked::<T>); klass.linked = Some(pad_linked::<T>);
klass.unlinked = Some(pad_unlinked::<T>); klass.unlinked = Some(pad_unlinked::<T>);
} }

View file

@ -22,7 +22,7 @@ where
fn override_vfuncs(&mut self) { fn override_vfuncs(&mut self) {
<::BinClass as IsSubclassable<T>>::override_vfuncs(self); <::BinClass as IsSubclassable<T>>::override_vfuncs(self);
unsafe { unsafe {
let _klass = &mut *(self as *const Self as *mut ffi::GstPipelineClass); let _klass = &mut *(self as *mut Self as *mut ffi::GstPipelineClass);
// Nothing to do here // Nothing to do here
} }
} }