[gstreamermm] Use C++ style casts instead of C casts.



commit 68cfd8087ea34b731cfdfd8b2238630fb80b18db
Author: José Alburquerque <jaalburqu svn gnome org>
Date:   Fri Oct 16 01:21:30 2009 -0400

    	Use C++ style casts instead of C casts.
    
    	* gstreamer/src/audioclock.ccg:
    	* gstreamer/src/basesink.ccg:
    	* gstreamer/src/basesrc.ccg:
    	* gstreamer/src/basetransform.ccg:
    	* gstreamer/src/bus.ccg:
    	* gstreamer/src/caps.ccg:
    	* gstreamer/src/caps.hg:
    	* gstreamer/src/clock.ccg:
    	* gstreamer/src/element.ccg:
    	* gstreamer/src/event.ccg:
    	* gstreamer/src/format.ccg:
    	* gstreamer/src/index.ccg:
    	* gstreamer/src/message.ccg:
    	* gstreamer/src/object.ccg:
    	* gstreamer/src/query.ccg:
    	* gstreamer/src/segment.ccg:
    	* gstreamer/src/task.ccg:
    	* gstreamer/src/xml.ccg: Correct casts to be C++ casts instead of C
    	casts.

 ChangeLog                       |   24 ++++++++++++
 gstreamer/src/audioclock.ccg    |    2 +-
 gstreamer/src/audiofilter.ccg   |    2 +-
 gstreamer/src/audiosink.ccg     |    4 +-
 gstreamer/src/audiosrc.ccg      |    4 +-
 gstreamer/src/basesink.ccg      |   18 ++++----
 gstreamer/src/basesrc.ccg       |   17 ++++----
 gstreamer/src/basetransform.ccg |    9 ++--
 gstreamer/src/bus.ccg           |    2 +-
 gstreamer/src/caps.ccg          |    2 +-
 gstreamer/src/caps.hg           |    2 +-
 gstreamer/src/clock.ccg         |   28 +++++--------
 gstreamer/src/element.ccg       |   10 ++--
 gstreamer/src/event.ccg         |   27 +++++++------
 gstreamer/src/format.ccg        |   18 ++++----
 gstreamer/src/index.ccg         |    3 +-
 gstreamer/src/message.ccg       |   78 ++++++++++++++++++++++-----------------
 gstreamer/src/object.ccg        |    4 +-
 gstreamer/src/query.ccg         |   72 +++++++++++++++++++----------------
 gstreamer/src/segment.ccg       |    6 +-
 gstreamer/src/task.ccg          |    2 +-
 gstreamer/src/xml.ccg           |    4 +-
 22 files changed, 186 insertions(+), 152 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index e2a7d2c..ce9b53f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,27 @@
+2009-10-16  José Alburquerque  <jaalburqu svn gnome org>
+
+	Use C++ style casts instead of C casts.
+
+	* gstreamer/src/audioclock.ccg:
+	* gstreamer/src/basesink.ccg:
+	* gstreamer/src/basesrc.ccg:
+	* gstreamer/src/basetransform.ccg:
+	* gstreamer/src/bus.ccg:
+	* gstreamer/src/caps.ccg:
+	* gstreamer/src/caps.hg:
+	* gstreamer/src/clock.ccg:
+	* gstreamer/src/element.ccg:
+	* gstreamer/src/event.ccg:
+	* gstreamer/src/format.ccg:
+	* gstreamer/src/index.ccg:
+	* gstreamer/src/message.ccg:
+	* gstreamer/src/object.ccg:
+	* gstreamer/src/query.ccg:
+	* gstreamer/src/segment.ccg:
+	* gstreamer/src/task.ccg:
+	* gstreamer/src/xml.ccg: Correct casts to be C++ casts instead of C
+	casts.
+
 2009-10-14  José Alburquerque  <jaalburqu svn gnome org>
 
 	Use anonymous namespaces and extern "C" where appropriate.
diff --git a/gstreamer/src/audioclock.ccg b/gstreamer/src/audioclock.ccg
index e254757..5f9a3a9 100644
--- a/gstreamer/src/audioclock.ccg
+++ b/gstreamer/src/audioclock.ccg
@@ -62,7 +62,7 @@ AudioClock::AudioClock(const Glib::ConstructParams& construct_params)
 
 AudioClock::AudioClock(GstAudioClock* castitem)
 :
-  Gst::SystemClock((GstSystemClock*)(castitem)),
+  Gst::SystemClock(reinterpret_cast<GstSystemClock*>(castitem)),
   _slot_set(false)
 {}
 
diff --git a/gstreamer/src/audiofilter.ccg b/gstreamer/src/audiofilter.ccg
index ca3ca2e..2f7c8f5 100644
--- a/gstreamer/src/audiofilter.ccg
+++ b/gstreamer/src/audiofilter.ccg
@@ -69,7 +69,7 @@ gboolean AudioFilter_Class::setup_vfunc_callback(GstAudioFilter* self, GstRingBu
   typedef gboolean RType;
   return RType();
 }
