Coverity Fixes

- 183599
- 183595
- 183594
- 175821
- 175820
- 175817
- 175816
- 175815
- 175814
- 175813
- 175812
- 175811
- 175806
- 175805
- 175804
- 175802
This commit is contained in:
wandererfan
2018-08-18 12:34:16 -04:00
committed by wmayer
parent 0865468918
commit baa960e1de
5 changed files with 31 additions and 31 deletions

View File

@@ -409,7 +409,7 @@ private:
if (usePolyline == Py_True) {
polyOverride = true;
}
if (optionSource) {
if (optionSource != nullptr) {
strcpy(useOptionSource,optionSource);
} else {
useOptionSource = defaultOptions;
@@ -422,7 +422,7 @@ private:
if (versionOverride) {
writer.setVersion(versionParm);
}
writer.setPolyOverride(true);
writer.setPolyOverride(polyOverride);
writer.setLayerName(layerName);
writer.init();
Py::Sequence list(shapeObj);
@@ -458,7 +458,7 @@ private:
if (usePolyline == Py_True) {
polyOverride = true;
}
if (optionSource) {
if (optionSource != nullptr) {
strcpy(useOptionSource,optionSource);
} else {
useOptionSource = defaultOptions;
@@ -521,7 +521,7 @@ private:
polyOverride = true;
}
if (optionSource) {
if (optionSource != nullptr) {
strcpy(useOptionSource,optionSource);
} else {
useOptionSource = defaultOptions;
@@ -555,7 +555,7 @@ private:
throw Py::RuntimeError(e.what());
}
} else if (PyArg_ParseTuple(args.ptr(), "O!et|iOs",
&(Part::PartFeaturePy::Type) ,
&(App::DocumentObjectPy::Type) ,
&docObj,
"utf-8",
&fname,
@@ -574,7 +574,7 @@ private:
polyOverride = true;
}
if (optionSource) {
if (optionSource != nullptr) {
strcpy(useOptionSource,optionSource);
} else {
useOptionSource = defaultOptions;
@@ -587,7 +587,7 @@ private:
if (versionOverride) {
writer.setVersion(versionParm);
}
writer.setPolyOverride(true);
writer.setPolyOverride(polyOverride);
writer.setLayerName(layerName);
writer.init();
App::DocumentObject* obj = static_cast<App::DocumentObjectPy*>(docObj)->getDocumentObjectPtr();

View File

@@ -486,7 +486,7 @@ bool ImpExpDxfWrite::gp_PntCompare(gp_Pnt p1, gp_Pnt p2)
}
void ImpExpDxfWrite::exportCircle(BRepAdaptor_Curve c)
void ImpExpDxfWrite::exportCircle(const BRepAdaptor_Curve& c)
{
gp_Circ circ = c.Circle();
gp_Pnt p = circ.Location();
@@ -498,7 +498,7 @@ void ImpExpDxfWrite::exportCircle(BRepAdaptor_Curve c)
writeCircle(center, radius);
}
void ImpExpDxfWrite::exportEllipse(BRepAdaptor_Curve c)
void ImpExpDxfWrite::exportEllipse(const BRepAdaptor_Curve& c)
{
gp_Elips ellp = c.Ellipse();
gp_Pnt p = ellp.Location();
@@ -517,7 +517,7 @@ void ImpExpDxfWrite::exportEllipse(BRepAdaptor_Curve c)
writeEllipse(center, major, minor, rotation, 0.0, 6.28318, true );
}
void ImpExpDxfWrite::exportArc(BRepAdaptor_Curve c)
void ImpExpDxfWrite::exportArc(const BRepAdaptor_Curve& c)
{
gp_Circ circ = c.Circle();
gp_Pnt p = circ.Location();
@@ -543,7 +543,7 @@ void ImpExpDxfWrite::exportArc(BRepAdaptor_Curve c)
writeArc(start, end, center, dir );
}
void ImpExpDxfWrite::exportEllipseArc(BRepAdaptor_Curve c)
void ImpExpDxfWrite::exportEllipseArc(const BRepAdaptor_Curve& c)
{
gp_Elips ellp = c.Ellipse();
gp_Pnt p = ellp.Location();
@@ -583,7 +583,7 @@ void ImpExpDxfWrite::exportEllipseArc(BRepAdaptor_Curve c)
writeEllipse(center, major, minor, rotation, startAngle, endAngle, endIsCW);
}
void ImpExpDxfWrite::exportBSpline(BRepAdaptor_Curve c)
void ImpExpDxfWrite::exportBSpline(const BRepAdaptor_Curve& c)
{
SplineDataOut sd;
Handle(Geom_BSplineCurve) spline;
@@ -658,13 +658,13 @@ void ImpExpDxfWrite::exportBSpline(BRepAdaptor_Curve c)
writeSpline(sd);
}
void ImpExpDxfWrite::exportBCurve(BRepAdaptor_Curve c)
void ImpExpDxfWrite::exportBCurve(const BRepAdaptor_Curve& c)
{
(void) c;
Base::Console().Message("BCurve dxf export not yet supported\n");
}
void ImpExpDxfWrite::exportLine(BRepAdaptor_Curve c)
void ImpExpDxfWrite::exportLine(const BRepAdaptor_Curve& c)
{
double f = c.FirstParameter();
double l = c.LastParameter();
@@ -677,7 +677,7 @@ void ImpExpDxfWrite::exportLine(BRepAdaptor_Curve c)
writeLine(start, end);
}
void ImpExpDxfWrite::exportLWPoly(BRepAdaptor_Curve c)
void ImpExpDxfWrite::exportLWPoly(const BRepAdaptor_Curve& c)
{
LWPolyDataOut pd;
pd.Flag = c.IsClosed();
@@ -702,7 +702,7 @@ void ImpExpDxfWrite::exportLWPoly(BRepAdaptor_Curve c)
}
}
void ImpExpDxfWrite::exportPolyline(BRepAdaptor_Curve c)
void ImpExpDxfWrite::exportPolyline(const BRepAdaptor_Curve& c)
{
LWPolyDataOut pd;
pd.Flag = c.IsClosed();

View File

@@ -100,15 +100,15 @@ namespace Import
static bool gp_PntCompare(gp_Pnt p1, gp_Pnt p2);
protected:
void exportCircle(BRepAdaptor_Curve c);
void exportEllipse(BRepAdaptor_Curve c);
void exportArc(BRepAdaptor_Curve c);
void exportEllipseArc(BRepAdaptor_Curve c);
void exportBSpline(BRepAdaptor_Curve c);
void exportBCurve(BRepAdaptor_Curve c);
void exportLine(BRepAdaptor_Curve c);
void exportLWPoly(BRepAdaptor_Curve c); //LWPolyline not supported in R12?
void exportPolyline(BRepAdaptor_Curve c);
void exportCircle(const BRepAdaptor_Curve& c);
void exportEllipse(const BRepAdaptor_Curve& c);
void exportArc(const BRepAdaptor_Curve& c);
void exportEllipseArc(const BRepAdaptor_Curve& c);
void exportBSpline(const BRepAdaptor_Curve& c);
void exportBCurve(const BRepAdaptor_Curve& c);
void exportLine(const BRepAdaptor_Curve& c);
void exportLWPoly(const BRepAdaptor_Curve& c); //LWPolyline not supported in R12?
void exportPolyline(const BRepAdaptor_Curve& c);
// std::string m_optionSource;
double optionMaxLength;

View File

@@ -521,7 +521,7 @@ void CDxfWrite::putLine(const Base::Vector3d s, const Base::Vector3d e,
//***************************
//writeLWPolyLine (Note: LWPolyline might not be supported in R12
//added by Wandererfan 2018 (wandererfan@gmail.com) for FreeCAD project
void CDxfWrite::writeLWPolyLine(LWPolyDataOut pd)
void CDxfWrite::writeLWPolyLine(const LWPolyDataOut &pd)
{
(*m_ssEntity) << " 0" << endl;
(*m_ssEntity) << "LWPOLYLINE" << endl;
@@ -579,7 +579,7 @@ void CDxfWrite::writeLWPolyLine(LWPolyDataOut pd)
//***************************
//writePolyline
//added by Wandererfan 2018 (wandererfan@gmail.com) for FreeCAD project
void CDxfWrite::writePolyline(LWPolyDataOut pd)
void CDxfWrite::writePolyline(const LWPolyDataOut &pd)
{
(*m_ssEntity) << " 0" << endl;
(*m_ssEntity) << "POLYLINE" << endl;
@@ -796,7 +796,7 @@ void CDxfWrite::writeEllipse(const double* c, double major_radius, double minor_
//***************************
//writeSpline
//added by Wandererfan 2018 (wandererfan@gmail.com) for FreeCAD project
void CDxfWrite::writeSpline(SplineDataOut sd)
void CDxfWrite::writeSpline(const SplineDataOut &sd)
{
(*m_ssEntity) << " 0" << endl;
(*m_ssEntity) << "SPLINE" << endl;

View File

@@ -191,9 +191,9 @@ public:
void writeEllipse(const double* c, double major_radius, double minor_radius,
double rotation, double start_angle, double end_angle, bool endIsCW);
void writeCircle(const double* c, double radius );
void writeSpline(SplineDataOut sd);
void writeLWPolyLine(LWPolyDataOut pd);
void writePolyline(LWPolyDataOut pd);
void writeSpline(const SplineDataOut &sd);
void writeLWPolyLine(const LWPolyDataOut &pd);
void writePolyline(const LWPolyDataOut &pd);
void writeVertex(double x, double y, double z);
void writeText(const char* text, const double* location1, const double* location2,
const double height, const int horizJust);