From a7c555fdc8f66a4ec99ca9b914ade9ed2e3b35a8 Mon Sep 17 00:00:00 2001 From: Daniel Russel Date: Fri, 24 Mar 2006 01:57:48 +0000 Subject: [PATCH] patching for visual studio protections bug --- .../include/Qt_Delaunay_stable_subset_2.h | 14 ++++++++------ .../CGAL/Kinetic/IO/Qt_triangulation_2.h | 5 +++-- .../internal/Double_with_infinity.h | 3 ++- .../CGAL/Polynomial/internal/Explicit_root.h | 3 ++- .../internal/Simple_interval_root.h | 3 ++- .../CGAL/Polynomial/internal/Sturm_root_rep.h | 19 +++++++++++-------- 6 files changed, 28 insertions(+), 19 deletions(-) diff --git a/Kinetic_data_structures/demo/Kinetic_data_structures/include/Qt_Delaunay_stable_subset_2.h b/Kinetic_data_structures/demo/Kinetic_data_structures/include/Qt_Delaunay_stable_subset_2.h index f74b32d42e4..684d7dde422 100644 --- a/Kinetic_data_structures/demo/Kinetic_data_structures/include/Qt_Delaunay_stable_subset_2.h +++ b/Kinetic_data_structures/demo/Kinetic_data_structures/include/Qt_Delaunay_stable_subset_2.h @@ -51,18 +51,20 @@ protected: return std::acos(ac); } + typedef typename Qt_gui::Listener QTL; + //! This class listens for redraw requests (PICTURE_IS_VALID becoming false) /*! It calls the draw method when it recieves a notification. */ - class Listener: public Qt_gui::Listener + class Listener: public QTL { - typedef typename Qt_gui::Listener P; + typedef typename QTL P; public: - Listener(typename Qt_gui::Handle &h, Qt_del *t): Qt_gui::Listener(h), t_(t){} - virtual void new_notification(typename Qt_gui::Listener::Notification_type nt) { - if (nt == Qt_gui::Listener::PICTURE_IS_VALID) { - t_->draw(*P::widget(), P::notifier()->current_time()); + Listener(typename Qt_gui::Handle &h, Qt_del *t): P(h), t_(t){} + virtual void new_notification(typename QTL::Notification_type nt) { + if (nt == QTL::PICTURE_IS_VALID) { + t_->draw(*P::widget(), P::notifier()->current_time()); } } protected: diff --git a/Kinetic_data_structures/include/CGAL/Kinetic/IO/Qt_triangulation_2.h b/Kinetic_data_structures/include/CGAL/Kinetic/IO/Qt_triangulation_2.h index 6349d667684..a8d66d0b7c3 100644 --- a/Kinetic_data_structures/include/CGAL/Kinetic/IO/Qt_triangulation_2.h +++ b/Kinetic_data_structures/include/CGAL/Kinetic/IO/Qt_triangulation_2.h @@ -41,10 +41,11 @@ class Qt_triangulation_2: public Ref_counted TDS_helper; // maybe icl wants the class definition before the useage. - class Listener: public Qt_gui::Listener +typedef typename Qt_gui::Listener QTL; + class Listener: public QTL { typedef Qt_triangulation_2 Container; - typedef typename Qt_gui::Listener P; + typedef typename QTL P; public: Listener(typename Qt_gui::Handle &h, Container *t): P(h), t_(t){} virtual void new_notification(typename P::Notification_type nt) { diff --git a/Kinetic_data_structures/include/CGAL/Polynomial/internal/Double_with_infinity.h b/Kinetic_data_structures/include/CGAL/Polynomial/internal/Double_with_infinity.h index 0480636bb3e..789ca491099 100644 --- a/Kinetic_data_structures/include/CGAL/Polynomial/internal/Double_with_infinity.h +++ b/Kinetic_data_structures/include/CGAL/Polynomial/internal/Double_with_infinity.h @@ -71,8 +71,9 @@ CGAL_POLYNOMIAL_END_INTERNAL_NAMESPACE namespace std { template <> - struct numeric_limits: public numeric_limits + class numeric_limits: public numeric_limits { + public: static const bool is_specialized = true; static const bool has_infinity=true; static double infinity() throw() {return std::numeric_limits::max();} diff --git a/Kinetic_data_structures/include/CGAL/Polynomial/internal/Explicit_root.h b/Kinetic_data_structures/include/CGAL/Polynomial/internal/Explicit_root.h index 69b7a1acd15..49931824f4b 100644 --- a/Kinetic_data_structures/include/CGAL/Polynomial/internal/Explicit_root.h +++ b/Kinetic_data_structures/include/CGAL/Polynomial/internal/Explicit_root.h @@ -250,8 +250,9 @@ CGAL_END_NAMESPACE namespace std { template - struct numeric_limits >: public numeric_limits + class numeric_limits >: public numeric_limits { + public: typedef numeric_limits P; typedef CGAL_POLYNOMIAL_NS::internal::Explicit_root T; static const bool is_specialized = true; diff --git a/Kinetic_data_structures/include/CGAL/Polynomial/internal/Simple_interval_root.h b/Kinetic_data_structures/include/CGAL/Polynomial/internal/Simple_interval_root.h index a1dd150c4eb..74db4cda4ed 100644 --- a/Kinetic_data_structures/include/CGAL/Polynomial/internal/Simple_interval_root.h +++ b/Kinetic_data_structures/include/CGAL/Polynomial/internal/Simple_interval_root.h @@ -828,8 +828,9 @@ namespace CGAL namespace std { template - struct numeric_limits > + class numeric_limits > { + public: typedef CGAL_POLYNOMIAL_NS::internal::Simple_interval_root T; static const bool is_specialized = true; static T min() throw () {return -T::infinity();} diff --git a/Kinetic_data_structures/include/CGAL/Polynomial/internal/Sturm_root_rep.h b/Kinetic_data_structures/include/CGAL/Polynomial/internal/Sturm_root_rep.h index 9d182d2003d..1667117443f 100644 --- a/Kinetic_data_structures/include/CGAL/Polynomial/internal/Sturm_root_rep.h +++ b/Kinetic_data_structures/include/CGAL/Polynomial/internal/Sturm_root_rep.h @@ -889,13 +889,15 @@ public: //====================== double compute_double(double acc = 1e-10) const { - if ( idx == -1 ) { - return DBL_MAX * DBL_MAX; - } - - if ( idx == -2 ) { + if (idx < 0) { + double inf=std::numeric_limits::has_infinity? std::numeric_limits::infinity() : std::numeric_limits::max(); + if ( idx == -1 ){ + return inf; + } else return -inf; + } + /*if ( idx == -2 ) { return -DBL_MAX * DBL_MAX; - } + }*/ if ( is_exact() ) { return CGAL_POLYNOMIAL_TO_DOUBLE(lower_bound()); @@ -1030,10 +1032,11 @@ CGAL_END_NAMESPACE namespace std { template - struct numeric_limits >: + class numeric_limits >: public numeric_limits::NT > { - typedef numeric_limits > P; + public: + typedef numeric_limits::NT > P; typedef CGAL_POLYNOMIAL_NS::internal::Sturm_root_rep T; static const bool is_specialized = true; static T min() throw() {return T(P::min());}