-bool Gst::AudioFilter::setup_vfunc(const Gst::RingBufferSpec& format) 
+bool Gst::AudioFilter::setup_vfunc(const Gst::RingBufferSpec& format)
 {
   BaseClassType *const base = static_cast<BaseClassType*>(
       g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
diff --git a/gstreamer/src/audiosink.ccg b/gstreamer/src/audiosink.ccg
index 726d03f..c97aab7 100644
--- a/gstreamer/src/audiosink.ccg
+++ b/gstreamer/src/audiosink.ccg
@@ -68,7 +68,7 @@ gboolean AudioSink_Class::prepare_vfunc_callback(GstAudioSink* self, GstRingBuff
   typedef gboolean RType;
   return RType();
 }
-bool Gst::AudioSink::prepare_vfunc(const Gst::RingBufferSpec& spec) 
+bool Gst::AudioSink::prepare_vfunc(const Gst::RingBufferSpec& spec)
 {
   BaseClassType *const base = static_cast<BaseClassType*>(
       g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
@@ -127,7 +127,7 @@ guint AudioSink_Class::write_vfunc_callback(GstAudioSink* self, gpointer data, g
   typedef guint RType;
   return RType();
 }
-guint Gst::AudioSink::write_vfunc(const void* data, guint length) 
+guint Gst::AudioSink::write_vfunc(const void* data, guint length)
 {
   BaseClassType *const base = static_cast<BaseClassType*>(
       g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
diff --git a/gstreamer/src/audiosrc.ccg b/gstreamer/src/audiosrc.ccg
index 061a979..d9d458f 100644
--- a/gstreamer/src/audiosrc.ccg
+++ b/gstreamer/src/audiosrc.ccg
@@ -68,7 +68,7 @@ gboolean AudioSrc_Class::prepare_vfunc_callback(GstAudioSrc* self, GstRingBuffer
   typedef gboolean RType;
   return RType();
 }
-bool Gst::AudioSrc::prepare_vfunc(const Gst::RingBufferSpec& spec) 
+bool Gst::AudioSrc::prepare_vfunc(const Gst::RingBufferSpec& spec)
 {
   BaseClassType *const base = static_cast<BaseClassType*>(
       g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
@@ -127,7 +127,7 @@ guint AudioSrc_Class::read_vfunc_callback(GstAudioSrc* self, gpointer data, guin
   typedef guint RType;
   return RType();
 }
-guint Gst::AudioSrc::read_vfunc(const void* data, guint length) 
+guint Gst::AudioSrc::read_vfunc(const void* data, guint length)
 {
   BaseClassType *const base = static_cast<BaseClassType*>(
       g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
diff --git a/gstreamer/src/basesink.ccg b/gstreamer/src/basesink.ccg
index 1cae324..ce6abea 100644
--- a/gstreamer/src/basesink.ccg
+++ b/gstreamer/src/basesink.ccg
@@ -31,8 +31,8 @@ bool BaseSink::query_latency(bool& live, bool& upstream_live, ClockTime& min_lat
 
   const bool result =
     gst_base_sink_query_latency(const_cast<GstBaseSink*>(gobj()),
-    &gst_live, &gst_upstream_live, (GstClockTime*)(&(min_latency)),
-    (GstClockTime*)(&(max_latency)));
+    &gst_live, &gst_upstream_live, static_cast<GstClockTime*>(&(min_latency)),
+    static_cast<GstClockTime*>(&(max_latency)));
 
   live = gst_live;
   upstream_live = gst_upstream_live;
@@ -42,12 +42,12 @@ bool BaseSink::query_latency(bool& live, bool& upstream_live, ClockTime& min_lat
 
 ClockReturn BaseSink::wait_clock(ClockTime time)
 {
-  return (ClockReturn)(gst_base_sink_wait_clock(const_cast<GstBaseSink*>(gobj()), (GstClockTime)(time), 0));
+  return static_cast<ClockReturn>(gst_base_sink_wait_clock(const_cast<GstBaseSink*>(gobj()), static_cast<GstClockTime>(time), 0));
 }
 
 FlowReturn BaseSink::wait_eos(ClockTime time)
 {
-  return (FlowReturn)(gst_base_sink_wait_eos(const_cast<GstBaseSink*>(gobj()), (GstClockTime)(time), 0));
+  return static_cast<FlowReturn>(gst_base_sink_wait_eos(const_cast<GstBaseSink*>(gobj()), static_cast<GstClockTime>(time), 0));
 }
 
 #ifdef GLIBMM_VFUNCS_ENABLED
@@ -73,8 +73,8 @@ GstFlowReturn BaseSink_Class::buffer_alloc_vfunc_callback(GstBaseSink* self, gui
         Glib::RefPtr<Gst::Buffer> cpp_buffer;
         // Call the virtual member method, which derived classes might override.
         const GstFlowReturn result =
-          ((GstFlowReturn)(obj->buffer_alloc_vfunc(offset, size,
-          Glib::wrap(caps, true) , cpp_buffer)));
+          static_cast<GstFlowReturn>(obj->buffer_alloc_vfunc(offset, size,
+          Glib::wrap(caps, true), cpp_buffer));
         *buf = cpp_buffer->gobj_copy();
         return result;
       #ifdef GLIBMM_EXCEPTIONS_ENABLED
@@ -99,7 +99,7 @@ GstFlowReturn BaseSink_Class::buffer_alloc_vfunc_callback(GstBaseSink* self, gui
   typedef GstFlowReturn RType;
   return RType();
 }
-FlowReturn Gst::BaseSink::buffer_alloc_vfunc(guint64 offset, guint size, const Glib::RefPtr<Gst::Caps>& caps, Glib::RefPtr<Gst::Buffer>& buffer) 
+FlowReturn Gst::BaseSink::buffer_alloc_vfunc(guint64 offset, guint size, const Glib::RefPtr<Gst::Caps>& caps, Glib::RefPtr<Gst::Buffer>& buffer)
 {
   BaseClassType *const base = static_cast<BaseClassType*>(
       g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
@@ -108,8 +108,8 @@ FlowReturn Gst::BaseSink::buffer_alloc_vfunc(guint64 offset, guint size, const G
   if(base && base->buffer_alloc)
   {
     GstBuffer* gst_buffer;
-    const Gst::FlowReturn result = ((FlowReturn)((*base->buffer_alloc)(gobj(),
-      offset,size,(caps)->gobj(),&gst_buffer)));
+    const Gst::FlowReturn result =
+      static_cast<Gst::FlowReturn>((*base->buffer_alloc)(gobj(), offset,size,(caps)->gobj(),&gst_buffer));
     buffer = Gst::wrap(gst_buffer, false); // Don't take copy because callback returns a newly created copy.
     return result;
   }
diff --git a/gstreamer/src/basesrc.ccg b/gstreamer/src/basesrc.ccg
index 2a54636..95d3409 100644
--- a/gstreamer/src/basesrc.ccg
+++ b/gstreamer/src/basesrc.ccg
@@ -32,8 +32,8 @@ bool BaseSrc::query_latency(bool& live, ClockTime& min_latency,
 
   const bool result =
     gst_base_src_query_latency(const_cast<GstBaseSrc*>(gobj()),
-    &gst_live, (GstClockTime*)(&(min_latency)),
-    (GstClockTime*)(&(max_latency)));
+    &gst_live, static_cast<GstClockTime*>(&min_latency),
+    static_cast<GstClockTime*>(&max_latency));
   live = gst_live;
   return result;
 }
@@ -83,7 +83,7 @@ gboolean BaseSrc_Class::do_seek_vfunc_callback(GstBaseSrc* self, GstSegment* seg
   typedef gboolean RType;
   return RType();
 }
-bool Gst::BaseSrc::do_seek_vfunc(Gst::Segment& segment) 
+bool Gst::BaseSrc::do_seek_vfunc(Gst::Segment& segment)
 {
   BaseClassType *const base = static_cast<BaseClassType*>(
       g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
@@ -139,7 +139,7 @@ gboolean BaseSrc_Class::prepare_seek_segment_vfunc_callback(GstBaseSrc* self, Gs
   typedef gboolean RType;
   return RType();
 }
-bool Gst::BaseSrc::prepare_seek_segment_vfunc(const Glib::RefPtr<Gst::Event>& seek, Gst::Segment& segment) 
+bool Gst::BaseSrc::prepare_seek_segment_vfunc(const Glib::RefPtr<Gst::Event>& seek, Gst::Segment& segment)
 {
   BaseClassType *const base = static_cast<BaseClassType*>(
       g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
@@ -172,8 +172,7 @@ GstFlowReturn BaseSrc_Class::create_vfunc_callback(GstBaseSrc* self, guint64 off
       #endif //GLIBMM_EXCEPTIONS_ENABLED
         Glib::RefPtr<Gst::Buffer> cpp_buffer;
         // Call the virtual member method, which derived classes might override.
-        GstFlowReturn const result = (GstFlowReturn)(obj->create_vfunc(offset,
-          size, cpp_buffer));
+        GstFlowReturn const result = static_cast<GstFlowReturn>(obj->create_vfunc(offset, size, cpp_buffer));
         *buf = cpp_buffer->gobj_copy();
         return result;
       #ifdef GLIBMM_EXCEPTIONS_ENABLED
@@ -198,7 +197,7 @@ GstFlowReturn BaseSrc_Class::create_vfunc_callback(GstBaseSrc* self, guint64 off
   typedef GstFlowReturn RType;
   return RType();
 }
-FlowReturn Gst::BaseSrc::create_vfunc(guint64 offset, guint size, Glib::RefPtr<Gst::Buffer>& buffer) 
+FlowReturn Gst::BaseSrc::create_vfunc(guint64 offset, guint size, Glib::RefPtr<Gst::Buffer>& buffer)
 {
   BaseClassType *const base = static_cast<BaseClassType*>(
       g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
@@ -207,8 +206,8 @@ FlowReturn Gst::BaseSrc::create_vfunc(guint64 offset, guint size, Glib::RefPtr<G
   if(base && base->create)
   {
     GstBuffer* gst_buffer;
-    Gst::FlowReturn const result = (FlowReturn)((*base->create)(gobj(),offset,
-      size,&gst_buffer));
+    Gst::FlowReturn const result =
+      static_cast<FlowReturn>((*base->create)(gobj(),offset, size,&gst_buffer));
     buffer = Gst::wrap(gst_buffer, false); // Don't take copy because callback returns a newly created copy.
     return result;
   }
diff --git a/gstreamer/src/basetransform.ccg b/gstreamer/src/basetransform.ccg
index 418dcbc..d60ada9 100644
--- a/gstreamer/src/basetransform.ccg
+++ b/gstreamer/src/basetransform.ccg
@@ -59,8 +59,8 @@ GstFlowReturn BaseTransform_Class::prepare_output_buffer_vfunc_callback(GstBaseT
         Glib::RefPtr<Gst::Buffer> cpp_buffer;
         // Call the virtual member method, which derived classes might override.
         const GstFlowReturn result =
-          ((GstFlowReturn)(obj->prepare_output_buffer_vfunc(
-          Gst::wrap(input, true) , size , Glib::wrap(caps, true), cpp_buffer)));
+          static_cast<GstFlowReturn>(obj->prepare_output_buffer_vfunc(
+          Gst::wrap(input, true), size , Glib::wrap(caps, true), cpp_buffer));
         *buffer = cpp_buffer->gobj_copy();
         return result;
       #ifdef GLIBMM_EXCEPTIONS_ENABLED
@@ -85,7 +85,7 @@ GstFlowReturn BaseTransform_Class::prepare_output_buffer_vfunc_callback(GstBaseT
   typedef GstFlowReturn RType;
   return RType();
 }
-FlowReturn Gst::BaseTransform::prepare_output_buffer_vfunc(const Glib::RefPtr<Gst::Buffer>& input, int size, const Glib::RefPtr<Gst::Caps>& caps, Glib::RefPtr<Gst::Buffer>& buffer) 
+FlowReturn Gst::BaseTransform::prepare_output_buffer_vfunc(const Glib::RefPtr<Gst::Buffer>& input, int size, const Glib::RefPtr<Gst::Caps>& caps, Glib::RefPtr<Gst::Buffer>& buffer)
 {
   BaseClassType *const base = static_cast<BaseClassType*>(
       g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
@@ -95,8 +95,7 @@ FlowReturn Gst::BaseTransform::prepare_output_buffer_vfunc(const Glib::RefPtr<Gs
   {
     GstBuffer* gst_buffer;
     const Gst::FlowReturn result =
-      ((FlowReturn)((*base->prepare_output_buffer)(gobj(),(input)->gobj(),
-      size,(caps)->gobj(),&gst_buffer)));
+      static_cast<Gst::FlowReturn>((*base->prepare_output_buffer)(gobj(),(input)->gobj(), size,(caps)->gobj(),&gst_buffer));
     buffer = Gst::wrap(gst_buffer, false); // Don't take copy because callback returns a newly created copy.
     return result;
   }
diff --git a/gstreamer/src/bus.ccg b/gstreamer/src/bus.ccg
index d846eb1..26a389b 100644
--- a/gstreamer/src/bus.ccg
+++ b/gstreamer/src/bus.ccg
@@ -60,7 +60,7 @@ static GstBusSyncReply Bus_Message_Sync_gstreamermm_callback(GstBus* bus, GstMes
   try
   {
   #endif //GLIBMM_EXCEPTIONS_ENABLED
-    return (GstBusSyncReply)((*the_slot)(Glib::wrap(bus, true), Gst::Message::wrap(message, true)));
+    return static_cast<GstBusSyncReply>((*the_slot)(Glib::wrap(bus, true), Gst::Message::wrap(message, true)));
   #ifdef GLIBMM_EXCEPTIONS_ENABLED
   }
   catch(...)
diff --git a/gstreamer/src/caps.ccg b/gstreamer/src/caps.ccg
index e20acb2..afde34a 100644
--- a/gstreamer/src/caps.ccg
+++ b/gstreamer/src/caps.ccg
@@ -110,7 +110,7 @@ Caps::set_simple(const Glib::ustring& name, const Glib::ValueBase& value)
 void
 Caps::set_simple(const Glib::ustring& name, const char* data)
 {
-  set_simple(name, (std::string)(data));
+  set_simple(name, std::string(data));
 }
 
 xmlpp::Node* Caps::save(xmlpp::Node* parent) const
diff --git a/gstreamer/src/caps.hg b/gstreamer/src/caps.hg
index d7c8ffc..56197ec 100644
--- a/gstreamer/src/caps.hg
+++ b/gstreamer/src/caps.hg
@@ -199,7 +199,7 @@ void Caps::set_simple(const Glib::ustring& name, const DataType& data)
   ValueType value;
   value.init(ValueType::value_type());
   value.set(data);
-  this->set_simple(name, (Glib::ValueBase)(value));
+  this->set_simple(name, reinterpret_cast<Glib::ValueBase&>(value));
 }
 
 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
diff --git a/gstreamer/src/clock.ccg b/gstreamer/src/clock.ccg
index 4a333b8..45cb8ac 100644
--- a/gstreamer/src/clock.ccg
+++ b/gstreamer/src/clock.ccg
@@ -35,7 +35,8 @@ static gboolean ClockID_Clock_gstreamermm_callback(GstClock* clock, GstClockTime
   try
   {
   #endif //GLIBMM_EXCEPTIONS_ENABLED
-    bool result = (*the_slot)(Glib::wrap(clock, true), time, Glib::wrap((GstClockEntry*)(id), true));
+    bool result = (*the_slot)(Glib::wrap(clock, true), time,
+      Glib::wrap(reinterpret_cast<GstClockEntry*>(id), true));
 
     //Delete the once executing slot before returning result
     delete the_slot;
@@ -61,55 +62,48 @@ namespace Gst
 
 guint get_hours(ClockTime time)
 {
-  return GST_CLOCK_TIME_IS_VALID (time) ? \
-        (guint) (((GstClockTime)(time)) / (GST_SECOND * 60 * 60)) : 99;
+  return GST_CLOCK_TIME_IS_VALID (time) ? time / (GST_SECOND * 60 * 60) : 99;
 }
 
 guint get_minutes(ClockTime time)
 {
-  return GST_CLOCK_TIME_IS_VALID (time) ? \
-        (guint) ((((GstClockTime)(time)) / (GST_SECOND * 60)) % 60) : 99;
+  return GST_CLOCK_TIME_IS_VALID (time) ? (time / (GST_SECOND * 60)) % 60 : 99;
 }
 
 guint get_seconds(ClockTime time)
 {
-  return GST_CLOCK_TIME_IS_VALID (time) ? \
-        (guint) ((((GstClockTime)(time)) / GST_SECOND) % 60) : 99;
+  return GST_CLOCK_TIME_IS_VALID (time) ? (time / GST_SECOND) % 60 : 99;
 }
 
 guint get_milliseconds(ClockTime time)
 {
-  return GST_CLOCK_TIME_IS_VALID (time) ? \
-        (guint) ((((GstClockTime)(time)) / GST_MSECOND) % 1000) : 999;
+  return GST_CLOCK_TIME_IS_VALID (time) ? (time / GST_MSECOND) % 1000 : 999;
 }
 
 guint get_microseconds(ClockTime time)
 {
-  return GST_CLOCK_TIME_IS_VALID (time) ? \
-        (guint) ((((GstClockTime)(time)) / GST_USECOND) % 1000) : 999;
+  return GST_CLOCK_TIME_IS_VALID (time) ? (time / GST_USECOND) % 1000 : 999;
 }
 
 guint get_nanoseconds(ClockTime time)
 {
-  return GST_CLOCK_TIME_IS_VALID (time) ? \
-        (guint) ((((GstClockTime)(time)) / GST_NSECOND) % 1000) : 999;
+  return GST_CLOCK_TIME_IS_VALID (time) ?  (time / GST_NSECOND) % 1000 : 999;
 }
 
 guint get_fractional_seconds(ClockTime time)
 {
-  return GST_CLOCK_TIME_IS_VALID (time) ? \
-        (guint) (((GstClockTime)(time)) % GST_SECOND) : 999999999;
+  return GST_CLOCK_TIME_IS_VALID (time) ? time % GST_SECOND : 999999999;
 }
 
 ClockReturn ClockID::wait_async(const SlotClock& slot)
 {
   SlotClock* slot_copy = new SlotClock(slot);
-  return (ClockReturn) gst_clock_id_wait_async(gobj(), &ClockID_Clock_gstreamermm_callback, slot_copy);
+  return static_cast<ClockReturn>(gst_clock_id_wait_async(gobj(), &ClockID_Clock_gstreamermm_callback, slot_copy));
 }
 
 ClockReturn ClockID::wait()
 {
-  return (ClockReturn) gst_clock_id_wait(gobj(), 0);
+  return static_cast<ClockReturn>(gst_clock_id_wait(gobj(), 0));
 }
 
 } //namespace Gst
diff --git a/gstreamer/src/element.ccg b/gstreamer/src/element.ccg
index 5bb430a..8be0da0 100644
--- a/gstreamer/src/element.ccg
+++ b/gstreamer/src/element.ccg
@@ -106,8 +106,8 @@ void Element::post_message(int code, int line, MessageType type,
   gchar* gst_text = g_strdup(text.c_str());
   gchar* gst_debug = g_strdup(debug.c_str());
 
-  gst_element_message_full(gobj(), (GstMessageType)(type), domain, code,
-    gst_text, gst_debug, file.c_str(), function.c_str(), line);
+  gst_element_message_full(gobj(), static_cast<GstMessageType>(type),
+    domain, code, gst_text, gst_debug, file.c_str(), function.c_str(), line);
 }
 
 bool Element::query_position(Format& format) const
@@ -174,7 +174,7 @@ gboolean Element_Class::set_clock_vfunc_callback(GstElement* self, GstClock* clo
   // when base class has no set_clock() vfunc.
   return true;
 }
-bool Gst::Element::set_clock_vfunc(const Glib::RefPtr<Gst::Clock>& clock) 
+bool Gst::Element::set_clock_vfunc(const Glib::RefPtr<Gst::Clock>& clock)
 {
   BaseClassType *const base = static_cast<BaseClassType*>(
       g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
@@ -206,7 +206,7 @@ const GstQueryType* Element_Class::get_query_types_vfunc_callback(GstElement* se
       {
       #endif //GLIBMM_EXCEPTIONS_ENABLED
         // Call the virtual member method, which derived classes might override.
-        return (GstQueryType*)((obj->get_query_types_vfunc()).data());
+        return reinterpret_cast<const GstQueryType*>((obj->get_query_types_vfunc()).data());
       #ifdef GLIBMM_EXCEPTIONS_ENABLED
       }
       catch(...)
@@ -236,7 +236,7 @@ Glib::ArrayHandle<QueryType> Gst::Element::get_query_types_vfunc() const
   );
 
   if(base && base->get_query_types)
-    return Glib::ArrayHandle<QueryType>((QueryType*)((*base->get_query_types)(const_cast<GstElement*>(gobj()))), Glib::OWNERSHIP_SHALLOW);
+    return Glib::ArrayHandle<QueryType>(reinterpret_cast<const QueryType*>((*base->get_query_types)(const_cast<GstElement*>(gobj()))), Glib::OWNERSHIP_SHALLOW);
 
   typedef Glib::ArrayHandle<QueryType> RType;
   return RType(0, 0, Glib::OWNERSHIP_NONE);
diff --git a/gstreamer/src/event.ccg b/gstreamer/src/event.ccg
index 8fbfacb..578e16e 100644
--- a/gstreamer/src/event.ccg
+++ b/gstreamer/src/event.ccg
@@ -40,7 +40,7 @@ Glib::QueryQuark get_quark(EventType t)
 
 EventTypeFlags get_flags(EventType t)
 {
-  return (EventTypeFlags) gst_event_type_get_flags((GstEventType)(t));
+  return static_cast<EventTypeFlags>(gst_event_type_get_flags(static_cast<GstEventType>(t)));
 }
 
 } //namespace Enums
@@ -161,7 +161,7 @@ Gst::Format EventNewSegment::parse_format() const
   GstFormat gst_format = GST_FORMAT_UNDEFINED;
   gst_event_parse_new_segment_full(const_cast<GstEvent*>(gobj()), 0, 0, 0,
     &gst_format, 0, 0, 0);
-  return (Gst::Format)(gst_format);
+  return static_cast<Gst::Format>(gst_format);
 }
 
 double EventNewSegment::parse_applied_rate() const
@@ -224,8 +224,8 @@ Gst::Format EventBufferSize::parse_format() const
 {
   GstFormat gst_format = GST_FORMAT_UNDEFINED;
   gst_event_parse_buffer_size(const_cast<GstEvent*>(gobj()),
-    (GstFormat*)(&gst_format), 0, 0, 0);
-  return (Gst::Format)(gst_format);
+    reinterpret_cast<GstFormat*>(&gst_format), 0, 0, 0);
+  return static_cast<Gst::Format>(gst_format);
 }
 
 gint64 EventBufferSize::parse_max_size() const
@@ -327,7 +327,7 @@ Gst::Format EventSeek::parse_format() const
   GstFormat gst_format = GST_FORMAT_UNDEFINED;
   gst_event_parse_seek(const_cast<GstEvent*>(gobj()), 0, &gst_format, 0, 0, 0,
     0, 0);
-  return (Gst::Format)(gst_format);
+  return static_cast<Gst::Format>(gst_format);
 }
 
 Gst::SeekFlags EventSeek::parse_flags() const
@@ -335,7 +335,7 @@ Gst::SeekFlags EventSeek::parse_flags() const
   GstSeekFlags gst_flags = GST_SEEK_FLAG_NONE;
   gst_event_parse_seek(const_cast<GstEvent*>(gobj()), 0, 0, &gst_flags, 0, 0,
     0, 0);
-  return (Gst::SeekFlags)(gst_flags);
+  return static_cast<Gst::SeekFlags>(gst_flags);
 }
 
 Gst::SeekType EventSeek::parse_start_type() const
@@ -343,7 +343,7 @@ Gst::SeekType EventSeek::parse_start_type() const
   GstSeekType gst_type = GST_SEEK_TYPE_NONE;
   gst_event_parse_seek(const_cast<GstEvent*>(gobj()), 0, 0, 0, &gst_type, 0,
     0, 0);
-  return (Gst::SeekType)(gst_type);
+  return static_cast<Gst::SeekType>(gst_type);
 }
 
 Gst::SeekType EventSeek::parse_stop_type() const
@@ -351,7 +351,7 @@ Gst::SeekType EventSeek::parse_stop_type() const
   GstSeekType gst_type = GST_SEEK_TYPE_NONE;
   gst_event_parse_seek(const_cast<GstEvent*>(gobj()), 0, 0, 0, 0, 0, &gst_type,
     0);
-  return (Gst::SeekType)(gst_type);
+  return static_cast<Gst::SeekType>(gst_type);
 }
 
 gint64 EventSeek::parse_stop() const
@@ -398,8 +398,8 @@ Event(castitem)
 Glib::RefPtr<Gst::Event> EventStep::create(Gst::Format format, guint64 amount,
   double rate, bool flush, bool intermediate)
 {
-  GstEvent* event = gst_event_new_step((GstFormat)(format), amount, rate,
-    flush, intermediate);
+  GstEvent* event = gst_event_new_step(static_cast<GstFormat>(format),
+    amount, rate, flush, intermediate);
   return Gst::Event::wrap(event, false);
 }
 
@@ -409,8 +409,9 @@ void EventStep::parse(Gst::Format& format, guint64& amount, double& rate,
   gboolean gst_flush = FALSE;
   gboolean gst_intermediate = FALSE;
 
-  gst_event_parse_step(const_cast<GstEvent*>(gobj()), (GstFormat*)(&format),
-    &amount, &rate, &gst_flush, &gst_intermediate);
+  gst_event_parse_step(const_cast<GstEvent*>(gobj()),
+    reinterpret_cast<GstFormat*>(&format), &amount, &rate, &gst_flush,
+    &gst_intermediate);
 
   flush = gst_flush;
   intermediate = gst_intermediate;
@@ -427,7 +428,7 @@ Gst::Format EventStep::parse_format() const
 {
   GstFormat gst_format = GST_FORMAT_UNDEFINED;
   gst_event_parse_step(const_cast<GstEvent*>(gobj()), &gst_format, 0, 0, 0, 0);
-  return (Gst::Format)(gst_format);
+  return static_cast<Gst::Format>(gst_format);
 }
 
 double EventStep::parse_rate() const
diff --git a/gstreamer/src/format.ccg b/gstreamer/src/format.ccg
index d8c031e..2f028e6 100644
--- a/gstreamer/src/format.ccg
+++ b/gstreamer/src/format.ccg
@@ -25,16 +25,16 @@ namespace Gst
 
 FormatDefinition::FormatDefinition()
 : value(Gst::FORMAT_UNDEFINED),
-  quark((GQuark)(0))
+  quark(static_cast<GQuark>(0))
 {}
 
 FormatDefinition::FormatDefinition(const GstFormatDefinition* castitem)
 : value(Gst::FORMAT_UNDEFINED),
-  quark((castitem) ? castitem->quark : 0)
+  quark((castitem) ? castitem->quark : static_cast<GQuark>(0))
 {
   if(castitem)
   {
-    value = (Format)(castitem->value);
+    value = static_cast<Format>(castitem->value);
     nick = castitem->nick;
     description = castitem->description;
   }
@@ -45,35 +45,35 @@ namespace Enums
 
 Glib::ustring get_name(Format f)
 {
-  return gst_format_get_name(GstFormat(f));
+  return gst_format_get_name(static_cast<GstFormat>(f));
 }
 
 Glib::QueryQuark get_quark(Format f)
 {
-  return Glib::QueryQuark(gst_format_to_quark(GstFormat(f)));
+  return Glib::QueryQuark(gst_format_to_quark(static_cast<GstFormat>(f)));
 }
 
 } //namespace Enums
 
 Format get_format(const Glib::ustring& nick)
 {
-  return (Format)(gst_format_get_by_nick(nick.c_str()));
+  return static_cast<Format>(gst_format_get_by_nick(nick.c_str()));
 }
 
 Format register_format(const Glib::ustring& nick, const Glib::ustring&
 description)
 {
-  return (Format)(gst_format_register(nick.c_str(), description.c_str()));
+  return static_cast<Format>(gst_format_register(nick.c_str(), description.c_str()));
 }
 
 bool formats_contain(const Glib::ArrayHandle<Format>& formats, Format format)
 {
-  return gst_formats_contains((GstFormat*)((formats).data()), (GstFormat)(format));
+  return gst_formats_contains(reinterpret_cast<const GstFormat*>((formats).data()), static_cast<GstFormat>(format));
 }
 
 bool get_format_details(Format format, FormatDefinition& def)
 {
-  const GstFormatDefinition* gstdef = gst_format_get_details(GstFormat(format));
+  const GstFormatDefinition* gstdef = gst_format_get_details(static_cast<GstFormat>(format));
 
   g_return_val_if_fail(gstdef != 0, false);
 
diff --git a/gstreamer/src/index.ccg b/gstreamer/src/index.ccg
index ac4e6b4..9713c49 100644
--- a/gstreamer/src/index.ccg
+++ b/gstreamer/src/index.ccg
@@ -102,8 +102,7 @@ IndexAssociation::IndexAssociation()
 {}
 
 IndexAssociation::IndexAssociation(const GstIndexAssociation* castitem)
-: format((castitem) ? (Gst::Format)(castitem->format) : Gst::FORMAT_UNDEFINED),
-  value((castitem) ? castitem->value : 0)
+: format((castitem) ? static_cast<Gst::Format>(castitem->format) : Gst::FORMAT_UNDEFINED), value((castitem) ? castitem->value : 0)
 {}
 
 bool Index::is_readable() const
diff --git a/gstreamer/src/message.ccg b/gstreamer/src/message.ccg
index cde9dbf..0522031 100644
--- a/gstreamer/src/message.ccg
+++ b/gstreamer/src/message.ccg
@@ -34,12 +34,12 @@ namespace Enums
 
 Glib::ustring get_name(MessageType t)
 {
-  return gst_message_type_get_name(GstMessageType(t));
+  return gst_message_type_get_name(static_cast<GstMessageType>(t));
 }
 
 Glib::QueryQuark get_quark(MessageType t)
 {
-  return Glib::QueryQuark(gst_message_type_to_quark(GstMessageType(t)));
+  return Glib::QueryQuark(gst_message_type_to_quark(static_cast<GstMessageType>(t)));
 }
 
 } //namespace Enums
@@ -70,7 +70,8 @@ MessageError::MessageError(GstMessage* castitem)
 
 Glib::RefPtr<Gst::Message> MessageError::create(const Glib::RefPtr<Gst::Object>& src, Glib::Error& error, const std::string& debug)
 {
-  GstMessage* message = gst_message_new_error(src->gobj(), error.gobj(),(gchar*)(debug.c_str()));
+  GstMessage* message = gst_message_new_error(src->gobj(), error.gobj(),
+    reinterpret_cast<const gchar*>(debug.c_str()));
   return Gst::Message::wrap(message, false);
 }
 
@@ -113,7 +114,8 @@ MessageWarning::MessageWarning(GstMessage* castitem)
 
 Glib::RefPtr<Gst::Message> MessageWarning::create(const Glib::RefPtr<Gst::Object>& src, Glib::Error& error, const std::string& debug)
 {
-  GstMessage* message = gst_message_new_warning(src->gobj(), error.gobj(),(gchar*)(debug.c_str()));
+  GstMessage* message = gst_message_new_warning(src->gobj(), error.gobj(),
+    reinterpret_cast<const gchar*>(debug.c_str()));
   return Gst::Message::wrap(message, false);
 }
 
@@ -156,7 +158,8 @@ MessageInfo::MessageInfo(GstMessage* castitem)
 
 Glib::RefPtr<Gst::Message> MessageInfo::create(const Glib::RefPtr<Gst::Object>& src, Glib::Error& error, const std::string& debug)
 {
-  GstMessage* message = gst_message_new_info(src->gobj(), error.gobj(),(gchar*)(debug.c_str()));
+  GstMessage* message = gst_message_new_info(src->gobj(), error.gobj(),
+    reinterpret_cast<const gchar*>(debug.c_str()));
   return Gst::Message::wrap(message, false);
 }
 
@@ -268,15 +271,16 @@ int MessageBuffering::parse() const
 void MessageBuffering::set_stats(BufferingMode mode, int avg_in, int avg_out,
 gint64 buffering_left)
 {
-  gst_message_set_buffering_stats(gobj(), (GstBufferingMode) mode, avg_in,
-    avg_out, buffering_left);
+  gst_message_set_buffering_stats(gobj(), static_cast<GstBufferingMode>(mode),
+  avg_in, avg_out, buffering_left);
 }
 
 void MessageBuffering::parse_stats(BufferingMode& mode, int& avg_in,
 int& avg_out, gint64& buffering_left) const
 {
   gst_message_parse_buffering_stats(const_cast<GstMessage*>(gobj()),
-    (GstBufferingMode*)(&mode), &avg_in, &avg_out, &buffering_left);
+    reinterpret_cast<GstBufferingMode*>(&mode), &avg_in, &avg_out,
+    &buffering_left);
 }
 
 BufferingMode MessageBuffering::parse_stats_buffering_mode() const
@@ -285,7 +289,7 @@ BufferingMode MessageBuffering::parse_stats_buffering_mode() const
 
   gst_message_parse_buffering_stats(const_cast<GstMessage*>(gobj()), &mode,
     0, 0, 0);
-  return (BufferingMode)(mode);
+  return static_cast<BufferingMode>(mode);
 }
 
 int MessageBuffering::parse_stats_avg_in() const
@@ -321,7 +325,9 @@ MessageStateChanged::MessageStateChanged(GstMessage* castitem)
 
 Glib::RefPtr<Gst::Message> MessageStateChanged::create(const Glib::RefPtr<Gst::Object>& src, State oldstate, State newstate, State pending)
 {
-  GstMessage* message = gst_message_new_state_changed(src->gobj(), GstState(oldstate), GstState(newstate), GstState(pending));
+  GstMessage* message = gst_message_new_state_changed(src->gobj(),
+    static_cast<GstState>(oldstate), static_cast<GstState>(newstate),
+    static_cast<GstState>(pending));
   return Gst::Message::wrap(message, false);
 }
 
@@ -329,7 +335,9 @@ void MessageStateChanged::parse(State& oldstate, State& newstate,
 State& pending) const
 {
   gst_message_parse_state_changed(const_cast<GstMessage*>(gobj()),
-    (GstState*)(&oldstate), (GstState*)(&newstate), (GstState*)(&pending));
+    reinterpret_cast<GstState*>(&oldstate),
+    reinterpret_cast<GstState*>(&newstate),
+    reinterpret_cast<GstState*>(&pending));
 }
 
 State MessageStateChanged::parse() const
@@ -379,7 +387,8 @@ Glib::RefPtr<Gst::Message>
   bool intermediate, guint64 duration, bool eos)
 {
   GstMessage* message = gst_message_new_step_done(src->gobj(),
-    (GstFormat)(format), amount, rate, flush, intermediate, duration, eos);
+    static_cast<GstFormat>(format), amount, rate, flush, intermediate,
+    duration, eos);
   return Gst::Message::wrap(message, false);
 }
 
@@ -391,8 +400,8 @@ void MessageStepDone::parse(Gst::Format& format, guint64& amount, double& rate,
   gboolean gst_eos = FALSE;
 
   gst_message_parse_step_done(const_cast<GstMessage*>(gobj()),
-    (GstFormat*)(&format), &amount, &rate, &gst_flush, &gst_intermediate,
-    &duration, &gst_eos);
+    reinterpret_cast<GstFormat*>(&format), &amount, &rate, &gst_flush,
+    &gst_intermediate, &duration, &gst_eos);
 
   flush = gst_flush;
   intermediate = gst_intermediate;
@@ -411,8 +420,8 @@ Gst::Format MessageStepDone::parse_format() const
 {
   GstFormat format = GST_FORMAT_UNDEFINED;
   gst_message_parse_step_done(const_cast<GstMessage*>(gobj()),
-    (GstFormat*)(&format), 0, 0, 0, 0, 0, 0);
-  return (Gst::Format)(format);
+    reinterpret_cast<GstFormat*>(&format), 0, 0, 0, 0, 0, 0);
+  return static_cast<Gst::Format>(format);
 }
 
 guint64 MessageStepDone::parse_amount() const
@@ -606,7 +615,7 @@ Glib::RefPtr<Gst::Message> MessageSegmentStart::create(const Glib::RefPtr<Gst::O
 void MessageSegmentStart::parse(Format& format, gint64& position) const
 {
   gst_message_parse_segment_start(const_cast<GstMessage*>(gobj()),
-    (GstFormat*)(&format), &position);
+    reinterpret_cast<GstFormat*>(&format), &position);
 }
 
 gint64 MessageSegmentStart::parse() const
@@ -621,7 +630,7 @@ Format MessageSegmentStart::parse_format() const
 {
   Format format = Gst::FORMAT_DEFAULT;
   gst_message_parse_segment_start(const_cast<GstMessage*>(gobj()),
-    (GstFormat*)(&format), 0);
+    reinterpret_cast<GstFormat*>(&format), 0);
   return format;
 }
 
@@ -638,7 +647,7 @@ Glib::RefPtr<Gst::Message> MessageSegmentDone::create(const Glib::RefPtr<Gst::Ob
 void MessageSegmentDone::parse(Format& format, gint64& position) const
 {
   gst_message_parse_segment_done(const_cast<GstMessage*>(gobj()),
-    (GstFormat*)(&format), &position);
+    reinterpret_cast<GstFormat*>(&format), &position);
 }
 
 gint64 MessageSegmentDone::parse() const
@@ -653,7 +662,7 @@ Format MessageSegmentDone::parse_format() const
 {
   Format format = Gst::FORMAT_UNDEFINED;
   gst_message_parse_segment_done(const_cast<GstMessage*>(gobj()),
-    (GstFormat*)(&format), 0);
+    reinterpret_cast<GstFormat*>(&format), 0);
   return format;
 }
 
@@ -670,7 +679,7 @@ Glib::RefPtr<Gst::Message> MessageDuration::create(const Glib::RefPtr<Gst::Objec
 void MessageDuration::parse(Format& format, gint64& position) const
 {
   gst_message_parse_duration(const_cast<GstMessage*>(gobj()),
-    (GstFormat*)(&format), &position);
+    reinterpret_cast<GstFormat*>(&format), &position);
 }
 
 gint64 MessageDuration::parse() const
@@ -684,7 +693,7 @@ Format MessageDuration::parse_format() const
 {
   Format format = Gst::FORMAT_UNDEFINED;
   gst_message_parse_duration(const_cast<GstMessage*>(gobj()),
-    (GstFormat*)(&format), 0);
+    reinterpret_cast<GstFormat*>(&format), 0);
   return format;
 }
 
@@ -736,7 +745,7 @@ Glib::RefPtr<Gst::Message>
   bool intermediate)
 {
   GstMessage* message = gst_message_new_step_start(src->gobj(),
-    active, (GstFormat)(format), amount, rate, flush, intermediate);
+    active, static_cast<GstFormat>(format), amount, rate, flush, intermediate);
   return Gst::Message::wrap(message, false);
 }
 
@@ -748,7 +757,8 @@ void MessageStepStart::parse(bool& active, Gst::Format& format,
   gboolean gst_intermediate = FALSE;
 
   gst_message_parse_step_start(const_cast<GstMessage*>(gobj()), &gst_active,
-    (GstFormat*)(&format), &amount, &rate, &gst_flush, &gst_intermediate);
+    reinterpret_cast<GstFormat*>(&format), &amount, &rate, &gst_flush,
+    &gst_intermediate);
 
   active = gst_active;
   flush = gst_flush;
@@ -775,8 +785,8 @@ Gst::Format MessageStepStart::parse_format() const
 {
   GstFormat format = GST_FORMAT_UNDEFINED;
   gst_message_parse_step_start(const_cast<GstMessage*>(gobj()), 0,
-    (GstFormat*)(&format), 0, 0, 0, 0);
-  return (Gst::Format)(format);
+    reinterpret_cast<GstFormat*>(&format), 0, 0, 0, 0);
+  return static_cast<Gst::Format>(format);
 }
 
 double MessageStepStart::parse_rate() const
@@ -813,7 +823,7 @@ Glib::RefPtr<Gst::Message>
   bool busy)
 {
   GstMessage* message = gst_message_new_structure_change(src->gobj(),
-    (GstStructureChangeType)(type), owner->gobj(), busy);
+    static_cast<GstStructureChangeType>(type), owner->gobj(), busy);
   return Gst::Message::wrap(message, false);
 }
 
@@ -823,7 +833,7 @@ void MessageStructureChange::parse(Gst::StructureChangeType& type,
   GstElement* gst_element = 0;
   gboolean gst_busy = false;
   gst_message_parse_structure_change(const_cast<GstMessage*>(gobj()),
-    (GstStructureChangeType*)(&type), &gst_element, &gst_busy);
+    reinterpret_cast<GstStructureChangeType*>(&type), &gst_element, &gst_busy);
   owner = Glib::wrap(gst_element, true);
   busy = gst_busy;
 }
@@ -833,7 +843,7 @@ Gst::StructureChangeType MessageStructureChange::parse() const
   GstStructureChangeType gst_type = GST_STRUCTURE_CHANGE_TYPE_PAD_LINK;
   gst_message_parse_structure_change(const_cast<GstMessage*>(gobj()),
     &gst_type, 0, 0);
-  return (Gst::StructureChangeType)(gst_type);
+  return static_cast<Gst::StructureChangeType>(gst_type);
 }
 
 Glib::RefPtr<Gst::Element> MessageStructureChange::parse_owner() const
@@ -861,7 +871,7 @@ Glib::RefPtr<Gst::Message>
   Gst::State state)
 {
   GstMessage* message = gst_message_new_request_state(src->gobj(),
-    (GstState)(state));
+    static_cast<GstState>(state));
   return Gst::Message::wrap(message, false);
 }
 
@@ -870,7 +880,7 @@ Gst::State MessageRequestState::parse() const
   GstState gst_state = GST_STATE_VOID_PENDING;
   gst_message_parse_request_state(const_cast<GstMessage*>(gobj()),
     &gst_state);
-  return (Gst::State)(gst_state);
+  return static_cast<Gst::State>(gst_state);
 }
 
 MessageStreamStatus::MessageStreamStatus(GstMessage* castitem)
@@ -882,7 +892,7 @@ Glib::RefPtr<Gst::Message>
   Gst::StreamStatusType type, const Glib::RefPtr<Gst::Element>& owner)
 {
   GstMessage* message = gst_message_new_stream_status(src->gobj(),
-    (GstStreamStatusType)(type), owner->gobj());
+    static_cast<GstStreamStatusType>(type), owner->gobj());
   return Gst::Message::wrap(message, false);
 }
 
@@ -908,7 +918,7 @@ void MessageStreamStatus::parse(Gst::StreamStatusType& type,
 {
   GstElement* gst_element;
   gst_message_parse_stream_status(const_cast<GstMessage*>(gobj()),
-    (GstStreamStatusType*)(&type), &gst_element);
+    reinterpret_cast<GstStreamStatusType*>(&type), &gst_element);
   owner = Glib::wrap(gst_element, true);
 }
 
@@ -917,7 +927,7 @@ Gst::StreamStatusType MessageStreamStatus::parse() const
   GstStreamStatusType type;
   gst_message_parse_stream_status(const_cast<GstMessage*>(gobj()),
     &type, 0);
-  return (Gst::StreamStatusType)(type);
+  return static_cast<Gst::StreamStatusType>(type);
 }
 
 Glib::RefPtr<Gst::Element> MessageStreamStatus::parse_owner() const
diff --git a/gstreamer/src/object.ccg b/gstreamer/src/object.ccg
index 3b1da3c..f1fd105 100644
--- a/gstreamer/src/object.ccg
+++ b/gstreamer/src/object.ccg
@@ -34,7 +34,7 @@ Object::Object(const Glib::ConstructParams& construct_params)
 
 Object::Object(GstObject* castitem)
 :
-  Glib::Object((GObject*)(castitem))
+  Glib::Object(reinterpret_cast<GObject*>(castitem))
 {
   if(G_LIKELY(GST_OBJECT_IS_FLOATING(castitem)))
   {
@@ -158,7 +158,7 @@ xmlpp::Node* Gst::Object::save_vfunc(xmlpp::Node* parent)
 
   if(base && base->save_thyself)
   {
-    (void) (*base->save_thyself)(gobj(),parent->cobj());
+    (*base->save_thyself)(gobj(),parent->cobj());
     return parent;
   }
 
diff --git a/gstreamer/src/query.ccg b/gstreamer/src/query.ccg
index f33ec13..a6b89eb 100644
--- a/gstreamer/src/query.ccg
+++ b/gstreamer/src/query.ccg
@@ -27,7 +27,7 @@ namespace Gst
 
 QueryTypeDefinition::QueryTypeDefinition()
 : value(Gst::QUERY_NONE),
-  quark((GQuark)(0))
+  quark(static_cast<GQuark>(0))
 {}
 
 QueryTypeDefinition::QueryTypeDefinition(const GstQueryTypeDefinition* castitem)
@@ -36,7 +36,7 @@ QueryTypeDefinition::QueryTypeDefinition(const GstQueryTypeDefinition* castitem)
 {
   if(castitem)
   {
-    value = (QueryType)(castitem->value);
+    value = static_cast<QueryType>(castitem->value);
     nick = castitem->nick;
     description = castitem->description;
   }
@@ -47,12 +47,12 @@ namespace Enums
 
 Glib::ustring get_name(QueryType t)
 {
-  return gst_query_type_get_name(GstQueryType(t));
+  return gst_query_type_get_name(static_cast<GstQueryType>(t));
 }
 
 Glib::QueryQuark get_quark(QueryType t)
 {
-  return Glib::QueryQuark(gst_query_type_to_quark(GstQueryType(t)));
+  return Glib::QueryQuark(gst_query_type_to_quark(static_cast<GstQueryType>(t)));
 }
 
 } //namespace Enums
@@ -73,7 +73,7 @@ bool get_details(QueryType type, QueryTypeDefinition &def)
 
   g_return_val_if_fail(gstdef != 0, false);
 
-  def.value = QueryType(gstdef->value);
+  def.value = static_cast<QueryType>(gstdef->value);
   def.nick = gstdef->nick;
   def.description = gstdef->description;
   def.quark = gstdef->quark;
@@ -113,21 +113,21 @@ void QueryConvert::set(Format src_format, gint64 src_value, Format dest_format,
 void QueryConvert::parse(Format& src_format, gint64& src_value, Format& dest_format, gint64& dest_value) const
 {
   gst_query_parse_convert(const_cast<GstQuery*>(gobj()),
-    (GstFormat*)(&src_format), &src_value, (GstFormat*)(&dest_format),
-    &dest_value);
+    reinterpret_cast<GstFormat*>(&src_format), &src_value,
+    reinterpret_cast<GstFormat*>(&dest_format), &dest_value);
 }
 
 void QueryConvert::parse(Format& dest_format, gint64& dest_value) const
 {
   gst_query_parse_convert(const_cast<GstQuery*>(gobj()), 0, 0,
-    (GstFormat*)(&dest_format), &dest_value);
+    reinterpret_cast<GstFormat*>(&dest_format), &dest_value);
 }
 
 Format QueryConvert::parse_src_format() const
 {
   Format src_format = Gst::FORMAT_UNDEFINED;
   gst_query_parse_convert(const_cast<GstQuery*>(gobj()),
-    (GstFormat*)(&src_format), 0, 0, 0);
+    reinterpret_cast<GstFormat*>(&src_format), 0, 0, 0);
   return src_format;
 }
 
@@ -143,7 +143,7 @@ Format QueryConvert::parse_dest_format() const
 {
   Format dest_format = Gst::FORMAT_UNDEFINED;
   gst_query_parse_convert(const_cast<GstQuery*>(gobj()), 0, 0,
-    (GstFormat*)(&dest_format), 0);
+    reinterpret_cast<GstFormat*>(&dest_format), 0);
   return dest_format;
 }
 
