summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkarsh Simha <akarsh@kde.org>2016-09-30 09:37:29 (GMT)
committerAkarsh Simha <akarsh@kde.org>2016-09-30 09:51:27 (GMT)
commitde5463654e306a8b52db46c7d76571afd2ba1213 (patch)
tree4c04a1be19a65a62861b3821c391b487a30b440a
parent531ec87a003e8a2c8c470696061c0ff4abc11502 (diff)
warnings--, fix compile error on Mac OS X.
Also somewhat better coding practices.
-rw-r--r--kstars/auxiliary/cachingdms.cpp17
-rw-r--r--kstars/auxiliary/cachingdms.h4
-rw-r--r--kstars/auxiliary/dms.h3
3 files changed, 24 insertions, 0 deletions
diff --git a/kstars/auxiliary/cachingdms.cpp b/kstars/auxiliary/cachingdms.cpp
index fbbd4f9..61d0880 100644
--- a/kstars/auxiliary/cachingdms.cpp
+++ b/kstars/auxiliary/cachingdms.cpp
@@ -187,6 +187,23 @@ CachingDms operator -(const CachingDms &a, const CachingDms &b) {
sinA * cosB - cosA * sinB,
cosA * cosB + sinA * sinB );
}
+
+CachingDms operator +(const dms &a, const CachingDms &b) {
+ return CachingDms( a + dms( b ) );
+}
+
+CachingDms operator -(const dms &a, const CachingDms &b) {
+ return CachingDms( a - dms( b ) );
+}
+
+CachingDms operator +(const CachingDms &a, const dms &b) {
+ return CachingDms( dms( a ) + b );
+}
+
+CachingDms operator -(const CachingDms &a, const dms &b) {
+ return CachingDms( dms( a ) - b );
+}
+
#undef sinA
#undef cosA
#undef sinB
diff --git a/kstars/auxiliary/cachingdms.h b/kstars/auxiliary/cachingdms.h
index 4cc4c55..67df6f0 100644
--- a/kstars/auxiliary/cachingdms.h
+++ b/kstars/auxiliary/cachingdms.h
@@ -233,6 +233,10 @@ private:
*/
friend CachingDms operator +(const CachingDms &, const CachingDms &);
friend CachingDms operator -(const CachingDms &, const CachingDms &);
+ friend CachingDms operator +(const dms &a, const CachingDms &b);
+ friend CachingDms operator -(const dms &a, const CachingDms &b);
+ friend CachingDms operator +(const CachingDms &a, const dms &b);
+ friend CachingDms operator -(const CachingDms &a, const dms &b);
#ifdef COUNT_DMS_SINCOS_CALLS
private:
diff --git a/kstars/auxiliary/dms.h b/kstars/auxiliary/dms.h
index bbd657b..10aad72 100644
--- a/kstars/auxiliary/dms.h
+++ b/kstars/auxiliary/dms.h
@@ -59,6 +59,9 @@ public:
#endif
}
+ /** Empty virtual destructor */
+ virtual ~dms() {}
+
/** @short Set the floating-point value of the angle according to the four integer arguments.
* @param d degree portion of angle (int). Defaults to zero.
* @param m arcminute portion of angle (int). Defaults to zero.