From 033ddff0892ab178b9a1461da2fd6a7c2bd0fe6a Mon Sep 17 00:00:00 2001 From: wmayer Date: Fri, 12 Jun 2020 01:40:20 +0200 Subject: [PATCH] cast between incompatible function types from 'PyObject* (*)(PyObject*, PyObject*, PyObject*)' {aka '_object* (*)(_object*, _object*, _object*)'} to 'PyCFunction' {aka '_object* (*)(_object*, _object*)'} [-Wcast-function-type] --- src/App/ApplicationPy.cpp | 6 +++--- src/Gui/Selection.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/App/ApplicationPy.cpp b/src/App/ApplicationPy.cpp index e4acb4d607..8373b18f34 100644 --- a/src/App/ApplicationPy.cpp +++ b/src/App/ApplicationPy.cpp @@ -106,9 +106,9 @@ PyMethodDef Application::Methods[] = { "* If no module is given it will be determined by the file extension.\n" "* If more than one module can load a file the first one one will be taken.\n" "* If no module exists to load the file an exception will be raised."}, - {"open", (PyCFunction) Application::sOpenDocument, METH_VARARGS|METH_KEYWORDS, + {"open", reinterpret_cast(reinterpret_cast( Application::sOpenDocument )), METH_VARARGS|METH_KEYWORDS, "See openDocument(string)"}, - {"openDocument", (PyCFunction) Application::sOpenDocument, METH_VARARGS|METH_KEYWORDS, + {"openDocument", reinterpret_cast(reinterpret_cast( Application::sOpenDocument )), METH_VARARGS|METH_KEYWORDS, "openDocument(filepath,hidden=False) -> object\n" "Create a document and load the project file into the document.\n\n" "filepath: file path to an existing file. If the file doesn't exist\n" @@ -118,7 +118,7 @@ PyMethodDef Application::Methods[] = { // {"saveDocument", (PyCFunction) Application::sSaveDocument, METH_VARARGS, // "saveDocument(string) -- Save the document to a file."}, // {"saveDocumentAs", (PyCFunction) Application::sSaveDocumentAs, METH_VARARGS}, - {"newDocument", (PyCFunction) Application::sNewDocument, METH_VARARGS|METH_KEYWORDS, + {"newDocument", reinterpret_cast(reinterpret_cast( Application::sNewDocument )), METH_VARARGS|METH_KEYWORDS, "newDocument(name, label=None, hidden=False) -> object\n" "Create a new document with a given name.\n\n" "name: unique document name which is checked automatically.\n" diff --git a/src/Gui/Selection.cpp b/src/Gui/Selection.cpp index df7e42f2a8..8a244eab52 100644 --- a/src/Gui/Selection.cpp +++ b/src/Gui/Selection.cpp @@ -1809,7 +1809,7 @@ PyMethodDef SelectionSingleton::Methods[] = { "given the complete selection is cleared."}, {"isSelected", (PyCFunction) SelectionSingleton::sIsSelected, METH_VARARGS, "isSelected(object,resolve=True) -- Check if a given object is selected"}, - {"setPreselection", (PyCFunction) SelectionSingleton::sSetPreselection, METH_VARARGS|METH_KEYWORDS, + {"setPreselection", reinterpret_cast(reinterpret_cast( SelectionSingleton::sSetPreselection )), METH_VARARGS|METH_KEYWORDS, "setPreselection() -- Set preselected object"}, {"getPreselection", (PyCFunction) SelectionSingleton::sGetPreselection, METH_VARARGS, "getPreselection() -- Get preselected object"},