@@ -173,7 +173,7 @@ void QueryPosition::set(Format format, gint64 position)
 void QueryPosition::parse(Format& format, gint64& position) const
 {
   gst_query_parse_position(const_cast<GstQuery*>(gobj()),
-    (GstFormat*)(&format), &position);
+    reinterpret_cast<GstFormat*>(&format), &position);
 }
 
 gint64 QueryPosition::parse() const
@@ -187,7 +187,7 @@ Format QueryPosition::parse_format() const
 {
   Format format = Gst::FORMAT_UNDEFINED;
   gst_query_parse_position(const_cast<GstQuery*>(gobj()),
-    (GstFormat*)(&format), 0);
+    reinterpret_cast<GstFormat*>(&format), 0);
   return format;
 }
 
@@ -209,7 +209,7 @@ void QueryDuration::set(Format format, gint64 duration)
 void QueryDuration::parse(Format& format, gint64& duration) const
 {
   gst_query_parse_duration(const_cast<GstQuery*>(gobj()),
-    (GstFormat*)(&format), &duration);
+    reinterpret_cast<GstFormat*>(&format), &duration);
 }
 
 gint64 QueryDuration::parse() const
@@ -223,7 +223,7 @@ Format QueryDuration::parse_format() const
 {
   Format format = Gst::FORMAT_UNDEFINED;
   gst_query_parse_duration(const_cast<GstQuery*>(gobj()),
-    (GstFormat*)(&format), 0);
+    reinterpret_cast<GstFormat*>(&format), 0);
   return format;
 }
 
