diff --git a/Nef_2/include/CGAL/Filtered_extended_homogeneous.h b/Nef_2/include/CGAL/Filtered_extended_homogeneous.h index 08ea67aaf42..11e67af38c1 100644 --- a/Nef_2/include/CGAL/Filtered_extended_homogeneous.h +++ b/Nef_2/include/CGAL/Filtered_extended_homogeneous.h @@ -25,6 +25,7 @@ #include #include #include +#include #undef CGAL_NEF_DEBUG #define CGAL_NEF_DEBUG 5 #include @@ -93,14 +94,18 @@ public: // only for visualization: - static void set_R(const RT& R) { R_ = R; } + + static RT& R() + { + CGAL_STATIC_THREAD_LOCAL_VARIABLE(RT,R_,0); + } + + static void set_R(const RT& r) { R() = r; } RT eval_at(const RT& r) const { return _m*r+_n; } - RT eval_at_R() const { return _m*R_+_n; } -protected: - static RT R_; + RT eval_at_R() const { return _m*R()+_n; } + }; -template RT SPolynomial::R_; template int sign(const SPolynomial& p) @@ -138,7 +143,7 @@ bool operator<(const SPolynomial& p1, int i) template inline double to_double(const SPolynomial& p) -{ return (CGAL::to_double(p.eval_at(SPolynomial::R_))); } +{ return (CGAL::to_double(p.eval_at(SPolynomial::R()))); } template std::ostream& operator<<(std::ostream& os, const SPolynomial& p) diff --git a/Nef_2/include/CGAL/IO/Nef_polyhedron_2_PS_stream.h b/Nef_2/include/CGAL/IO/Nef_polyhedron_2_PS_stream.h index c12fd5c2bb6..0662d1bdc8e 100644 --- a/Nef_2/include/CGAL/IO/Nef_polyhedron_2_PS_stream.h +++ b/Nef_2/include/CGAL/IO/Nef_polyhedron_2_PS_stream.h @@ -27,7 +27,7 @@ #include namespace CGAL { -static int frame_default = 100; +static const int frame_default = 100; template leda_list diff --git a/Nef_2/include/CGAL/Nef_polynomial.h b/Nef_2/include/CGAL/Nef_polynomial.h index cf57ef91afe..6b4f276aedf 100644 --- a/Nef_2/include/CGAL/Nef_polynomial.h +++ b/Nef_2/include/CGAL/Nef_polynomial.h @@ -29,6 +29,7 @@ #include #include +#include #include @@ -70,7 +71,7 @@ class Nef_polynomial const Base & polynomial() const { return static_cast(*this); } static NT& infi_maximal_value() { - static NT R_ = 1; + CGAL_STATIC_THREAD_LOCAL_VARIABLE(NT, R_, 1); return R_; } };