diff --git a/src/Mod/Mesh/App/AppMeshPy.cpp b/src/Mod/Mesh/App/AppMeshPy.cpp
index 9ab215e3d6..a157286215 100644
--- a/src/Mod/Mesh/App/AppMeshPy.cpp
+++ b/src/Mod/Mesh/App/AppMeshPy.cpp
@@ -33,6 +33,7 @@
#include
#include
#include
+#include
#include
#include "Core/Approximation.h"
#include "Core/Evaluation.h"
@@ -211,13 +212,13 @@ private:
int exportAmfCompressed( hGrp->GetBool("ExportAmfCompressed", true) );
- static char *kwList[] = {"objectList", "filename", "tolerance",
- "exportAmfCompressed", nullptr};
+ static const std::array kwList{"objectList", "filename", "tolerance",
+ "exportAmfCompressed", nullptr};
- if (!PyArg_ParseTupleAndKeywords( args.ptr(), keywds.ptr(),
- "Oet|dp",
- kwList, &objects, "utf-8", &fileNamePy,
- &fTolerance, &exportAmfCompressed )) {
+ if (!Base::Wrapped_ParseTupleAndKeywords(args.ptr(), keywds.ptr(),
+ "Oet|dp",
+ kwList, &objects, "utf-8", &fileNamePy,
+ &fTolerance, &exportAmfCompressed)) {
throw Py::Exception();
}
diff --git a/src/Mod/Mesh/App/MeshPyImp.cpp b/src/Mod/Mesh/App/MeshPyImp.cpp
index 7f1b4c24be..aefab5aba5 100644
--- a/src/Mod/Mesh/App/MeshPyImp.cpp
+++ b/src/Mod/Mesh/App/MeshPyImp.cpp
@@ -25,6 +25,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -131,8 +132,8 @@ PyObject* MeshPy::copy(PyObject *args)
PyObject* MeshPy::read(PyObject *args, PyObject *kwds)
{
char* Name;
- static char* keywords_path[] = {"Filename",nullptr};
- if (PyArg_ParseTupleAndKeywords(args, kwds, "et", keywords_path, "utf-8", &Name)) {
+ static const std::array keywords_path {"Filename",nullptr};
+ if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "et", keywords_path, "utf-8", &Name)) {
getMeshObjectPtr()->load(Name);
PyMem_Free(Name);
Py_Return;
@@ -162,8 +163,8 @@ PyObject* MeshPy::read(PyObject *args, PyObject *kwds)
PyObject* input;
char* Ext;
- static char* keywords_stream[] = {"Stream","Format",nullptr};
- if (PyArg_ParseTupleAndKeywords(args, kwds, "Os",keywords_stream, &input, &Ext)) {
+ static const std::array keywords_stream {"Stream", "Format", nullptr};
+ if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "Os",keywords_stream, &input, &Ext)) {
std::string fmt(Ext);
boost::to_upper(fmt);
if (ext.find(fmt) != ext.end()) {
@@ -215,9 +216,9 @@ PyObject* MeshPy::write(PyObject *args, PyObject *kwds)
ext["ASY" ] = MeshCore::MeshIO::ASY;
ext["3MF" ] = MeshCore::MeshIO::ThreeMF;
- static char* keywords_path[] = {"Filename","Format","Name","Material",nullptr};
- if (PyArg_ParseTupleAndKeywords(args, kwds, "et|ssO", keywords_path, "utf-8",
- &Name, &Ext, &ObjName, &List)) {
+ static const std::array keywords_path {"Filename","Format","Name","Material",nullptr};
+ if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "et|ssO", keywords_path, "utf-8",
+ &Name, &Ext, &ObjName, &List)) {
if (Ext) {
std::string fmt(Ext);
boost::to_upper(fmt);
@@ -255,10 +256,10 @@ PyObject* MeshPy::write(PyObject *args, PyObject *kwds)
PyErr_Clear();
- static char* keywords_stream[] = {"Stream","Format","Name","Material",nullptr};
+ static const std::array keywords_stream {"Stream", "Format", "Name", "Material", nullptr};
PyObject* input;
- if (PyArg_ParseTupleAndKeywords(args, kwds, "Os|sO", keywords_stream,
- &input, &Ext, &ObjName, &List)) {
+ if (Base::Wrapped_ParseTupleAndKeywords(args, kwds, "Os|sO", keywords_stream,
+ &input, &Ext, &ObjName, &List)) {
std::string fmt(Ext);
boost::to_upper(fmt);
if (ext.find(fmt) != ext.end()) {
@@ -488,10 +489,11 @@ PyObject* MeshPy::section(PyObject *args, PyObject *kwds)
PyObject *connectLines = Py_True;
float fMinDist = 0.0001f;
- static char* keywords_section[] = {"Mesh", "ConnectLines", "MinDist", nullptr};
- if (!PyArg_ParseTupleAndKeywords(args, kwds, "O!|O!f",keywords_section,
- &(MeshPy::Type), &pcObj, &PyBool_Type, &connectLines, &fMinDist))
+ static const std::array keywords_section {"Mesh", "ConnectLines", "MinDist", nullptr};
+ if (!Base::Wrapped_ParseTupleAndKeywords(args, kwds, "O!|O!f",keywords_section,
+ &(MeshPy::Type), &pcObj, &PyBool_Type, &connectLines, &fMinDist)) {
return nullptr;
+ }
MeshPy* pcObject = static_cast(pcObj);
@@ -1117,10 +1119,11 @@ PyObject* MeshPy::hasPointsOnEdge(PyObject *args)
PyObject* MeshPy::removePointsOnEdge(PyObject *args, PyObject *kwds)
{
- PyObject *fillBoundary = Py_False;
- static char* keywords[] = {"FillBoundary", nullptr};
- if (!PyArg_ParseTupleAndKeywords(args, kwds, "|O!", keywords, &PyBool_Type, &fillBoundary))
+ PyObject *fillBoundary = Py_False; // NOLINT
+ static const std::array keywords {"FillBoundary", nullptr};
+ if (!Base::Wrapped_ParseTupleAndKeywords(args, kwds, "|O!", keywords, &PyBool_Type, &fillBoundary)) {
return nullptr;
+ }
try {
getMeshObjectPtr()->removePointsOnEdge(Base::asBoolean(fillBoundary));
}
@@ -1753,10 +1756,12 @@ PyObject* MeshPy::smooth(PyObject *args, PyObject *kwds)
double micro = 0;
double maximum = 1000;
int weight = 1;
- static char* keywords_smooth[] = {"Method", "Iteration", "Lambda", "Micro", "Maximum", "Weight", nullptr};
- if (!PyArg_ParseTupleAndKeywords(args, kwds, "|sidddi",keywords_smooth,
- &method, &iter, &lambda, µ, &maximum, &weight))
+ static const std::array keywords_smooth{"Method", "Iteration", "Lambda", "Micro", "Maximum",
+ "Weight", nullptr};
+ if (!Base::Wrapped_ParseTupleAndKeywords(args, kwds, "|sidddi",keywords_smooth,
+ &method, &iter, &lambda, µ, &maximum, &weight)) {
return nullptr;
+ }
PY_TRY {
MeshPropertyLock lock(this->parentProperty);