Browse Source

restore assertions

David Rose 23 years ago
parent
commit
d3c5b53c40

+ 4 - 8
panda/src/linmath/lmatrix3_src.I

@@ -237,8 +237,7 @@ get_col2(int col) const {
 ////////////////////////////////////////////////////////////////////
 INLINE_LINMATH FLOATTYPE &FLOATNAME(LMatrix3)::
 operator () (int row, int col) {
-//  nassertr(row >= 0 && row < 3, _m.data[0]);
-//  nassertr(col >= 0 && col < 3, _m.data[0]);
+  nassertr(row >= 0 && row < 3 && col >= 0 && col < 3, _m.data[0]);
   return _m.data[row * 3 + col];
 }
 
@@ -249,8 +248,7 @@ operator () (int row, int col) {
 ////////////////////////////////////////////////////////////////////
 INLINE_LINMATH FLOATTYPE FLOATNAME(LMatrix3)::
 operator () (int row, int col) const {
-//  nassertr(row >= 0 && row < 3, 0.0f);
-//  nassertr(col >= 0 && col < 3, 0.0f);
+  nassertr(row >= 0 && row < 3 && col >= 0 && col < 3, 0.0);
   return _m.data[row * 3 + col];
 }
 
@@ -275,8 +273,7 @@ is_nan() const {
 ////////////////////////////////////////////////////////////////////
 INLINE_LINMATH FLOATTYPE FLOATNAME(LMatrix3)::
 get_cell(int row, int col) const {
-//  nassertr(row >= 0 && row < 3, 0.0f);
-//  nassertr(col >= 0 && col < 3, 0.0f);
+  nassertr(row >= 0 && row < 3 && col >= 0 && col < 3, 0.0);
   return _m.data[row * 3 + col];
 }
 
@@ -287,8 +284,7 @@ get_cell(int row, int col) const {
 ////////////////////////////////////////////////////////////////////
 INLINE_LINMATH void FLOATNAME(LMatrix3)::
 set_cell(int row, int col, FLOATTYPE value) {
-//  nassertv(row >= 0 && row < 3);
-//  nassertv(col >= 0 && col < 3);
+  nassertv(row >= 0 && row < 3 && col >= 0 && col < 3);
   _m.data[row * 3 + col] = value;
 }
 

+ 4 - 8
panda/src/linmath/lmatrix4_src.I

@@ -388,8 +388,7 @@ get_col3(int col) const {
 ////////////////////////////////////////////////////////////////////
 INLINE_LINMATH FLOATTYPE &FLOATNAME(LMatrix4)::
 operator () (int row, int col) {
-  //  nassertr(row >= 0 && row < 4, _m.data[0]);
-  //  nassertr(col >= 0 && col < 4, _m.data[0]);
+  nassertr(row >= 0 && row < 4 && col >= 0 && col < 4, _m.data[0]);
   return _m.data[row * 4 + col];
 }
 
@@ -400,8 +399,7 @@ operator () (int row, int col) {
 ////////////////////////////////////////////////////////////////////
 INLINE_LINMATH FLOATTYPE FLOATNAME(LMatrix4)::
 operator () (int row, int col) const {
-  //  nassertr(row >= 0 && row < 4, 0.0f);
-  //  nassertr(col >= 0 && col < 4, 0.0f);
+  nassertr(row >= 0 && row < 4 && col >= 0 && col < 4, 0.0f);
   return _m.data[row * 4 + col];
 }
 
@@ -427,8 +425,7 @@ is_nan() const {
 ////////////////////////////////////////////////////////////////////
 INLINE_LINMATH FLOATTYPE FLOATNAME(LMatrix4)::
 get_cell(int row, int col) const {
-//  nassertr(row >= 0 && row < 4, 0.0f);
-//  nassertr(col >= 0 && col < 4, 0.0f);
+  nassertr(row >= 0 && row < 4 && col >= 0 && col < 4, 0.0f);
   return _m.data[row * 4 + col];
 }
 
@@ -439,8 +436,7 @@ get_cell(int row, int col) const {
 ////////////////////////////////////////////////////////////////////
 INLINE_LINMATH void FLOATNAME(LMatrix4)::
 set_cell(int row, int col, FLOATTYPE value) {
-//  nassertv(row >= 0 && row < 4);
-//  nassertv(col >= 0 && col < 4);
+  nassertv(row >= 0 && row < 4 && col >= 0 && col < 4);
   _m.data[row * 4 + col] = value;
 }
 

+ 4 - 4
panda/src/linmath/lvecBase2_src.I

@@ -130,7 +130,7 @@ INLINE_LINMATH FLOATNAME(LVecBase2)::
 ////////////////////////////////////////////////////////////////////
 INLINE_LINMATH FLOATTYPE FLOATNAME(LVecBase2)::
 operator [](int i) const {
-  //  nassertr(i >= 0 && i < 2, 0);
+  nassertr(i >= 0 && i < 2, 0.0);
   return _v.data[i];
 }
 
@@ -141,7 +141,7 @@ operator [](int i) const {
 ////////////////////////////////////////////////////////////////////
 INLINE_LINMATH FLOATTYPE &FLOATNAME(LVecBase2)::
 operator [](int i) {
-  //  nassertr(i >= 0 && i < 2, _v.v._0);
+  nassertr(i >= 0 && i < 2, _v.data[0]);
   return _v.data[i];
 }
 
@@ -163,7 +163,7 @@ is_nan() const {
 ////////////////////////////////////////////////////////////////////
 INLINE_LINMATH FLOATTYPE FLOATNAME(LVecBase2)::
 get_cell(int i) const {
-//  nassertr(i >= 0 && i < 2, 0);
+  nassertr(i >= 0 && i < 2, 0.0);
   return _v.data[i];
 }
 
@@ -194,7 +194,7 @@ get_y() const {
 ////////////////////////////////////////////////////////////////////
 INLINE_LINMATH void FLOATNAME(LVecBase2)::
 set_cell(int i, FLOATTYPE value) {
-//  nassertv(i >= 0 && i < 2);
+  nassertv(i >= 0 && i < 2);
   _v.data[i] = value;
 }
 

+ 4 - 4
panda/src/linmath/lvecBase3_src.I

@@ -142,7 +142,7 @@ INLINE_LINMATH FLOATNAME(LVecBase3)::
 ////////////////////////////////////////////////////////////////////
 INLINE_LINMATH FLOATTYPE FLOATNAME(LVecBase3)::
 operator [](int i) const {
-  //nassertr(i >= 0 && i < 3, 0);
+  nassertr(i >= 0 && i < 3, 0.0);
   return _v.data[i];
 }
 
@@ -153,7 +153,7 @@ operator [](int i) const {
 ////////////////////////////////////////////////////////////////////
 INLINE_LINMATH FLOATTYPE &FLOATNAME(LVecBase3)::
 operator [](int i) {
-  //nassertr(i >= 0 && i < 3, _v.v._0);
+  nassertr(i >= 0 && i < 3, _v.data[0]);
   return _v.data[i];
 }
 
@@ -175,7 +175,7 @@ is_nan() const {
 ////////////////////////////////////////////////////////////////////
 INLINE_LINMATH FLOATTYPE FLOATNAME(LVecBase3)::
 get_cell(int i) const {
-//  nassertr(i >= 0 && i < 3, 0);
+  nassertr(i >= 0 && i < 3, 0);
   return _v.data[i];
 }
 
@@ -216,7 +216,7 @@ get_z() const {
 ////////////////////////////////////////////////////////////////////
 INLINE_LINMATH void FLOATNAME(LVecBase3)::
 set_cell(int i, FLOATTYPE value) {
-//  nassertv(i >= 0 && i < 3);
+  nassertv(i >= 0 && i < 3);
   _v.data[i] = value;
 }
 

+ 4 - 4
panda/src/linmath/lvecBase4_src.I

@@ -156,7 +156,7 @@ unit_w() {
 ////////////////////////////////////////////////////////////////////
 INLINE_LINMATH FLOATTYPE FLOATNAME(LVecBase4)::
 operator [](int i) const {
-  //  nassertr(i >= 0 && i < 4, 0);
+  nassertr(i >= 0 && i < 4, 0.0);
   return _v.data[i];
 }
 
@@ -167,7 +167,7 @@ operator [](int i) const {
 ////////////////////////////////////////////////////////////////////
 INLINE_LINMATH FLOATTYPE &FLOATNAME(LVecBase4)::
 operator [](int i) {
-  //  nassertr(i >= 0 && i < 4, _v.v._0);
+  nassertr(i >= 0 && i < 4, _v.data[0]);
   return _v.data[i];
 }
 
@@ -189,7 +189,7 @@ is_nan() const {
 ////////////////////////////////////////////////////////////////////
 INLINE_LINMATH FLOATTYPE FLOATNAME(LVecBase4)::
 get_cell(int i) const {
-//  nassertr(i >= 0 && i < 4, 0);
+  nassertr(i >= 0 && i < 4, 0.0);
   return _v.data[i];
 }
 
@@ -240,7 +240,7 @@ get_w() const {
 ////////////////////////////////////////////////////////////////////
 INLINE_LINMATH void FLOATNAME(LVecBase4)::
 set_cell(int i, FLOATTYPE value) {
-//  nassertv(i >= 0 && i < 4);
+  nassertv(i >= 0 && i < 4);
   _v.data[i] = value;
 }