Part: replace PyObject_Not with Base::asBoolean
This commit is contained in:
@@ -1145,7 +1145,7 @@ PyObject* BSplineCurve2dPy::buildFromPolesMultsKnots(PyObject *args, PyObject *k
|
||||
Standard_Integer index = 1;
|
||||
for (Py::Sequence::iterator it = multssq.begin(); it != multssq.end() && index <= occmults.Length(); ++it) {
|
||||
Py::Long mult(*it);
|
||||
if (index < occmults.Length() || PyObject_Not(periodic)) {
|
||||
if (index < occmults.Length() || !Base::asBoolean(periodic)) {
|
||||
sum_of_mults += (int)mult; //sum up the mults to compare them against the number of poles later
|
||||
}
|
||||
occmults(index++) = mult;
|
||||
@@ -1155,7 +1155,7 @@ PyObject* BSplineCurve2dPy::buildFromPolesMultsKnots(PyObject *args, PyObject *k
|
||||
for (int i=1; i<=occmults.Length(); i++){
|
||||
occmults.SetValue(i,1);
|
||||
}
|
||||
if (PyObject_Not(periodic) && occmults.Length() > 0) {
|
||||
if (!Base::asBoolean(periodic) && occmults.Length() > 0) {
|
||||
occmults.SetValue(1, degree+1);
|
||||
occmults.SetValue(occmults.Length(), degree+1);
|
||||
sum_of_mults = occmults.Length()+2*degree;
|
||||
@@ -1194,7 +1194,7 @@ PyObject* BSplineCurve2dPy::buildFromPolesMultsKnots(PyObject *args, PyObject *k
|
||||
}
|
||||
// check if the number of poles matches the sum of mults
|
||||
if (((Base::asBoolean(periodic)) && sum_of_mults != number_of_poles) ||
|
||||
((PyObject_Not(periodic) ? true : false) && sum_of_mults - degree -1 != number_of_poles)) {
|
||||
(!Base::asBoolean(periodic) && sum_of_mults - degree -1 != number_of_poles)) {
|
||||
Standard_Failure::Raise("number of poles and sum of mults mismatch");
|
||||
return(nullptr);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user