From: Nikita Kitaev Date: Thu, 1 Apr 2010 01:29:13 +0000 (-0700) Subject: Remove dynamic cast hack X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=71e30a766e852b1a96ad035adc4ba21e5a422f70;p=synfig.git Remove dynamic cast hack GCC 3.0.4 with broken casting is long outdated --- diff --git a/synfig-core/src/modules/mod_noise/valuenode_random.cpp b/synfig-core/src/modules/mod_noise/valuenode_random.cpp index 1ae09a4..cf0ee25 100644 --- a/synfig-core/src/modules/mod_noise/valuenode_random.cpp +++ b/synfig-core/src/modules/mod_noise/valuenode_random.cpp @@ -89,8 +89,6 @@ ValueNode_Random::ValueNode_Random(const ValueBase &value): default: throw Exception::BadType(ValueBase::type_local_name(get_type())); } - - DCAST_HACK_ENABLE(); } LinkableValueNode* diff --git a/synfig-core/src/synfig/valuenode.h b/synfig-core/src/synfig/valuenode.h index 9b838b7..a7a8f30 100644 --- a/synfig-core/src/synfig/valuenode.h +++ b/synfig-core/src/synfig/valuenode.h @@ -49,18 +49,6 @@ /* === M A C R O S ========================================================= */ -// This is a hack for GCC 3.0.4... which has a broken dynamic_cast<> -// It is deprecated, and will be removed soon. -#if ( __GNUC__ == 3 ) && ( __GNUC__MINOR__ == 0 ) -# define DCAST_HACK_BASECLASS() int cast__ -# define DCAST_HACK_ID(x) static const int my_cast__(void) { return x; } -# define DCAST_HACK_ENABLE() cast__=my_cast__() -#else -# define DCAST_HACK_BASECLASS() -# define DCAST_HACK_ID(x) -# define DCAST_HACK_ENABLE() -#endif - #define CHECK_TYPE_AND_SET_VALUE(variable, type) \ /* I don't think this ever happens - maybe remove this code? */ \ if (get_type() == ValueBase::TYPE_NIL) { \ @@ -249,10 +237,6 @@ protected: void set_type(ValueBase::Type t) { type=t; } virtual void on_changed(); - -public: - DCAST_HACK_BASECLASS(); - DCAST_HACK_ID(0); }; // END of class ValueNode /*! \class PlaceholderValueNode diff --git a/synfig-core/src/synfig/valuenode_anglestring.cpp b/synfig-core/src/synfig/valuenode_anglestring.cpp index 978b8b8..99b51ef 100644 --- a/synfig-core/src/synfig/valuenode_anglestring.cpp +++ b/synfig-core/src/synfig/valuenode_anglestring.cpp @@ -65,8 +65,6 @@ ValueNode_AngleString::ValueNode_AngleString(const ValueBase &value): default: throw Exception::BadType(ValueBase::type_local_name(value.get_type())); } - - DCAST_HACK_ENABLE(); } LinkableValueNode* diff --git a/synfig-core/src/synfig/valuenode_animated.cpp b/synfig-core/src/synfig/valuenode_animated.cpp index c2a32fc..3e7e444 100644 --- a/synfig-core/src/synfig/valuenode_animated.cpp +++ b/synfig-core/src/synfig/valuenode_animated.cpp @@ -734,7 +734,6 @@ public: ValueNode_Animated::ValueNode_Animated() { - DCAST_HACK_ENABLE(); } int diff --git a/synfig-core/src/synfig/valuenode_animated.h b/synfig-core/src/synfig/valuenode_animated.h index c153526..fe16255 100644 --- a/synfig-core/src/synfig/valuenode_animated.h +++ b/synfig-core/src/synfig/valuenode_animated.h @@ -106,8 +106,6 @@ protected: void set_type(ValueBase::Type t); virtual void get_times_vfunc(Node::time_set &set) const; -public: - DCAST_HACK_ID(4); }; }; // END of namespace synfig diff --git a/synfig-core/src/synfig/valuenode_atan2.cpp b/synfig-core/src/synfig/valuenode_atan2.cpp index c4dd5e7..89bedc2 100644 --- a/synfig-core/src/synfig/valuenode_atan2.cpp +++ b/synfig-core/src/synfig/valuenode_atan2.cpp @@ -62,8 +62,6 @@ ValueNode_Atan2::ValueNode_Atan2(const ValueBase &value): default: throw Exception::BadType(ValueBase::type_local_name(value.get_type())); } - - DCAST_HACK_ENABLE(); } LinkableValueNode* diff --git a/synfig-core/src/synfig/valuenode_const.cpp b/synfig-core/src/synfig/valuenode_const.cpp index dcf3d41..89ecae7 100644 --- a/synfig-core/src/synfig/valuenode_const.cpp +++ b/synfig-core/src/synfig/valuenode_const.cpp @@ -50,7 +50,6 @@ using namespace synfig; ValueNode_Const::ValueNode_Const() { - DCAST_HACK_ENABLE(); } @@ -58,7 +57,6 @@ ValueNode_Const::ValueNode_Const(const ValueBase &x): ValueNode (x.get_type()), value (x) { - DCAST_HACK_ENABLE(); } diff --git a/synfig-core/src/synfig/valuenode_cos.cpp b/synfig-core/src/synfig/valuenode_cos.cpp index f3e4793..17d49d6 100644 --- a/synfig-core/src/synfig/valuenode_cos.cpp +++ b/synfig-core/src/synfig/valuenode_cos.cpp @@ -62,8 +62,6 @@ ValueNode_Cos::ValueNode_Cos(const ValueBase &value): default: throw Exception::BadType(ValueBase::type_local_name(value.get_type())); } - - DCAST_HACK_ENABLE(); } LinkableValueNode* diff --git a/synfig-core/src/synfig/valuenode_dotproduct.cpp b/synfig-core/src/synfig/valuenode_dotproduct.cpp index 55de6ae..4748cc2 100644 --- a/synfig-core/src/synfig/valuenode_dotproduct.cpp +++ b/synfig-core/src/synfig/valuenode_dotproduct.cpp @@ -66,8 +66,6 @@ ValueNode_DotProduct::ValueNode_DotProduct(const ValueBase &value): default: throw Exception::BadType(ValueBase::type_local_name(value.get_type())); } - - DCAST_HACK_ENABLE(); } LinkableValueNode* diff --git a/synfig-core/src/synfig/valuenode_dynamiclist.cpp b/synfig-core/src/synfig/valuenode_dynamiclist.cpp index a8c253a..6791cc4 100644 --- a/synfig-core/src/synfig/valuenode_dynamiclist.cpp +++ b/synfig-core/src/synfig/valuenode_dynamiclist.cpp @@ -550,7 +550,6 @@ ValueNode_DynamicList::ValueNode_DynamicList(ValueBase::Type container_type): container_type (container_type), loop_(false) { - DCAST_HACK_ENABLE(); } ValueNode_DynamicList::Handle diff --git a/synfig-core/src/synfig/valuenode_exp.cpp b/synfig-core/src/synfig/valuenode_exp.cpp index 05d4b63..4e41cc2 100644 --- a/synfig-core/src/synfig/valuenode_exp.cpp +++ b/synfig-core/src/synfig/valuenode_exp.cpp @@ -62,8 +62,6 @@ ValueNode_Exp::ValueNode_Exp(const ValueBase &value): default: throw Exception::BadType(ValueBase::type_local_name(value.get_type())); } - - DCAST_HACK_ENABLE(); } LinkableValueNode* diff --git a/synfig-core/src/synfig/valuenode_gradientcolor.cpp b/synfig-core/src/synfig/valuenode_gradientcolor.cpp index 60c6e7e..b4dd0ce 100644 --- a/synfig-core/src/synfig/valuenode_gradientcolor.cpp +++ b/synfig-core/src/synfig/valuenode_gradientcolor.cpp @@ -64,8 +64,6 @@ ValueNode_GradientColor::ValueNode_GradientColor(const ValueBase &value): default: throw Exception::BadType(ValueBase::type_local_name(value.get_type())); } - - DCAST_HACK_ENABLE(); } LinkableValueNode* diff --git a/synfig-core/src/synfig/valuenode_gradientrotate.cpp b/synfig-core/src/synfig/valuenode_gradientrotate.cpp index 3e06bfc..abc962d 100644 --- a/synfig-core/src/synfig/valuenode_gradientrotate.cpp +++ b/synfig-core/src/synfig/valuenode_gradientrotate.cpp @@ -57,7 +57,6 @@ synfig::ValueNode_GradientRotate::ValueNode_GradientRotate(const Gradient& x): { set_link("gradient",ValueNode_Const::create(x)); set_link("offset",ValueNode_Const::create(Real(0))); - DCAST_HACK_ENABLE(); } LinkableValueNode* diff --git a/synfig-core/src/synfig/valuenode_intstring.cpp b/synfig-core/src/synfig/valuenode_intstring.cpp index c7011d2..1ae8284 100644 --- a/synfig-core/src/synfig/valuenode_intstring.cpp +++ b/synfig-core/src/synfig/valuenode_intstring.cpp @@ -64,8 +64,6 @@ ValueNode_IntString::ValueNode_IntString(const ValueBase &value): default: throw Exception::BadType(ValueBase::type_local_name(value.get_type())); } - - DCAST_HACK_ENABLE(); } LinkableValueNode* diff --git a/synfig-core/src/synfig/valuenode_join.cpp b/synfig-core/src/synfig/valuenode_join.cpp index eaa8fbc..2c085ba 100644 --- a/synfig-core/src/synfig/valuenode_join.cpp +++ b/synfig-core/src/synfig/valuenode_join.cpp @@ -74,8 +74,6 @@ ValueNode_Join::ValueNode_Join(const ValueBase &value): default: throw Exception::BadType(ValueBase::type_local_name(value.get_type())); } - - DCAST_HACK_ENABLE(); } LinkableValueNode* diff --git a/synfig-core/src/synfig/valuenode_linear.cpp b/synfig-core/src/synfig/valuenode_linear.cpp index 583612e..418305d 100644 --- a/synfig-core/src/synfig/valuenode_linear.cpp +++ b/synfig-core/src/synfig/valuenode_linear.cpp @@ -84,8 +84,6 @@ ValueNode_Linear::ValueNode_Linear(const ValueBase &value): default: throw Exception::BadType(ValueBase::type_local_name(get_type())); } - - DCAST_HACK_ENABLE(); } LinkableValueNode* diff --git a/synfig-core/src/synfig/valuenode_range.cpp b/synfig-core/src/synfig/valuenode_range.cpp index be2f6a2..2714d4e 100644 --- a/synfig-core/src/synfig/valuenode_range.cpp +++ b/synfig-core/src/synfig/valuenode_range.cpp @@ -90,8 +90,6 @@ synfig::ValueNode_Range::ValueNode_Range(const ValueBase &value): assert(max_->get_type()==id); assert(link_->get_type()==id); assert(get_type()==id); - - DCAST_HACK_ENABLE(); } LinkableValueNode* diff --git a/synfig-core/src/synfig/valuenode_realstring.cpp b/synfig-core/src/synfig/valuenode_realstring.cpp index e8231e7..a8b14da 100644 --- a/synfig-core/src/synfig/valuenode_realstring.cpp +++ b/synfig-core/src/synfig/valuenode_realstring.cpp @@ -65,8 +65,6 @@ ValueNode_RealString::ValueNode_RealString(const ValueBase &value): default: throw Exception::BadType(ValueBase::type_local_name(value.get_type())); } - - DCAST_HACK_ENABLE(); } LinkableValueNode* diff --git a/synfig-core/src/synfig/valuenode_sine.cpp b/synfig-core/src/synfig/valuenode_sine.cpp index 6e42dc7..9aaaee2 100644 --- a/synfig-core/src/synfig/valuenode_sine.cpp +++ b/synfig-core/src/synfig/valuenode_sine.cpp @@ -62,8 +62,6 @@ ValueNode_Sine::ValueNode_Sine(const ValueBase &value): default: throw Exception::BadType(ValueBase::type_local_name(value.get_type())); } - - DCAST_HACK_ENABLE(); } LinkableValueNode* diff --git a/synfig-core/src/synfig/valuenode_step.cpp b/synfig-core/src/synfig/valuenode_step.cpp index 98d9d80..3b5c913 100644 --- a/synfig-core/src/synfig/valuenode_step.cpp +++ b/synfig-core/src/synfig/valuenode_step.cpp @@ -81,8 +81,6 @@ ValueNode_Step::ValueNode_Step(const ValueBase &value): default: throw Exception::BadType(ValueBase::type_local_name(get_type())); } - - DCAST_HACK_ENABLE(); } LinkableValueNode* diff --git a/synfig-core/src/synfig/valuenode_subtract.cpp b/synfig-core/src/synfig/valuenode_subtract.cpp index 3ba475e..1523420 100644 --- a/synfig-core/src/synfig/valuenode_subtract.cpp +++ b/synfig-core/src/synfig/valuenode_subtract.cpp @@ -101,8 +101,6 @@ synfig::ValueNode_Subtract::ValueNode_Subtract(const ValueBase &value): assert(ref_a->get_type()==id); assert(ref_b->get_type()==id); assert(get_type()==id); - - DCAST_HACK_ENABLE(); } LinkableValueNode* diff --git a/synfig-core/src/synfig/valuenode_timedswap.cpp b/synfig-core/src/synfig/valuenode_timedswap.cpp index 378535a..277390b 100644 --- a/synfig-core/src/synfig/valuenode_timedswap.cpp +++ b/synfig-core/src/synfig/valuenode_timedswap.cpp @@ -88,8 +88,6 @@ ValueNode_TimedSwap::ValueNode_TimedSwap(const ValueBase &value): set_link("time",ValueNode_Const::create(Time(2))); set_link("length",ValueNode_Const::create(Time(1))); - - DCAST_HACK_ENABLE(); } ValueNode_TimedSwap* diff --git a/synfig-core/src/synfig/valuenode_timestring.cpp b/synfig-core/src/synfig/valuenode_timestring.cpp index a0808aa..e01859d 100644 --- a/synfig-core/src/synfig/valuenode_timestring.cpp +++ b/synfig-core/src/synfig/valuenode_timestring.cpp @@ -62,8 +62,6 @@ ValueNode_TimeString::ValueNode_TimeString(const ValueBase &value): default: throw Exception::BadType(ValueBase::type_local_name(value.get_type())); } - - DCAST_HACK_ENABLE(); } LinkableValueNode* diff --git a/synfig-core/src/synfig/valuenode_twotone.cpp b/synfig-core/src/synfig/valuenode_twotone.cpp index 3c18ce0..2e9a2b8 100644 --- a/synfig-core/src/synfig/valuenode_twotone.cpp +++ b/synfig-core/src/synfig/valuenode_twotone.cpp @@ -64,8 +64,6 @@ synfig::ValueNode_TwoTone::ValueNode_TwoTone(const ValueBase &value):LinkableVal default: throw Exception::BadType(ValueBase::type_local_name(value.get_type())); } - - DCAST_HACK_ENABLE(); } LinkableValueNode* diff --git a/synfig-core/src/synfig/valuenode_vectorangle.cpp b/synfig-core/src/synfig/valuenode_vectorangle.cpp index c339d2f..43fb5e0 100644 --- a/synfig-core/src/synfig/valuenode_vectorangle.cpp +++ b/synfig-core/src/synfig/valuenode_vectorangle.cpp @@ -62,8 +62,6 @@ ValueNode_VectorAngle::ValueNode_VectorAngle(const ValueBase &value): default: throw Exception::BadType(ValueBase::type_local_name(value.get_type())); } - - DCAST_HACK_ENABLE(); } LinkableValueNode* diff --git a/synfig-core/src/synfig/valuenode_vectorlength.cpp b/synfig-core/src/synfig/valuenode_vectorlength.cpp index 5d85f98..3839ad8 100644 --- a/synfig-core/src/synfig/valuenode_vectorlength.cpp +++ b/synfig-core/src/synfig/valuenode_vectorlength.cpp @@ -61,8 +61,6 @@ ValueNode_VectorLength::ValueNode_VectorLength(const ValueBase &value): default: throw Exception::BadType(ValueBase::type_local_name(value.get_type())); } - - DCAST_HACK_ENABLE(); } LinkableValueNode* diff --git a/synfig-core/src/synfig/valuenode_vectorx.cpp b/synfig-core/src/synfig/valuenode_vectorx.cpp index 48f9180..f6df3c8 100644 --- a/synfig-core/src/synfig/valuenode_vectorx.cpp +++ b/synfig-core/src/synfig/valuenode_vectorx.cpp @@ -61,8 +61,6 @@ ValueNode_VectorX::ValueNode_VectorX(const ValueBase &value): default: throw Exception::BadType(ValueBase::type_local_name(value.get_type())); } - - DCAST_HACK_ENABLE(); } LinkableValueNode* diff --git a/synfig-core/src/synfig/valuenode_vectory.cpp b/synfig-core/src/synfig/valuenode_vectory.cpp index 4063eae..ea55176 100644 --- a/synfig-core/src/synfig/valuenode_vectory.cpp +++ b/synfig-core/src/synfig/valuenode_vectory.cpp @@ -61,8 +61,6 @@ ValueNode_VectorY::ValueNode_VectorY(const ValueBase &value): default: throw Exception::BadType(ValueBase::type_local_name(value.get_type())); } - - DCAST_HACK_ENABLE(); } LinkableValueNode*