@@ -246,7 +246,8 @@ void QueryLatency::parse(bool& live, ClockTime& min_latency, ClockTime& max_late
 {
   gboolean glive = FALSE;
   gst_query_parse_latency(const_cast<GstQuery*>(gobj()), &glive,
-    (ClockTime*)(&min_latency), (ClockTime*)(&max_latency));
+    reinterpret_cast<ClockTime*>(&min_latency),
+    reinterpret_cast<ClockTime*>(&max_latency));
   live = glive;
 }
 
@@ -261,7 +262,7 @@ ClockTime QueryLatency::parse_min() const
 {
   ClockTime min = 0;
   gst_query_parse_latency(const_cast<GstQuery*>(gobj()), 0,
-    (ClockTime*)(&min), 0);
+    reinterpret_cast<ClockTime*>(&min), 0);
   return min;
 }
 
@@ -269,7 +270,7 @@ ClockTime QueryLatency::parse_max() const
 {
   ClockTime max = 0;
   gst_query_parse_latency(const_cast<GstQuery*>(gobj()), 0, 0,
-    (ClockTime*)(&max));
+    reinterpret_cast<ClockTime*>(&max));
   return max;
 }
 
@@ -292,7 +293,8 @@ void QuerySeeking::parse(Format& format, bool& seekable, gint64& segment_start,
 {
   gboolean gseekable = FALSE;
   gst_query_parse_seeking(const_cast<GstQuery*>(gobj()),
-    (GstFormat*)(&format), &gseekable, &segment_start, &segment_end);
+    reinterpret_cast<GstFormat*>(&format), &gseekable, &segment_start,
+    &segment_end);
   seekable = gseekable;
 }
 
