diff --git a/src/App/FeaturePython.cpp b/src/App/FeaturePython.cpp index 9348ace12..95c859c87 100644 --- a/src/App/FeaturePython.cpp +++ b/src/App/FeaturePython.cpp @@ -54,7 +54,7 @@ DocumentObjectExecReturn *FeaturePythonImp::execute() Py::Object feature = static_cast(proxy)->getValue(); if (feature.hasAttr("__object__")) { Py::Callable method(feature.getAttr(std::string("execute"))); - Py::Tuple args(0); + Py::Tuple args; method.apply(args); } else { diff --git a/src/App/PropertyPythonObject.cpp b/src/App/PropertyPythonObject.cpp index df42a5a73..9d7a63161 100644 --- a/src/App/PropertyPythonObject.cpp +++ b/src/App/PropertyPythonObject.cpp @@ -89,7 +89,7 @@ std::string PropertyPythonObject::toString() const Py::Callable method(pickle.getAttr(std::string("dumps"))); Py::Object dump; if (this->object.hasAttr("__getstate__")) { - Py::Tuple args(0); + Py::Tuple args; Py::Callable state(this->object.getAttr("__getstate__")); dump = state.apply(args); } diff --git a/src/CXX/Python2/Objects.hxx b/src/CXX/Python2/Objects.hxx index 080e4a793..7ff75db5e 100644 --- a/src/CXX/Python2/Objects.hxx +++ b/src/CXX/Python2/Objects.hxx @@ -2314,7 +2314,7 @@ namespace Py } // New tuple of a given size - explicit Tuple (int size = 0) + explicit Tuple (sequence_index_type size = 0) { set(PyTuple_New (size), true); validate (); @@ -2372,7 +2372,7 @@ namespace Py { public: TupleN() - : Tuple( 0 ) + : Tuple( (sequence_index_type)0 ) { } @@ -2496,7 +2496,7 @@ namespace Py validate(); } // Creation at a fixed size - List (int size = 0) + List (sequence_index_type size = 0) { set(PyList_New (size), true); validate(); @@ -2512,7 +2512,7 @@ namespace Py // List from a sequence List (const Sequence& s): Sequence() { - int n = (int)s.length(); + sequence_index_type n = s.length(); set(PyList_New (n), true); validate(); for (sequence_index_type i=0; i < n; i++) @@ -3292,7 +3292,7 @@ namespace Py inline Object Object::callMemberFunction( const std::string &function_name ) const { Callable target( getAttr( function_name ) ); - Tuple args( 0 ); + Tuple args( (sequence_index_type)0 ); return target.apply( args ); } diff --git a/src/Gui/TaskView/TaskDialogPython.cpp b/src/Gui/TaskView/TaskDialogPython.cpp index 0ed4e96cf..4be4baf38 100644 --- a/src/Gui/TaskView/TaskDialogPython.cpp +++ b/src/Gui/TaskView/TaskDialogPython.cpp @@ -236,7 +236,7 @@ bool TaskWatcherPython::shouldShow() try { if (watcher.hasAttr(std::string("shouldShow"))) { Py::Callable method(watcher.getAttr(std::string("shouldShow"))); - Py::Tuple args(0); + Py::Tuple args; Py::Boolean ret(method.apply(args)); return (bool)ret; } @@ -326,7 +326,7 @@ void TaskDialogPython::open() try { if (dlg.hasAttr(std::string("open"))) { Py::Callable method(dlg.getAttr(std::string("open"))); - Py::Tuple args(0); + Py::Tuple args; method.apply(args); } } @@ -359,7 +359,7 @@ bool TaskDialogPython::accept() try { if (dlg.hasAttr(std::string("accept"))) { Py::Callable method(dlg.getAttr(std::string("accept"))); - Py::Tuple args(0); + Py::Tuple args; Py::Boolean ret(method.apply(args)); return (bool)ret; } @@ -378,7 +378,7 @@ bool TaskDialogPython::reject() try { if (dlg.hasAttr(std::string("reject"))) { Py::Callable method(dlg.getAttr(std::string("reject"))); - Py::Tuple args(0); + Py::Tuple args; Py::Boolean ret(method.apply(args)); return (bool)ret; } @@ -397,7 +397,7 @@ void TaskDialogPython::helpRequested() try { if (dlg.hasAttr(std::string("helpRequested"))) { Py::Callable method(dlg.getAttr(std::string("helpRequested"))); - Py::Tuple args(0); + Py::Tuple args; method.apply(args); } } @@ -413,7 +413,7 @@ QDialogButtonBox::StandardButtons TaskDialogPython::getStandardButtons(void) con try { if (dlg.hasAttr(std::string("getStandardButtons"))) { Py::Callable method(dlg.getAttr(std::string("getStandardButtons"))); - Py::Tuple args(0); + Py::Tuple args; Py::Int ret(method.apply(args)); int value = (int)ret; return QDialogButtonBox::StandardButtons(value); @@ -437,7 +437,7 @@ bool TaskDialogPython::isAllowedAlterDocument(void) const try { if (dlg.hasAttr(std::string("isAllowedAlterDocument"))) { Py::Callable method(dlg.getAttr(std::string("isAllowedAlterDocument"))); - Py::Tuple args(0); + Py::Tuple args; Py::Boolean ret(method.apply(args)); return (bool)ret; } @@ -456,7 +456,7 @@ bool TaskDialogPython::isAllowedAlterView(void) const try { if (dlg.hasAttr(std::string("isAllowedAlterView"))) { Py::Callable method(dlg.getAttr(std::string("isAllowedAlterView"))); - Py::Tuple args(0); + Py::Tuple args; Py::Boolean ret(method.apply(args)); return (bool)ret; } @@ -475,7 +475,7 @@ bool TaskDialogPython::isAllowedAlterSelection(void) const try { if (dlg.hasAttr(std::string("isAllowedAlterSelection"))) { Py::Callable method(dlg.getAttr(std::string("isAllowedAlterSelection"))); - Py::Tuple args(0); + Py::Tuple args; Py::Boolean ret(method.apply(args)); return (bool)ret; } @@ -494,7 +494,7 @@ bool TaskDialogPython::needsFullSpace() const try { if (dlg.hasAttr(std::string("needsFullSpace"))) { Py::Callable method(dlg.getAttr(std::string("needsFullSpace"))); - Py::Tuple args(0); + Py::Tuple args; Py::Boolean ret(method.apply(args)); return (bool)ret; } diff --git a/src/Gui/ViewProviderPythonFeature.cpp b/src/Gui/ViewProviderPythonFeature.cpp index 248a25779..30fbda81a 100644 --- a/src/Gui/ViewProviderPythonFeature.cpp +++ b/src/Gui/ViewProviderPythonFeature.cpp @@ -245,7 +245,7 @@ QIcon ViewProviderPythonFeatureImp::getIcon() const Py::Object vp = static_cast(proxy)->getValue(); if (vp.hasAttr(std::string("getIcon"))) { Py::Callable method(vp.getAttr(std::string("getIcon"))); - Py::Tuple args(0); + Py::Tuple args; Py::String str(method.apply(args)); std::string content = str.as_std_string(); QPixmap icon; @@ -296,7 +296,7 @@ std::vector ViewProviderPythonFeatureImp::claimChildren(co Py::Object vp = static_cast(proxy)->getValue(); if (vp.hasAttr(std::string("claimChildren"))) { Py::Callable method(vp.getAttr(std::string("claimChildren"))); - Py::Tuple args(0); + Py::Tuple args; Py::Sequence list(method.apply(args)); for (Py::Sequence::iterator it = list.begin(); it != list.end(); ++it) { PyObject* item = (*it).ptr(); @@ -528,7 +528,7 @@ void ViewProviderPythonFeatureImp::attach(App::DocumentObject *pcObject) if (vp.hasAttr(std::string("attach"))) { if (vp.hasAttr("__object__")) { Py::Callable method(vp.getAttr(std::string("attach"))); - Py::Tuple args(0); + Py::Tuple args; method.apply(args); } else { @@ -647,7 +647,7 @@ const char* ViewProviderPythonFeatureImp::getDefaultDisplayMode() const Py::Object vp = static_cast(proxy)->getValue(); if (vp.hasAttr(std::string("getDefaultDisplayMode"))) { Py::Callable method(vp.getAttr(std::string("getDefaultDisplayMode"))); - Py::Tuple args(0); + Py::Tuple args; Py::String str(method.apply(args)); if (str.isUnicode()) str = str.encode("ascii"); // json converts strings into unicode @@ -676,7 +676,7 @@ std::vector ViewProviderPythonFeatureImp::getDisplayModes(void) con if (vp.hasAttr(std::string("getDisplayModes"))) { if (vp.hasAttr("__object__")) { Py::Callable method(vp.getAttr(std::string("getDisplayModes"))); - Py::Tuple args(0); + Py::Tuple args; Py::Sequence list(method.apply(args)); for (Py::Sequence::iterator it = list.begin(); it != list.end(); ++it) { Py::String str(*it); diff --git a/src/Mod/Sketcher/App/Sketch.cpp b/src/Mod/Sketcher/App/Sketch.cpp index fd13224f4..fa59c0e57 100644 --- a/src/Mod/Sketcher/App/Sketch.cpp +++ b/src/Mod/Sketcher/App/Sketch.cpp @@ -1871,7 +1871,7 @@ int Sketch::setDatum(int constrId, double value) int Sketch::getPointId(int geoId, PointPos pos) const { // do a range check first - if (geoId < 0 || geoId >= Geoms.size()) + if (geoId < 0 || geoId >= (int)Geoms.size()) return -1; switch (pos) { case start: