Browse Source

fmin and fmax should be const methods

rdb 11 years ago
parent
commit
cb66a51bbc

+ 2 - 2
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));

+ 2 - 2
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;

+ 2 - 2
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),

+ 2 - 2
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);
 

+ 2 - 2
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),

+ 2 - 2
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;