[glibmm] Glib::TypeTraits<>: Avoid warnings when compiling with -Wcast-qual.
- From: Kjell Ahlstedt <kjellahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glibmm] Glib::TypeTraits<>: Avoid warnings when compiling with -Wcast-qual.
- Date: Fri, 26 Jul 2013 11:02:10 +0000 (UTC)
commit f8154728e116e04571522bd416a5322836d4f6d4
Author: Kjell Ahlstedt <kjell ahlstedt bredband net>
Date: Wed Jul 24 13:29:57 2013 +0200
Glib::TypeTraits<>: Avoid warnings when compiling with -Wcast-qual.
* glib/glibmm/containerhandle_shared.h: Move const_cast<CTypeNonConst>(ptr)
from the TypeTraits< Glib::RefPtr<T> > specialization to the
TypeTraits< Glib::RefPtr<const T> > specialization, thus avoiding warnings
when compiling with -Wcast-qual. Bug #704640.
glib/glibmm/containerhandle_shared.h | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/glib/glibmm/containerhandle_shared.h b/glib/glibmm/containerhandle_shared.h
index e9094c9..ddb7787 100644
--- a/glib/glibmm/containerhandle_shared.h
+++ b/glib/glibmm/containerhandle_shared.h
@@ -121,7 +121,7 @@ struct TypeTraits
#ifndef DOXYGEN_SHOULD_SKIP_THIS /* hide the specializations */
-//For some (proably, more spec-compliant) compilers, these specializations must
+//For some (probably, more spec-compliant) compilers, these specializations must
//be next to the objects that they use.
#ifdef GLIBMM_CAN_USE_DYNAMIC_CAST_IN_UNUSED_TEMPLATE_WITHOUT_DEFINITION
@@ -208,7 +208,7 @@ struct TypeTraits< Glib::RefPtr<T> >
//because we can not use a specific Glib::wrap(CType) overload here,
//because that would be "dependent", and g++ 3.4 does not allow that.
//The specific Glib::wrap() overloads don't do anything special anyway.
- GObject* cobj = (GObject*)const_cast<CTypeNonConst>(ptr);
+ GObject* cobj = (GObject*)(ptr);
return Glib::RefPtr<T>( dynamic_cast<T*>(Glib::wrap_auto(cobj, true /* take_copy */)) );
//We use dynamic_cast<> in case of multiple inheritance.
}
@@ -244,7 +244,7 @@ struct TypeTraits< Glib::RefPtr<const T> >
//because we can not use a specific Glib::wrap(CType) overload here,
//because that would be "dependent", and g++ 3.4 does not allow that.
//The specific Glib::wrap() overloads don't do anything special anyway.
- GObject* cobj = (GObject*)(ptr);
+ GObject* cobj = (GObject*)const_cast<CTypeNonConst>(ptr);
return Glib::RefPtr<const T>( dynamic_cast<const T*>(Glib::wrap_auto(cobj, true /* take_copy */)) );
//We use dynamic_cast<> in case of multiple inheritance.
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]