From be0ff2258cf0ec71e442518845185ec0ad49a6d4 Mon Sep 17 00:00:00 2001 From: Christian Schmitt Date: Sat, 24 Nov 2012 23:04:17 +0100 Subject: [PATCH] tg_unique_*: make MSVC happy with the rounding --- src/Lib/Polygon/tg_unique_vec2f.hxx | 7 ++++--- src/Lib/Polygon/tg_unique_vec3d.hxx | 9 +++++---- src/Lib/Polygon/tg_unique_vec3f.hxx | 9 +++++---- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/Lib/Polygon/tg_unique_vec2f.hxx b/src/Lib/Polygon/tg_unique_vec2f.hxx index 4159a1d1..3e9f14f3 100644 --- a/src/Lib/Polygon/tg_unique_vec2f.hxx +++ b/src/Lib/Polygon/tg_unique_vec2f.hxx @@ -1,4 +1,5 @@ #include +#include // Implement Unique SGVec2f list @@ -41,8 +42,8 @@ public: /* only hash lon, lat - we want to detect dups in 2d only */ unsigned long long raw_pt[2]; - raw_pt[0] = (unsigned long long)( round(vec.x() * PROXIMITY_MULTIPLIER) ); - raw_pt[1] = (unsigned long long)( round(vec.y() * PROXIMITY_MULTIPLIER) ); + raw_pt[0] = (unsigned long long)( SGMisc::round(vec.x() * PROXIMITY_MULTIPLIER) ); + raw_pt[1] = (unsigned long long)( SGMisc::round(vec.y() * PROXIMITY_MULTIPLIER) ); unsigned char* it = (unsigned char*)raw_pt; for ( unsigned i=0; i +#include // Implement Unique SGVec3d list @@ -41,9 +42,9 @@ public: /* only hash lon, lat - we want to detect dups in 2d only */ unsigned long long raw_pt[3]; - raw_pt[0] = (unsigned long long)( round(vec.x() * PROXIMITY_MULTIPLIER) ); - raw_pt[1] = (unsigned long long)( round(vec.y() * PROXIMITY_MULTIPLIER) ); - raw_pt[2] = (unsigned long long)( round(vec.z() * PROXIMITY_MULTIPLIER) ); + raw_pt[0] = (unsigned long long)( SGMisc::round(vec.x() * PROXIMITY_MULTIPLIER) ); + raw_pt[1] = (unsigned long long)( SGMisc::round(vec.y() * PROXIMITY_MULTIPLIER) ); + raw_pt[2] = (unsigned long long)( SGMisc::round(vec.z() * PROXIMITY_MULTIPLIER) ); unsigned char* it = (unsigned char*)raw_pt; for ( unsigned i=0; i +#include // Implement Unique SGVec3f list @@ -41,9 +42,9 @@ public: /* only hash lon, lat - we want to detect dups in 2d only */ unsigned long long raw_pt[3]; - raw_pt[0] = (unsigned long long)( round(vec.x() * PROXIMITY_MULTIPLIER) ); - raw_pt[1] = (unsigned long long)( round(vec.y() * PROXIMITY_MULTIPLIER) ); - raw_pt[2] = (unsigned long long)( round(vec.z() * PROXIMITY_MULTIPLIER) ); + raw_pt[0] = (unsigned long long)( SGMisc::round(vec.x() * PROXIMITY_MULTIPLIER) ); + raw_pt[1] = (unsigned long long)( SGMisc::round(vec.y() * PROXIMITY_MULTIPLIER) ); + raw_pt[2] = (unsigned long long)( SGMisc::round(vec.z() * PROXIMITY_MULTIPLIER) ); unsigned char* it = (unsigned char*)raw_pt; for ( unsigned i=0; i