From d5523f80c06d125648c6cb0e9b3761ae111e07c1 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Mon, 19 Feb 2018 17:32:21 +0000 Subject: [PATCH] Use CGAL_STATIC_THREAD_LOCAL_VARIABLE --- .../include/CGAL/Arr_geodesic_arc_on_sphere_traits_2.h | 10 ++++++---- Cone_spanners_2/include/CGAL/Construct_theta_graph_2.h | 5 +++-- Polynomial/include/CGAL/Polynomial_traits_d.h | 3 ++- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_geodesic_arc_on_sphere_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_geodesic_arc_on_sphere_traits_2.h index a1d2e8524fa..51998324c89 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_geodesic_arc_on_sphere_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_geodesic_arc_on_sphere_traits_2.h @@ -102,7 +102,7 @@ protected: */ inline static const Direction_3& neg_pole() { - static const Direction_3 d(0, 0, -1); + CGAL_STATIC_THREAD_LOCAL_VARIABLE_3(Direction_3, d, 0, 0, -1); return d; } @@ -114,11 +114,13 @@ protected: inline static const Direction_2& identification_xy() { #if (CGAL_IDENTIFICATION_XY == CGAL_X_MINUS_1_Y_0) - static const Direction_2 d(-1, 0); + CGAL_STATIC_THREAD_LOCAL_VARIABLE_2(Direction_2, d, -1, 0); + #elif (CGAL_IDENTIFICATION_XY == CGAL_X_MINUS_8_Y_6) - static const Direction_2 d(-8, 6); + CGAL_STATIC_THREAD_LOCAL_VARIABLE_2(Direction_2, d, -8, 6); + #elif (CGAL_IDENTIFICATION_XY == CGAL_X_MINUS_11_Y_7) - static const Direction_2 d(-11, 7); + CGAL_STATIC_THREAD_LOCAL_VARIABLE_2(Direction_2, d, -11, 7); #else #error CGAL_IDENTIFICATION_XY is not defined #endif diff --git a/Cone_spanners_2/include/CGAL/Construct_theta_graph_2.h b/Cone_spanners_2/include/CGAL/Construct_theta_graph_2.h index e5b7010b142..156d5b3e151 100644 --- a/Cone_spanners_2/include/CGAL/Construct_theta_graph_2.h +++ b/Cone_spanners_2/include/CGAL/Construct_theta_graph_2.h @@ -38,6 +38,7 @@ #include #include #include +#include #include #include @@ -192,8 +193,8 @@ protected: Direction_2 bisector_direction = bisector(cwLine, ccwLine).direction(); // Rotational transformation of cw 90 degree - static const Transformation cw90( 0, 1, -1, 0); - + CGAL_STATIC_THREAD_LOCAL_VARIABLE_4(Transformation, cw90, 0, 1, -1, 0); + // Ordering // here D1 is the reverse of D1 in the book, we find this is easier to implement const Less_by_direction orderD1 (g, ccwBound); diff --git a/Polynomial/include/CGAL/Polynomial_traits_d.h b/Polynomial/include/CGAL/Polynomial_traits_d.h index 438c881a945..42c96b05c15 100644 --- a/Polynomial/include/CGAL/Polynomial_traits_d.h +++ b/Polynomial/include/CGAL/Polynomial_traits_d.h @@ -46,6 +46,7 @@ #include #include +#include #define CGAL_POLYNOMIAL_TRAITS_D_BASE_TYPEDEFS \ @@ -703,7 +704,7 @@ public: : public CGAL::binary_function { const Coefficient_type& operator()( const Polynomial_d& p, int i) const { - static const Coefficient_type zero = Coefficient_type(0); + CGAL_STATIC_THREAD_LOCAL_VARIABLE(Coefficient_type, zero, 0); CGAL_precondition( i >= 0 ); typename PT::Degree degree; if( i > degree(p) )