Core: Enable compiling with MSVC /permissive- (#11014)

* Base: Fixes for MSVC permissive-

* App: Fixes for MSVC permissive-

* Gui: Fixes for MSVC permissive-

* Main: Fixes for MSVC permissive-

* Fem: Fixes for MSVC permissive-

* Material: Fixes for MSVC permissive-

* Part: Fixes for MSVC permissive-

* Mesh: Fixes for MSVC permissive-

* Points: Fixes for MSVC permissive-

* Robot: Fixes for MSVC permissive-

* TechDraw: Fixes for MSVC permissive-

* Path: Fixes for MSVC permissive-

* Core; Changes per review comments

* TD: Revision from wandererfan

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
Chris Hennes
2023-11-27 10:37:29 -06:00
committed by GitHub
parent a462e8e616
commit cfd41683a5
45 changed files with 133 additions and 95 deletions

View File

@@ -290,7 +290,7 @@ private:
Py::Object show(const Py::Tuple& args)
{
PyObject* pcObj;
char* name = "Mesh";
const char* name = "Mesh";
if (!PyArg_ParseTuple(args.ptr(), "O!|s", &(FemMeshPy::Type), &pcObj, &name)) {
throw Py::Exception();
}

View File

@@ -54,7 +54,7 @@ int MaterialManagerPy::PyInit(PyObject* /*args*/, PyObject* /*kwd*/)
PyObject* MaterialManagerPy::getMaterial(PyObject* args)
{
char* uuid;
char* uuid {};
if (!PyArg_ParseTuple(args, "s", &uuid)) {
return nullptr;
}
@@ -71,8 +71,8 @@ PyObject* MaterialManagerPy::getMaterial(PyObject* args)
PyObject* MaterialManagerPy::getMaterialByPath(PyObject* args)
{
char* path;
char* lib = "";
char* path {};
const char* lib = "";
if (!PyArg_ParseTuple(args, "s|s", &path, &lib)) {
return nullptr;
}
@@ -152,7 +152,7 @@ int MaterialManagerPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj
PyObject* MaterialManagerPy::materialsWithModel(PyObject* args)
{
char* uuid;
char* uuid {};
if (!PyArg_ParseTuple(args, "s", &uuid)) {
return nullptr;
}
@@ -173,7 +173,7 @@ PyObject* MaterialManagerPy::materialsWithModel(PyObject* args)
PyObject* MaterialManagerPy::materialsWithModelComplete(PyObject* args)
{
char* uuid;
char* uuid {};
if (!PyArg_ParseTuple(args, "s", &uuid)) {
return nullptr;
}

View File

@@ -54,7 +54,7 @@ int ModelManagerPy::PyInit(PyObject* /*args*/, PyObject* /*kwd*/)
PyObject* ModelManagerPy::getModel(PyObject* args)
{
char* uuid;
char* uuid {};
if (!PyArg_ParseTuple(args, "s", &uuid)) {
return nullptr;
}
@@ -85,8 +85,8 @@ PyObject* ModelManagerPy::getModel(PyObject* args)
PyObject* ModelManagerPy::getModelByPath(PyObject* args)
{
char* path;
char* lib = "";
char* path {};
const char* lib = "";
if (!PyArg_ParseTuple(args, "s|s", &path, &lib)) {
return nullptr;
}

View File

@@ -293,7 +293,7 @@ private:
Py::Object show(const Py::Tuple& args)
{
PyObject* pcObj {};
char* name = "Mesh";
const char* name = "Mesh";
if (!PyArg_ParseTuple(args.ptr(), "O!|s", &(MeshPy::Type), &pcObj, &name)) {
throw Py::Exception();
}

View File

@@ -1981,7 +1981,7 @@ PyObject* MeshPy::trimByPlane(PyObject* args)
PyObject* MeshPy::smooth(PyObject* args, PyObject* kwds)
{
char* method = "Laplace";
const char* method = "Laplace";
int iter = 1;
double lambda = 0;
double micro = 0;

View File

@@ -838,7 +838,7 @@ private:
Py::Object show(const Py::Tuple& args)
{
PyObject *pcObj = nullptr;
char *name = "Shape";
const char *name = "Shape";
if (!PyArg_ParseTuple(args.ptr(), "O!|s", &(TopoShapePy::Type), &pcObj, &name))
throw Py::Exception();
@@ -1741,7 +1741,7 @@ private:
PyObject *pshape;
double radius;
double tolerance=0.001;
char* scont = "C0";
const char* scont = "C0";
int maxdegree = 3;
int maxsegment = 30;

View File

@@ -795,9 +795,9 @@ PyObject* BSplineCurvePy::approximate(PyObject *args, PyObject *kwds)
Standard_Integer degMin = 3;
Standard_Integer degMax = 8;
Standard_Integer segMax = 8;
char *continuity = "C2";
const char *continuity = "C2";
double tol3d = 1e-3;
char *parType = "ChordLength";
const char *parType = "ChordLength";
PyObject *par = nullptr;
double weight1 = 0;
double weight2 = 0;

View File

@@ -1158,7 +1158,7 @@ PyObject* BSplineSurfacePy::approximate(PyObject *args, PyObject *kwds)
Standard_Integer degMax=8;
Standard_Integer continuity=2;
Standard_Real tol3d = Precision::Approximation();
char* parType = "None";
const char* parType = "None";
Standard_Real weight1 = 1.0;
Standard_Real weight2 = 1.0;
Standard_Real weight3 = 1.0;

View File

@@ -732,9 +732,9 @@ PyObject* BSplineCurve2dPy::approximate(PyObject *args, PyObject *kwds)
PyObject* obj;
Standard_Integer degMin=3;
Standard_Integer degMax=8;
char* continuity = "C2";
const char* continuity = "C2";
double tol3d = 1e-3;
char* parType = "ChordLength";
const char* parType = "ChordLength";
PyObject* par = nullptr;
double weight1 = 0;
double weight2 = 0;

View File

@@ -684,7 +684,7 @@ PyObject* Curve2dPy::approximateBSpline(PyObject *args)
{
double tolerance;
int maxSegment, maxDegree;
char* order = "C2";
const char* order = "C2";
if (!PyArg_ParseTuple(args, "dii|s", &tolerance, &maxSegment, &maxDegree, &order))
return nullptr;

View File

@@ -857,7 +857,7 @@ PyObject* GeometryCurvePy::approximateBSpline(PyObject *args)
{
double tolerance;
int maxSegment, maxDegree;
char* order = "C2";
const char* order = "C2";
if (!PyArg_ParseTuple(args, "dii|s", &tolerance, &maxSegment, &maxDegree, &order))
return nullptr;

View File

@@ -726,7 +726,8 @@ Py::String GeometrySurfacePy::getContinuity() const
PyObject* GeometrySurfacePy::toBSpline(PyObject * args, PyObject * kwds)
{
double tol3d=Precision::Confusion();
char *ucont="C1", *vcont="C1";
const char *ucont = "C1";
const char *vcont = "C1";
int maxDegU=Geom_BSplineSurface::MaxDegree();
int maxDegV=Geom_BSplineSurface::MaxDegree();
int maxSegm=1000, prec=0;

View File

@@ -71,7 +71,6 @@
#include <Standard_ShortReal.hxx>
#include <Standard_SStream.hxx>
#include <Standard_Stream.hxx>
#include <Standard_TooManyUsers.hxx>
#include <Standard_Transient.hxx>
#include <Standard_Type.hxx>
#include <Standard_TypeDef.hxx>
@@ -80,6 +79,10 @@
#include <Standard_UUID.hxx>
#include <Standard_Version.hxx>
#if OCC_VERSION_HEX < 0x070700
# include <Standard_TooManyUsers.hxx>
#endif
// now in alphabetical order
#if OCC_VERSION_HEX < 0x070600
# include <Adaptor3d_HCurve.hxx>
@@ -394,7 +397,11 @@
// Quan*
#include <Quantity_Color.hxx>
#include <Quantity_NameOfColor.hxx>
#if OCC_VERSION_HEX < 0x070700
#include <Quantity_PhysicalQuantity.hxx>
#endif
#include <Quantity_TypeOfColor.hxx>
// Shape*

View File

@@ -148,7 +148,7 @@ PyObject* PlateSurfacePy::makeApprox(PyObject *args, PyObject* kwds)
int maxDegree=3;
double dmax = 0.0001;
int critOrder=0;
char* cont = "C1";
const char* cont = "C1";
double enlargeCoeff = 1.1;
if (!Base::Wrapped_ParseTupleAndKeywords(args, kwds, "|diidisd", kwds_Parameter,

View File

@@ -2059,7 +2059,7 @@ PyObject* TopoShapePy::reflectLines(PyObject *args, PyObject *kwds)
static const std::array<const char *, 7> kwlist{"ViewDir", "ViewPos", "UpDir", "EdgeType", "Visible", "OnShape",
nullptr};
char* type="OutLine";
const char* type="OutLine";
PyObject* vis = Py_True;
PyObject* in3d = Py_False;
PyObject* pPos = nullptr;

View File

@@ -215,7 +215,7 @@ namespace PathApp {
Py::Object show(const Py::Tuple& args)
{
PyObject *pcObj;
char *name = "Path";
const char *name = "Path";
if (!PyArg_ParseTuple(args.ptr(), "O!|s", &(Path::PathPy::Type), &pcObj, &name))
throw Py::Exception();

View File

@@ -69,7 +69,7 @@ PyObject *CommandPy::PyMake(struct _typeobject *, PyObject *, PyObject *) // Py
int CommandPy::PyInit(PyObject* args, PyObject* kwd)
{
PyObject *parameters = nullptr;
char *name = "";
const char *name = "";
static const std::array<const char *, 3> kwlist {"name", "parameters", nullptr};
if (Base::Wrapped_ParseTupleAndKeywords(args, kwd, "|sO!", kwlist, &name, &PyDict_Type, &parameters)) {
std::string sname(name);

View File

@@ -404,7 +404,7 @@ private:
Py::Object show(const Py::Tuple& args)
{
PyObject* pcObj;
char* name = "Points";
const char* name = "Points";
if (!PyArg_ParseTuple(args.ptr(), "O!|s", &(PointsPy::Type), &pcObj, &name)) {
throw Py::Exception();
}

View File

@@ -90,8 +90,8 @@ PyObject* WaypointPy::PyMake(struct _typeobject*, PyObject*, PyObject*) // Pyth
int WaypointPy::PyInit(PyObject* args, PyObject* kwd)
{
PyObject* pos;
char* name = "P";
char* type = "PTP";
const char* name = "P";
const char* type = "PTP";
PyObject* vel = nullptr;
PyObject* acc = nullptr;
int cont = 0;

View File

@@ -961,19 +961,17 @@ private:
{
PyObject* pFace(nullptr);
double scale = 1.0;
char* pPatName = "";
char* pPatFile = "";
const char* pPatName = {nullptr};
const char* pPatFile = {nullptr};
TechDraw::DrawViewPart* source = nullptr;
TopoDS_Face face;
if (!PyArg_ParseTuple(args.ptr(), "O|detet", &pFace, &scale, "utf-8", &pPatName, "utf-8", &pPatFile)) {
if (!PyArg_ParseTuple(args.ptr(), "O|dss", &pFace, &scale, &pPatName, &pPatFile)) {
throw Py::TypeError("expected (face, [scale], [patName], [patFile])");
}
std::string patName = std::string(pPatName);
PyMem_Free(pPatName);
std::string patFile = std::string(pPatFile);
PyMem_Free(pPatFile);
if (PyObject_TypeCheck(pFace, &(TopoShapeFacePy::Type))) {
const TopoDS_Shape& shape = static_cast<TopoShapePy*>(pFace)->getTopoShapePtr()->getShape();

View File

@@ -54,14 +54,11 @@
// Qt
#include <QDomDocument>
#include "QDomNodeModel.h"
#include <QFile>
#include <QLocale>
#include <QRegularExpression>
#include <QRegularExpressionMatch>
#include <QtConcurrentRun>
#include <QXmlQuery>
#include <QXmlResultItems>
// OpenCasCade
#include <Mod/Part/App/OpenCascadeAll.h>

View File

@@ -57,8 +57,6 @@
#ifndef _QtAll__
# include <Gui/QtAll.h>
#endif
#include <QXmlQuery>
#include <QXmlResultItems>
// OpenCasCade
#include <BRep_Tool.hxx>

View File

@@ -93,7 +93,7 @@ protected:
static QPointF normalizeQPointF(QPointF inPoint);
private:
char* m_symbol;
const char* m_symbol;
QGraphicsPathItem* m_line;
QGraphicsPathItem* m_extend;
QGIArrow* m_arrow1;

View File

@@ -971,7 +971,7 @@ void QGIViewPart::dumpPath(const char* text, QPainterPath path)
{
QPainterPath::Element elem;
Base::Console().Message(">>>%s has %d elements\n", text, path.elementCount());
char* typeName;
const char* typeName;
for (int iElem = 0; iElem < path.elementCount(); iElem++) {
elem = path.elementAt(iElem);
if (elem.isMoveTo()) {