@@ -300,7 +302,7 @@ Format QuerySeeking::parse_format() const
 {
   Format format = Gst::FORMAT_UNDEFINED;
   gst_query_parse_seeking(const_cast<GstQuery*>(gobj()),
-    (GstFormat*)(&format), 0, 0, 0);
+    reinterpret_cast<GstFormat*>(&format), 0, 0, 0);
   return format;
 }
 
@@ -340,12 +342,14 @@ Glib::RefPtr<Gst::Query> QueryFormats::create()
 
 void QueryFormats::set(const Glib::ArrayHandle<Format>& formats)
 {
-  gst_query_set_formatsv(gobj(), formats.size(), (GstFormat*)(formats.data()));
+  gst_query_set_formatsv(gobj(), formats.size(),
+    reinterpret_cast<GstFormat*>(const_cast<Gst::Format*>(formats.data())));
 }
 
 void QueryFormats::set(int n_formats, const Glib::ArrayHandle<Format>& formats)
 {
-  gst_query_set_formatsv(gobj(), n_formats, (GstFormat*)(formats.data()));
+  gst_query_set_formatsv(gobj(), n_formats,
+    reinterpret_cast<GstFormat*>(const_cast<Gst::Format*>(formats.data())));
 }
 
 guint QueryFormats::parse_length() const
