aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlatmush <Flatmush@gmail.com>2012-07-02 16:07:50 +0000
committerFlatmush <Flatmush@gmail.com>2012-07-02 16:07:50 +0000
commitc2a48b8910ce5a316314df255c7d3746aa499d9b (patch)
treea87f1c0c8c41bae10aca0738124216b1d6868530
parente490cce6b0be8b5ca4f85135ee8a928d0e6caf49 (diff)
Added a patch to make operator results constant in the C++ interface as suggested in Issue 15.
-rw-r--r--libfixmath/fix16.hpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/libfixmath/fix16.hpp b/libfixmath/fix16.hpp
index 26863fe..03d7d75 100644
--- a/libfixmath/fix16.hpp
+++ b/libfixmath/fix16.hpp
@@ -12,10 +12,10 @@ class Fix16 {
Fix16(const double inValue) { value = fix16_from_dbl(inValue); }
Fix16(const int16_t inValue) { value = fix16_from_int(inValue); }
- operator fix16_t() { return value; }
- operator double() { return fix16_to_dbl(value); }
- operator float() { return fix16_to_float(value); }
- operator int16_t() { return fix16_to_int(value); }
+ operator fix16_t() const { return value; }
+ operator double() const { return fix16_to_dbl(value); }
+ operator float() const { return fix16_to_float(value); }
+ operator int16_t() const { return fix16_to_int(value); }
Fix16 & operator=(const Fix16 &rhs) { value = rhs.value; return *this; }
Fix16 & operator=(const fix16_t rhs) { value = rhs; return *this; }