浏览代码

Remove the treacherous NDEBUG markers

rdb 14 年之前
父节点
当前提交
99ef646132

+ 0 - 2
panda/src/linmath/lpoint2_ext_src.I

@@ -36,14 +36,12 @@ python_repr, ostream &out, const string &class_name) {
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE PyObject *EXT_CONST_METHOD_ARGS(FLOATNAME(LPoint2),
 INLINE PyObject *EXT_CONST_METHOD_ARGS(FLOATNAME(LPoint2),
 __getattr__, const string &attr_name) {
 __getattr__, const string &attr_name) {
-#ifndef NDEBUG
   // Validate the attribute name.
   // Validate the attribute name.
   for (string::const_iterator it = attr_name.begin(); it < attr_name.end(); it++) {
   for (string::const_iterator it = attr_name.begin(); it < attr_name.end(); it++) {
     if (*it != 'x' && *it != 'y') {
     if (*it != 'x' && *it != 'y') {
       return NULL;
       return NULL;
     }
     }
   }
   }
-#endif
 
 
   if (attr_name.size() == 1) {
   if (attr_name.size() == 1) {
     return PyFloat_FromDouble(this->_v.data[attr_name[0] - 'x']);
     return PyFloat_FromDouble(this->_v.data[attr_name[0] - 'x']);

+ 1 - 3
panda/src/linmath/lpoint3_ext_src.I

@@ -25,7 +25,7 @@ IMPORT_THIS struct Dtool_PyTypedObject FLOATNAME(Dtool_LPoint3);
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE void EXT_CONST_METHOD_ARGS(FLOATNAME(LPoint3),
 INLINE void EXT_CONST_METHOD_ARGS(FLOATNAME(LPoint3),
 python_repr, ostream &out, const string &class_name) {
 python_repr, ostream &out, const string &class_name) {
-  out << class_name << "(" 
+  out << class_name << "("
       << MAYBE_ZERO(this->_v.v._0) << ", "
       << MAYBE_ZERO(this->_v.v._0) << ", "
       << MAYBE_ZERO(this->_v.v._1) << ", "
       << MAYBE_ZERO(this->_v.v._1) << ", "
       << MAYBE_ZERO(this->_v.v._2) << ")";
       << MAYBE_ZERO(this->_v.v._2) << ")";
@@ -38,14 +38,12 @@ python_repr, ostream &out, const string &class_name) {
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 PyObject *EXT_CONST_METHOD_ARGS(FLOATNAME(LPoint3),
 PyObject *EXT_CONST_METHOD_ARGS(FLOATNAME(LPoint3),
 __getattr__, const string &attr_name) {
 __getattr__, const string &attr_name) {
-#ifndef NDEBUG
   // Validate the attribute name.
   // Validate the attribute name.
   for (string::const_iterator it = attr_name.begin(); it < attr_name.end(); it++) {
   for (string::const_iterator it = attr_name.begin(); it < attr_name.end(); it++) {
     if (*it < 'x' || *it > 'z') {
     if (*it < 'x' || *it > 'z') {
       return NULL;
       return NULL;
     }
     }
   }
   }
-#endif
 
 
   if (attr_name.size() == 1) {
   if (attr_name.size() == 1) {
     return PyFloat_FromDouble(this->_v.data[attr_name[0] - 'x']);
     return PyFloat_FromDouble(this->_v.data[attr_name[0] - 'x']);

+ 1 - 3
panda/src/linmath/lpoint4_ext_src.I

@@ -26,7 +26,7 @@ IMPORT_THIS struct Dtool_PyTypedObject FLOATNAME(Dtool_LPoint4);
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE void EXT_CONST_METHOD_ARGS(FLOATNAME(LPoint4),
 INLINE void EXT_CONST_METHOD_ARGS(FLOATNAME(LPoint4),
 python_repr, ostream &out, const string &class_name) {
 python_repr, ostream &out, const string &class_name) {
-  out << class_name << "(" 
+  out << class_name << "("
       << MAYBE_ZERO(this->_v.v._0) << ", "
       << MAYBE_ZERO(this->_v.v._0) << ", "
       << MAYBE_ZERO(this->_v.v._1) << ", "
       << MAYBE_ZERO(this->_v.v._1) << ", "
       << MAYBE_ZERO(this->_v.v._2) << ", "
       << MAYBE_ZERO(this->_v.v._2) << ", "
@@ -40,14 +40,12 @@ python_repr, ostream &out, const string &class_name) {
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE PyObject *EXT_CONST_METHOD_ARGS(FLOATNAME(LPoint4),
 INLINE PyObject *EXT_CONST_METHOD_ARGS(FLOATNAME(LPoint4),
 __getattr__, const string &attr_name) {
 __getattr__, const string &attr_name) {
-#ifndef NDEBUG
   // Validate the attribute name.
   // Validate the attribute name.
   for (string::const_iterator it = attr_name.begin(); it < attr_name.end(); it++) {
   for (string::const_iterator it = attr_name.begin(); it < attr_name.end(); it++) {
     if (*it < 'w' || *it > 'z') {
     if (*it < 'w' || *it > 'z') {
       return NULL;
       return NULL;
     }
     }
   }
   }
-#endif
 
 
   if (attr_name.size() == 1) {
   if (attr_name.size() == 1) {
     if (attr_name[0] == 'w') {
     if (attr_name[0] == 'w') {

+ 4 - 6
panda/src/linmath/lvecBase2_ext_src.I

@@ -57,7 +57,7 @@ __reduce__, PyObject *self) {
     return NULL;
     return NULL;
   }
   }
 
 
-  PyObject *result = Py_BuildValue("(O(ff))", this_class, 
+  PyObject *result = Py_BuildValue("(O(ff))", this_class,
                                    (*this)[0], (*this)[1]);
                                    (*this)[0], (*this)[1]);
   Py_DECREF(this_class);
   Py_DECREF(this_class);
   return result;
   return result;
@@ -70,14 +70,12 @@ __reduce__, PyObject *self) {
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 PyObject *EXT_CONST_METHOD_ARGS(FLOATNAME(LVecBase2),
 PyObject *EXT_CONST_METHOD_ARGS(FLOATNAME(LVecBase2),
 __getattr__, const string &attr_name) {
 __getattr__, const string &attr_name) {
-#ifndef NDEBUG
   // Validate the attribute name.
   // Validate the attribute name.
   for (string::const_iterator it = attr_name.begin(); it < attr_name.end(); it++) {
   for (string::const_iterator it = attr_name.begin(); it < attr_name.end(); it++) {
     if (*it != 'x' && *it != 'y') {
     if (*it != 'x' && *it != 'y') {
       return NULL;
       return NULL;
     }
     }
   }
   }
-#endif
 
 
   if (attr_name.size() == 1) {
   if (attr_name.size() == 1) {
     return PyFloat_FromDouble(this->_v.data[attr_name[0] - 'x']);
     return PyFloat_FromDouble(this->_v.data[attr_name[0] - 'x']);
@@ -118,14 +116,14 @@ __setattr__, PyObject *self, const string &attr_name, PyObject *assign) {
     // Whoosh.
     // Whoosh.
     PyObject* fast = PySequence_Fast(assign, "");
     PyObject* fast = PySequence_Fast(assign, "");
     nassertr(fast != NULL, -1);
     nassertr(fast != NULL, -1);
-    
+
     // Let's be strict about size mismatches, to prevent user error.
     // Let's be strict about size mismatches, to prevent user error.
     if (PySequence_Fast_GET_SIZE(fast) != attr_name.size()) {
     if (PySequence_Fast_GET_SIZE(fast) != attr_name.size()) {
       PyErr_SetString(PyExc_ValueError, "length mismatch");
       PyErr_SetString(PyExc_ValueError, "length mismatch");
       Py_DECREF(fast);
       Py_DECREF(fast);
       return -1;
       return -1;
     }
     }
-    
+
     // Get a pointer to the items, iterate over it and
     // Get a pointer to the items, iterate over it and
     // perform our magic assignment.  Fast fast.  Oh yeah.
     // perform our magic assignment.  Fast fast.  Oh yeah.
     PyObject** items = PySequence_Fast_ITEMS(fast);
     PyObject** items = PySequence_Fast_ITEMS(fast);
@@ -167,7 +165,7 @@ __setattr__, PyObject *self, const string &attr_name, PyObject *assign) {
     // and assign the floating-point value to every one of them.
     // and assign the floating-point value to every one of them.
     for (string::const_iterator it = attr_name.begin(); it < attr_name.end(); it++) {
     for (string::const_iterator it = attr_name.begin(); it < attr_name.end(); it++) {
       this->_v.data[(*it) - 'x'] = value;
       this->_v.data[(*it) - 'x'] = value;
-    } 
+    }
   }
   }
 
 
   return 0;
   return 0;

+ 5 - 7
panda/src/linmath/lvecBase3_ext_src.I

@@ -36,7 +36,7 @@ __setitem__, int i, FLOATTYPE v) {
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE void EXT_CONST_METHOD_ARGS(FLOATNAME(LVecBase3),
 INLINE void EXT_CONST_METHOD_ARGS(FLOATNAME(LVecBase3),
 python_repr, ostream &out, const string &class_name) {
 python_repr, ostream &out, const string &class_name) {
-  out << class_name << "(" 
+  out << class_name << "("
       << MAYBE_ZERO(this->_v.v._0) << ", "
       << MAYBE_ZERO(this->_v.v._0) << ", "
       << MAYBE_ZERO(this->_v.v._1) << ", "
       << MAYBE_ZERO(this->_v.v._1) << ", "
       << MAYBE_ZERO(this->_v.v._2) << ")";
       << MAYBE_ZERO(this->_v.v._2) << ")";
@@ -59,7 +59,7 @@ __reduce__, PyObject *self) {
     return NULL;
     return NULL;
   }
   }
 
 
-  PyObject *result = Py_BuildValue("(O(fff))", this_class, 
+  PyObject *result = Py_BuildValue("(O(fff))", this_class,
                                    (*this)[0], (*this)[1], (*this)[2]);
                                    (*this)[0], (*this)[1], (*this)[2]);
   Py_DECREF(this_class);
   Py_DECREF(this_class);
   return result;
   return result;
@@ -72,14 +72,12 @@ __reduce__, PyObject *self) {
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 PyObject *EXT_CONST_METHOD_ARGS(FLOATNAME(LVecBase3),
 PyObject *EXT_CONST_METHOD_ARGS(FLOATNAME(LVecBase3),
 __getattr__, const string &attr_name) {
 __getattr__, const string &attr_name) {
-#ifndef NDEBUG
   // Validate the attribute name.
   // Validate the attribute name.
   for (string::const_iterator it = attr_name.begin(); it < attr_name.end(); it++) {
   for (string::const_iterator it = attr_name.begin(); it < attr_name.end(); it++) {
     if (*it < 'x' || *it > 'z') {
     if (*it < 'x' || *it > 'z') {
       return NULL;
       return NULL;
     }
     }
   }
   }
-#endif
 
 
   if (attr_name.size() == 1) {
   if (attr_name.size() == 1) {
     return PyFloat_FromDouble(this->_v.data[attr_name[0] - 'x']);
     return PyFloat_FromDouble(this->_v.data[attr_name[0] - 'x']);
@@ -123,14 +121,14 @@ __setattr__, PyObject *self, const string &attr_name, PyObject *assign) {
     // Whoosh.
     // Whoosh.
     PyObject* fast = PySequence_Fast(assign, "");
     PyObject* fast = PySequence_Fast(assign, "");
     nassertr(fast != NULL, -1);
     nassertr(fast != NULL, -1);
-    
+
     // Let's be strict about size mismatches, to prevent user error.
     // Let's be strict about size mismatches, to prevent user error.
     if (PySequence_Fast_GET_SIZE(fast) != attr_name.size()) {
     if (PySequence_Fast_GET_SIZE(fast) != attr_name.size()) {
       PyErr_SetString(PyExc_ValueError, "length mismatch");
       PyErr_SetString(PyExc_ValueError, "length mismatch");
       Py_DECREF(fast);
       Py_DECREF(fast);
       return -1;
       return -1;
     }
     }
-    
+
     // Get a pointer to the items, iterate over it and
     // Get a pointer to the items, iterate over it and
     // perform our magic assignment.  Fast fast.  Oh yeah.
     // perform our magic assignment.  Fast fast.  Oh yeah.
     PyObject** items = PySequence_Fast_ITEMS(fast);
     PyObject** items = PySequence_Fast_ITEMS(fast);
@@ -172,7 +170,7 @@ __setattr__, PyObject *self, const string &attr_name, PyObject *assign) {
     // and assign the floating-point value to every one of them.
     // and assign the floating-point value to every one of them.
     for (string::const_iterator it = attr_name.begin(); it < attr_name.end(); it++) {
     for (string::const_iterator it = attr_name.begin(); it < attr_name.end(); it++) {
       this->_v.data[(*it) - 'x'] = value;
       this->_v.data[(*it) - 'x'] = value;
-    } 
+    }
   }
   }
 
 
   return 0;
   return 0;

+ 5 - 7
panda/src/linmath/lvecBase4_ext_src.I

@@ -37,7 +37,7 @@ __setitem__, int i, FLOATTYPE v) {
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE void EXT_CONST_METHOD_ARGS(FLOATNAME(LVecBase4),
 INLINE void EXT_CONST_METHOD_ARGS(FLOATNAME(LVecBase4),
 python_repr, ostream &out, const string &class_name) {
 python_repr, ostream &out, const string &class_name) {
-  out << class_name << "(" 
+  out << class_name << "("
       << MAYBE_ZERO(this->_v.v._0) << ", "
       << MAYBE_ZERO(this->_v.v._0) << ", "
       << MAYBE_ZERO(this->_v.v._1) << ", "
       << MAYBE_ZERO(this->_v.v._1) << ", "
       << MAYBE_ZERO(this->_v.v._2) << ", "
       << MAYBE_ZERO(this->_v.v._2) << ", "
@@ -61,7 +61,7 @@ __reduce__, PyObject *self) {
     return NULL;
     return NULL;
   }
   }
 
 
-  PyObject *result = Py_BuildValue("(O(ffff))", this_class, 
+  PyObject *result = Py_BuildValue("(O(ffff))", this_class,
                                    (*this)[0], (*this)[1], (*this)[2], (*this)[3]);
                                    (*this)[0], (*this)[1], (*this)[2], (*this)[3]);
   Py_DECREF(this_class);
   Py_DECREF(this_class);
   return result;
   return result;
@@ -74,14 +74,12 @@ __reduce__, PyObject *self) {
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 PyObject *EXT_CONST_METHOD_ARGS(FLOATNAME(LVecBase4),
 PyObject *EXT_CONST_METHOD_ARGS(FLOATNAME(LVecBase4),
 __getattr__, const string &attr_name) {
 __getattr__, const string &attr_name) {
-#ifndef NDEBUG
   // Validate the attribute name.
   // Validate the attribute name.
   for (string::const_iterator it = attr_name.begin(); it < attr_name.end(); it++) {
   for (string::const_iterator it = attr_name.begin(); it < attr_name.end(); it++) {
     if (*it < 'w' || *it > 'z') {
     if (*it < 'w' || *it > 'z') {
       return NULL;
       return NULL;
     }
     }
   }
   }
-#endif
 
 
   if (attr_name.size() == 1) {
   if (attr_name.size() == 1) {
     if (attr_name[0] == 'w') {
     if (attr_name[0] == 'w') {
@@ -137,14 +135,14 @@ __setattr__, PyObject *self, const string &attr_name, PyObject *assign) {
     // Whoosh.
     // Whoosh.
     PyObject* fast = PySequence_Fast(assign, "");
     PyObject* fast = PySequence_Fast(assign, "");
     nassertr(fast != NULL, -1);
     nassertr(fast != NULL, -1);
-    
+
     // Let's be strict about size mismatches, to prevent user error.
     // Let's be strict about size mismatches, to prevent user error.
     if (PySequence_Fast_GET_SIZE(fast) != attr_name.size()) {
     if (PySequence_Fast_GET_SIZE(fast) != attr_name.size()) {
       PyErr_SetString(PyExc_ValueError, "length mismatch");
       PyErr_SetString(PyExc_ValueError, "length mismatch");
       Py_DECREF(fast);
       Py_DECREF(fast);
       return -1;
       return -1;
     }
     }
-    
+
     // Get a pointer to the items, iterate over it and
     // Get a pointer to the items, iterate over it and
     // perform our magic assignment.  Fast fast.  Oh yeah.
     // perform our magic assignment.  Fast fast.  Oh yeah.
     PyObject** items = PySequence_Fast_ITEMS(fast);
     PyObject** items = PySequence_Fast_ITEMS(fast);
@@ -186,7 +184,7 @@ __setattr__, PyObject *self, const string &attr_name, PyObject *assign) {
     // and assign the floating-point value to every one of them.
     // and assign the floating-point value to every one of them.
     for (string::const_iterator it = attr_name.begin(); it < attr_name.end(); it++) {
     for (string::const_iterator it = attr_name.begin(); it < attr_name.end(); it++) {
       this->_v.data[((*it) == 'w') ? 3 : (*it) - 'x'] = value;
       this->_v.data[((*it) == 'w') ? 3 : (*it) - 'x'] = value;
-    } 
+    }
   }
   }
 
 
   return 0;
   return 0;

+ 1 - 3
panda/src/linmath/lvector2_ext_src.I

@@ -24,7 +24,7 @@ IMPORT_THIS struct Dtool_PyTypedObject FLOATNAME(Dtool_LVector2);
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE void EXT_CONST_METHOD_ARGS(FLOATNAME(LVector2),
 INLINE void EXT_CONST_METHOD_ARGS(FLOATNAME(LVector2),
 python_repr, ostream &out, const string &class_name) {
 python_repr, ostream &out, const string &class_name) {
-  out << class_name << "(" 
+  out << class_name << "("
       << MAYBE_ZERO(this->_v.v._0) << ", "
       << MAYBE_ZERO(this->_v.v._0) << ", "
       << MAYBE_ZERO(this->_v.v._1) << ")";
       << MAYBE_ZERO(this->_v.v._1) << ")";
 }
 }
@@ -36,14 +36,12 @@ python_repr, ostream &out, const string &class_name) {
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE PyObject *EXT_CONST_METHOD_ARGS(FLOATNAME(LVector2),
 INLINE PyObject *EXT_CONST_METHOD_ARGS(FLOATNAME(LVector2),
 __getattr__, const string &attr_name) {
 __getattr__, const string &attr_name) {
-#ifndef NDEBUG
   // Validate the attribute name.
   // Validate the attribute name.
   for (string::const_iterator it = attr_name.begin(); it < attr_name.end(); it++) {
   for (string::const_iterator it = attr_name.begin(); it < attr_name.end(); it++) {
     if (*it != 'x' && *it != 'y') {
     if (*it != 'x' && *it != 'y') {
       return NULL;
       return NULL;
     }
     }
   }
   }
-#endif
 
 
   if (attr_name.size() == 1) {
   if (attr_name.size() == 1) {
     return PyFloat_FromDouble(this->_v.data[attr_name[0] - 'x']);
     return PyFloat_FromDouble(this->_v.data[attr_name[0] - 'x']);

+ 1 - 3
panda/src/linmath/lvector3_ext_src.I

@@ -25,7 +25,7 @@ IMPORT_THIS struct Dtool_PyTypedObject FLOATNAME(Dtool_LVector3);
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE void EXT_CONST_METHOD_ARGS(FLOATNAME(LVector3),
 INLINE void EXT_CONST_METHOD_ARGS(FLOATNAME(LVector3),
 python_repr, ostream &out, const string &class_name) {
 python_repr, ostream &out, const string &class_name) {
-  out << class_name << "(" 
+  out << class_name << "("
       << MAYBE_ZERO(this->_v.v._0) << ", "
       << MAYBE_ZERO(this->_v.v._0) << ", "
       << MAYBE_ZERO(this->_v.v._1) << ", "
       << MAYBE_ZERO(this->_v.v._1) << ", "
       << MAYBE_ZERO(this->_v.v._2) << ")";
       << MAYBE_ZERO(this->_v.v._2) << ")";
@@ -38,14 +38,12 @@ python_repr, ostream &out, const string &class_name) {
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE PyObject *EXT_CONST_METHOD_ARGS(FLOATNAME(LVector3),
 INLINE PyObject *EXT_CONST_METHOD_ARGS(FLOATNAME(LVector3),
 __getattr__, const string &attr_name) {
 __getattr__, const string &attr_name) {
-#ifndef NDEBUG
   // Validate the attribute name.
   // Validate the attribute name.
   for (string::const_iterator it = attr_name.begin(); it < attr_name.end(); it++) {
   for (string::const_iterator it = attr_name.begin(); it < attr_name.end(); it++) {
     if (*it < 'x' || *it > 'z') {
     if (*it < 'x' || *it > 'z') {
       return NULL;
       return NULL;
     }
     }
   }
   }
-#endif
 
 
   if (attr_name.size() == 1) {
   if (attr_name.size() == 1) {
     return PyFloat_FromDouble(this->_v.data[attr_name[0] - 'x']);
     return PyFloat_FromDouble(this->_v.data[attr_name[0] - 'x']);

+ 1 - 3
panda/src/linmath/lvector4_ext_src.I

@@ -26,7 +26,7 @@ IMPORT_THIS struct Dtool_PyTypedObject FLOATNAME(Dtool_LVector4);
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE void EXT_CONST_METHOD_ARGS(FLOATNAME(LVector4),
 INLINE void EXT_CONST_METHOD_ARGS(FLOATNAME(LVector4),
 python_repr, ostream &out, const string &class_name) {
 python_repr, ostream &out, const string &class_name) {
-  out << class_name << "(" 
+  out << class_name << "("
       << MAYBE_ZERO(this->_v.v._0) << ", "
       << MAYBE_ZERO(this->_v.v._0) << ", "
       << MAYBE_ZERO(this->_v.v._1) << ", "
       << MAYBE_ZERO(this->_v.v._1) << ", "
       << MAYBE_ZERO(this->_v.v._2) << ", "
       << MAYBE_ZERO(this->_v.v._2) << ", "
@@ -40,14 +40,12 @@ python_repr, ostream &out, const string &class_name) {
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE PyObject *EXT_CONST_METHOD_ARGS(FLOATNAME(LVector4),
 INLINE PyObject *EXT_CONST_METHOD_ARGS(FLOATNAME(LVector4),
 __getattr__, const string &attr_name) {
 __getattr__, const string &attr_name) {
-#ifndef NDEBUG
   // Validate the attribute name.
   // Validate the attribute name.
   for (string::const_iterator it = attr_name.begin(); it < attr_name.end(); it++) {
   for (string::const_iterator it = attr_name.begin(); it < attr_name.end(); it++) {
     if (*it < 'w' || *it > 'z') {
     if (*it < 'w' || *it > 'z') {
       return NULL;
       return NULL;
     }
     }
   }
   }
-#endif
 
 
   if (attr_name.size() == 1) {
   if (attr_name.size() == 1) {
     if (attr_name[0] == 'w') {
     if (attr_name[0] == 'w') {