@@ -359,7 +363,7 @@ Format QueryFormats::parse(guint nth) const
 {
   Format format = Gst::FORMAT_UNDEFINED;
   gst_query_parse_formats_nth(const_cast<GstQuery*>(gobj()), nth,
-    (GstFormat*)(&format));
+    reinterpret_cast<GstFormat*>(&format));
   return format;
 }
 
@@ -375,13 +379,14 @@ Glib::RefPtr<Gst::Query> QuerySegment::create(Format format)
 
 void QuerySegment::set(double rate, Format format, gint64 start_value, gint64 stop_value)
 {
-  gst_query_set_segment(gobj(), rate, GstFormat(format), start_value, stop_value);
+  gst_query_set_segment(gobj(), rate, static_cast<GstFormat>(format),
+    start_value, stop_value);
 }
 
 void QuerySegment::parse(double& rate, Format& format, gint64& start_value, gint64& stop_value) const
 {
   gst_query_parse_segment(const_cast<GstQuery*>(gobj()), &rate,
-    (GstFormat*)(&format), &start_value, &stop_value);
+    reinterpret_cast<GstFormat*>(&format), &start_value, &stop_value);
 }
 
 double QuerySegment::parse_rate() const
@@ -396,7 +401,7 @@ Format QuerySegment::parse_format() const
 {
   Format format = Gst::FORMAT_UNDEFINED;
   gst_query_parse_segment(const_cast<GstQuery*>(gobj()), 0,
-    (GstFormat*)(&format), 0, 0);
+    reinterpret_cast<GstFormat*>(&format), 0, 0);
   return format;
 }
 
