some type clearification

This commit is contained in:
jriegel 2014-08-21 17:59:17 +02:00
parent 0e53a593db
commit d65a4e4ed7
6 changed files with 23 additions and 23 deletions

View File

@ -54,7 +54,7 @@ DocumentObjectExecReturn *FeaturePythonImp::execute()
Py::Object feature = static_cast<PropertyPythonObject*>(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 {

View File

@ -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);
}

View File

@ -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 );
}

View File

@ -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;
}

View File

@ -245,7 +245,7 @@ QIcon ViewProviderPythonFeatureImp::getIcon() const
Py::Object vp = static_cast<App::PropertyPythonObject*>(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<App::DocumentObject*> ViewProviderPythonFeatureImp::claimChildren(co
Py::Object vp = static_cast<App::PropertyPythonObject*>(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<App::PropertyPythonObject*>(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<std::string> 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);

View File

@ -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: