1
0
Fork 0

Suppress warnings under Windows. The level of code duplication is remarkable. Maybe a template could fit

This commit is contained in:
Frederic Bouvier 2013-01-06 00:22:11 +01:00
parent 29e10a7314
commit d6e753014d
4 changed files with 36 additions and 0 deletions

View file

@ -17,6 +17,11 @@
// same bucket.
// We could experiment with making it so 1 point per bucket, but I'm nervous...
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable: 4309)
#endif
#define PROXIMITY_MULTIPLIER (100000)
#define PROXIMITY_EPSILON ((double) 1 / (double)( PROXIMITY_MULTIPLIER * 10 ) )
@ -70,6 +75,10 @@ private:
unsigned int ordered_index;
};
#ifdef _MSC_VER
#pragma warning(pop)
#endif
inline bool operator == (const SGGeodIndex& a, const SGGeodIndex& b) {
return (( fabs(a.geod.getLongitudeDeg() - b.geod.getLongitudeDeg()) < PROXIMITY_EPSILON ) &&
( fabs(a.geod.getLatitudeDeg() - b.geod.getLatitudeDeg()) < PROXIMITY_EPSILON ));

View file

@ -124,6 +124,11 @@ private:
TGFaceList faces;
};
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable: 4309)
#endif
class TGNodeIndex {
public:
TGNodeIndex( SGGeod g ) {
@ -172,6 +177,10 @@ private:
unsigned int ordered_index;
};
#ifdef _MSC_VER
#pragma warning(pop)
#endif
inline bool operator == (const TGNodeIndex& a, const TGNodeIndex& b) {
return (( fabs(a.geod.getLongitudeDeg() - b.geod.getLongitudeDeg()) < PROXIMITY_EPSILON ) &&
( fabs(a.geod.getLatitudeDeg() - b.geod.getLatitudeDeg()) < PROXIMITY_EPSILON ));

View file

@ -14,6 +14,11 @@
// same bucket.
// We could experiment with making it so 1 point per bucket, but I'm nervous...
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable: 4309)
#endif
#define PROXIMITY_MULTIPLIER (100000)
#define PROXIMITY_EPSILON ((double) 1 / (double)( PROXIMITY_MULTIPLIER * 10 ) )
@ -67,6 +72,10 @@ private:
unsigned int ordered_index;
};
#ifdef _MSC_VER
#pragma warning(pop)
#endif
inline bool operator == (const SGVec2fIndex& a, const SGVec2fIndex& b) {
return (( fabs(a.vec.x() - b.vec.x()) < PROXIMITY_EPSILON ) &&
( fabs(a.vec.y() - b.vec.y()) < PROXIMITY_EPSILON ));

View file

@ -14,6 +14,11 @@
// same bucket.
// We could experiment with making it so 1 point per bucket, but I'm nervous...
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable: 4309)
#endif
#define PROXIMITY_MULTIPLIER (100000)
#define PROXIMITY_EPSILON ((double) 1 / (double)( PROXIMITY_MULTIPLIER * 10 ) )
@ -68,6 +73,10 @@ private:
unsigned int ordered_index;
};
#ifdef _MSC_VER
#pragma warning(pop)
#endif
inline bool operator == (const SGVec3fIndex& a, const SGVec3fIndex& b) {
return (( fabs(a.vec.x() - b.vec.x()) < PROXIMITY_EPSILON ) &&
( fabs(a.vec.y() - b.vec.y()) < PROXIMITY_EPSILON ) &&