@@ -457,21 +462,22 @@ int QueryBuffering::parse_percent() const
 
 void QueryBuffering::set(BufferingMode mode, int avg_in, int avg_out, gint64 buffering_left)
 {
-  gst_query_set_buffering_stats(gobj(), (GstBufferingMode)(mode), avg_in,
-    avg_out, buffering_left);
+  gst_query_set_buffering_stats(gobj(), static_cast<GstBufferingMode>(mode),
+    avg_in, avg_out, buffering_left);
 }
 
 void QueryBuffering::parse(BufferingMode& mode, int& avg_in, int& avg_out, gint64 buffering_left) const
 {
   gst_query_parse_buffering_stats(const_cast<GstQuery*>(gobj()),
-    (GstBufferingMode*)(&mode), &avg_in, &avg_out, &buffering_left);
+    reinterpret_cast<GstBufferingMode*>(&mode), &avg_in, &avg_out,
+    &buffering_left);
 }
 
 BufferingMode QueryBuffering::parse_mode() const
 {
   BufferingMode mode = Gst::BUFFERING_STREAM;
   gst_query_parse_buffering_stats(const_cast<GstQuery*>(gobj()),
-    (GstBufferingMode*)(&mode), 0, 0, 0);
+    reinterpret_cast<GstBufferingMode*>(&mode), 0, 0, 0);
   return mode;
 }
 
