From cb66a51bbc2b80cbdd8d41c60bd8ef6b793d9058 Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 18 Dec 2014 16:58:03 -0500 Subject: [PATCH] fmin and fmax should be const methods --- panda/src/linmath/lvecBase2_src.I | 4 ++-- panda/src/linmath/lvecBase2_src.h | 4 ++-- panda/src/linmath/lvecBase3_src.I | 4 ++-- panda/src/linmath/lvecBase3_src.h | 4 ++-- panda/src/linmath/lvecBase4_src.I | 4 ++-- panda/src/linmath/lvecBase4_src.h | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/panda/src/linmath/lvecBase2_src.I b/panda/src/linmath/lvecBase2_src.I index 0cd528ac5d..9b453102a1 100644 --- a/panda/src/linmath/lvecBase2_src.I +++ b/panda/src/linmath/lvecBase2_src.I @@ -754,7 +754,7 @@ componentwise_mult(const FLOATNAME(LVecBase2) &other) { // Description: //////////////////////////////////////////////////////////////////// INLINE_LINMATH FLOATNAME(LVecBase2) FLOATNAME(LVecBase2):: -fmax(const FLOATNAME(LVecBase2) &other) { +fmax(const FLOATNAME(LVecBase2) &other) const { TAU_PROFILE("LVecBase2::fmax()", " ", TAU_USER); return FLOATNAME(LVecBase2)(_v(0) > other._v(0) ? _v(0) : other._v(0), _v(1) > other._v(1) ? _v(1) : other._v(1)); @@ -766,7 +766,7 @@ fmax(const FLOATNAME(LVecBase2) &other) { // Description: //////////////////////////////////////////////////////////////////// INLINE_LINMATH FLOATNAME(LVecBase2) FLOATNAME(LVecBase2):: -fmin(const FLOATNAME(LVecBase2) &other) { +fmin(const FLOATNAME(LVecBase2) &other) const { TAU_PROFILE("LVecBase2::fmin()", " ", TAU_USER); return FLOATNAME(LVecBase2)(_v(0) < other._v(0) ? _v(0) : other._v(0), _v(1) < other._v(1) ? _v(1) : other._v(1)); diff --git a/panda/src/linmath/lvecBase2_src.h b/panda/src/linmath/lvecBase2_src.h index dcb0043d07..6cba9eea6e 100644 --- a/panda/src/linmath/lvecBase2_src.h +++ b/panda/src/linmath/lvecBase2_src.h @@ -126,8 +126,8 @@ PUBLISHED: EXTENSION(INLINE_LINMATH FLOATNAME(LVecBase2) __pow__(FLOATTYPE exponent) const); EXTENSION(INLINE_LINMATH PyObject *__ipow__(PyObject *self, FLOATTYPE exponent)); - INLINE_LINMATH FLOATNAME(LVecBase2) fmax(const FLOATNAME(LVecBase2) &other); - INLINE_LINMATH FLOATNAME(LVecBase2) fmin(const FLOATNAME(LVecBase2) &other); + INLINE_LINMATH FLOATNAME(LVecBase2) fmax(const FLOATNAME(LVecBase2) &other) const; + INLINE_LINMATH FLOATNAME(LVecBase2) fmin(const FLOATNAME(LVecBase2) &other) const; INLINE_LINMATH bool almost_equal(const FLOATNAME(LVecBase2) &other, FLOATTYPE threshold) const; diff --git a/panda/src/linmath/lvecBase3_src.I b/panda/src/linmath/lvecBase3_src.I index 3cd3207242..31e24b2801 100644 --- a/panda/src/linmath/lvecBase3_src.I +++ b/panda/src/linmath/lvecBase3_src.I @@ -931,7 +931,7 @@ componentwise_mult(const FLOATNAME(LVecBase3) &other) { // Description: //////////////////////////////////////////////////////////////////// INLINE_LINMATH FLOATNAME(LVecBase3) FLOATNAME(LVecBase3):: -fmax(const FLOATNAME(LVecBase3) &other) { +fmax(const FLOATNAME(LVecBase3) &other) const { TAU_PROFILE("LVecBase3::fmax()", " ", TAU_USER); return FLOATNAME(LVecBase3)(_v(0) > other._v(0) ? _v(0) : other._v(0), _v(1) > other._v(1) ? _v(1) : other._v(1), @@ -944,7 +944,7 @@ fmax(const FLOATNAME(LVecBase3) &other) { // Description: //////////////////////////////////////////////////////////////////// INLINE_LINMATH FLOATNAME(LVecBase3) FLOATNAME(LVecBase3):: -fmin(const FLOATNAME(LVecBase3) &other) { +fmin(const FLOATNAME(LVecBase3) &other) const { TAU_PROFILE("LVecBase3::fmin()", " ", TAU_USER); return FLOATNAME(LVecBase3)(_v(0) < other._v(0) ? _v(0) : other._v(0), _v(1) < other._v(1) ? _v(1) : other._v(1), diff --git a/panda/src/linmath/lvecBase3_src.h b/panda/src/linmath/lvecBase3_src.h index 2de79d8ef9..ce7c09c011 100644 --- a/panda/src/linmath/lvecBase3_src.h +++ b/panda/src/linmath/lvecBase3_src.h @@ -139,8 +139,8 @@ PUBLISHED: EXTENSION(INLINE_LINMATH FLOATNAME(LVecBase3) __pow__(FLOATTYPE exponent) const); EXTENSION(INLINE_LINMATH PyObject *__ipow__(PyObject *self, FLOATTYPE exponent)); - INLINE_LINMATH FLOATNAME(LVecBase3) fmax(const FLOATNAME(LVecBase3) &other); - INLINE_LINMATH FLOATNAME(LVecBase3) fmin(const FLOATNAME(LVecBase3) &other); + INLINE_LINMATH FLOATNAME(LVecBase3) fmax(const FLOATNAME(LVecBase3) &other) const; + INLINE_LINMATH FLOATNAME(LVecBase3) fmin(const FLOATNAME(LVecBase3) &other) const; INLINE_LINMATH void cross_into(const FLOATNAME(LVecBase3) &other); diff --git a/panda/src/linmath/lvecBase4_src.I b/panda/src/linmath/lvecBase4_src.I index fb8871b5a0..db5923295e 100644 --- a/panda/src/linmath/lvecBase4_src.I +++ b/panda/src/linmath/lvecBase4_src.I @@ -915,7 +915,7 @@ componentwise_mult(const FLOATNAME(LVecBase4) &other) { // Description: //////////////////////////////////////////////////////////////////// INLINE_LINMATH FLOATNAME(LVecBase4) FLOATNAME(LVecBase4):: -fmax(const FLOATNAME(LVecBase4) &other) { +fmax(const FLOATNAME(LVecBase4) &other) const { TAU_PROFILE("LVecBase4::fmax()", " ", TAU_USER); return FLOATNAME(LVecBase4)(_v(0) > other._v(0) ? _v(0) : other._v(0), _v(1) > other._v(1) ? _v(1) : other._v(1), @@ -929,7 +929,7 @@ fmax(const FLOATNAME(LVecBase4) &other) { // Description: //////////////////////////////////////////////////////////////////// INLINE_LINMATH FLOATNAME(LVecBase4) FLOATNAME(LVecBase4):: -fmin(const FLOATNAME(LVecBase4) &other) { +fmin(const FLOATNAME(LVecBase4) &other) const { TAU_PROFILE("LVecBase4::fmin()", " ", TAU_USER); return FLOATNAME(LVecBase4)(_v(0) < other._v(0) ? _v(0) : other._v(0), _v(1) < other._v(1) ? _v(1) : other._v(1), diff --git a/panda/src/linmath/lvecBase4_src.h b/panda/src/linmath/lvecBase4_src.h index 8e49a0d2c8..e8b48ede7e 100644 --- a/panda/src/linmath/lvecBase4_src.h +++ b/panda/src/linmath/lvecBase4_src.h @@ -140,8 +140,8 @@ PUBLISHED: EXTENSION(INLINE_LINMATH FLOATNAME(LVecBase4) __pow__(FLOATTYPE exponent) const); EXTENSION(INLINE_LINMATH PyObject *__ipow__(PyObject *self, FLOATTYPE exponent)); - INLINE_LINMATH FLOATNAME(LVecBase4) fmax(const FLOATNAME(LVecBase4) &other); - INLINE_LINMATH FLOATNAME(LVecBase4) fmin(const FLOATNAME(LVecBase4) &other); + INLINE_LINMATH FLOATNAME(LVecBase4) fmax(const FLOATNAME(LVecBase4) &other) const; + INLINE_LINMATH FLOATNAME(LVecBase4) fmin(const FLOATNAME(LVecBase4) &other) const; INLINE_LINMATH bool almost_equal(const FLOATNAME(LVecBase4) &other, FLOATTYPE threshold) const;