@@ -501,21 +507,21 @@ gint64 QueryBuffering::parse_time_left() const
 
 void QueryBuffering::set(Format format, gint64 start, gint64 stop, gint64 estimated_total)
 {
-  gst_query_set_buffering_range(gobj(), (GstFormat)(format), start, stop,
-    estimated_total);
+  gst_query_set_buffering_range(gobj(), static_cast<GstFormat>(format),
+    start, stop, estimated_total);
 }
 
 void QueryBuffering::parse(Format& format, gint64& start, gint64& stop, gint64& estimated_total) const
 {
   gst_query_parse_buffering_range(const_cast<GstQuery*>(gobj()),
-    (GstFormat*)(&format), &start, &stop, &estimated_total);
+    reinterpret_cast<GstFormat*>(&format), &start, &stop, &estimated_total);
 }
 
 Format QueryBuffering::parse_format() const
 {
   Format format = Gst::FORMAT_UNDEFINED;
   gst_query_parse_buffering_range(const_cast<GstQuery*>(gobj()),
-    (GstFormat*)(&format), 0, 0, 0);
+    reinterpret_cast<GstFormat*>(&format), 0, 0, 0);
   return format;
 }
 
diff --git a/gstreamer/src/segment.ccg b/gstreamer/src/segment.ccg
index 6bac2cb..3d4dd54 100644
--- a/gstreamer/src/segment.ccg
+++ b/gstreamer/src/segment.ccg
@@ -28,9 +28,9 @@ void Segment::set_seek(double rate, Format format, SeekFlags flags,
 {
   gboolean gst_update = 0;
 
-  gst_segment_set_seek(gobj(), rate, ((GstFormat)(format)),
-    ((GstSeekFlags)(flags)), ((GstSeekType)(start_type)), start,
-    ((GstSeekType)(stop_type)), stop, &gst_update); 
+  gst_segment_set_seek(gobj(), rate, static_cast<GstFormat>(format),
+    static_cast<GstSeekFlags>(flags), static_cast<GstSeekType>(start_type),
+    start, static_cast<GstSeekType>(stop_type), stop, &gst_update); 
 
   update = gst_update;
 }
diff --git a/gstreamer/src/task.ccg b/gstreamer/src/task.ccg
index ab1c445..9139d3f 100644
--- a/gstreamer/src/task.ccg
+++ b/gstreamer/src/task.ccg
@@ -114,7 +114,7 @@ Task::Task(const Glib::ConstructParams& construct_params)
 
 Task::Task(GstTask* castitem)
 :
-  Object((GstObject*)(castitem)),
+  Object(reinterpret_cast<GstObject*>(castitem)),
   _slot_set(false)
 {}
 
diff --git a/gstreamer/src/xml.ccg b/gstreamer/src/xml.ccg
index 5b2f970..52527fb 100644
--- a/gstreamer/src/xml.ccg
+++ b/gstreamer/src/xml.ccg
@@ -45,7 +45,9 @@ void XML::write_to_stream(const Glib::RefPtr<const Gst::Element>& element, std::
 
 bool XML::parse_memory(const std::string& buffer, const Glib::ustring& root)
 {
-  return gst_xml_parse_memory(this->gobj(),(guchar*)(buffer.c_str()), buffer.size(), root.c_str());
+  return gst_xml_parse_memory(this->gobj(),
+    reinterpret_cast<guchar*>(const_cast<char*>(buffer.c_str())),
+    buffer.size(), root.c_str());
 }
 
 } //namespace Gst



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]