Coverity issues:
129202: replace dynamic_cast with static_cast 129421, 129422: fix Py_Return macro 128928: Unchecked return value 129488, 129490: uninitialized scalar variable 129567, 129661: uninitialized scalar field 129665: uninitialized pointer field
This commit is contained in:
parent
7e0181463c
commit
1e12b54a7b
|
@ -75,19 +75,24 @@ ColorField::ColorField (void)
|
|||
}
|
||||
|
||||
ColorField::ColorField (const ColorModel &rclModel, float fMin, float fMax, unsigned short usCt)
|
||||
: _clModel(ColorModelTria())
|
||||
: _clModel(ColorModelTria())
|
||||
{
|
||||
set(rclModel, fMin, fMax, usCt);
|
||||
}
|
||||
|
||||
ColorField::~ColorField ()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
ColorField::ColorField (const ColorField &rclCF)
|
||||
: _clModel(ColorModelTria())
|
||||
: _clModel(rclCF._clModel),
|
||||
_fMin(rclCF._fMin),
|
||||
_fMax(rclCF._fMax),
|
||||
_fAscent(rclCF._fAscent),
|
||||
_fConstant(rclCF._fConstant),
|
||||
_usCtColors(rclCF._usCtColors),
|
||||
_aclField(rclCF._aclField)
|
||||
{
|
||||
*this = rclCF;
|
||||
}
|
||||
|
||||
ColorField& ColorField::operator = (const ColorField &rclCF)
|
||||
|
@ -160,6 +165,7 @@ void ColorField::interpolate (Color clCol1, unsigned short usInd1, Color clCol2,
|
|||
|
||||
ColorGradient::ColorGradient (void)
|
||||
: _tColorModel(TRIA),
|
||||
_tStyle(ZERO_BASED),
|
||||
_bOutsideGrayed(false),
|
||||
_clTotal(ColorModelTria()),
|
||||
_clTop(ColorModelTriaTop()),
|
||||
|
@ -171,6 +177,7 @@ ColorGradient::ColorGradient (void)
|
|||
|
||||
ColorGradient::ColorGradient (float fMin, float fMax, unsigned short usCtColors, TStyle tS, bool bOG)
|
||||
: _tColorModel(TRIA),
|
||||
_tStyle(tS),
|
||||
_bOutsideGrayed(false),
|
||||
_clTotal(ColorModelTria()),
|
||||
_clTop(ColorModelTriaTop()),
|
||||
|
@ -181,12 +188,18 @@ ColorGradient::ColorGradient (float fMin, float fMax, unsigned short usCtColors,
|
|||
}
|
||||
|
||||
ColorGradient::ColorGradient (const ColorGradient &rclCR)
|
||||
: _tColorModel(TRIA),
|
||||
_clTotal(ColorModelTria()),
|
||||
_clTop(ColorModelTriaTop()),
|
||||
_clBottom(ColorModelTriaBottom())
|
||||
: _clColFld1(rclCR._clColFld1),
|
||||
_clColFld2(rclCR._clColFld2),
|
||||
_tColorModel(rclCR._tColorModel),
|
||||
_tStyle(rclCR._tStyle),
|
||||
_fMin(rclCR._fMin),
|
||||
_fMax(rclCR._fMax),
|
||||
_usCtColors(rclCR._usCtColors),
|
||||
_bOutsideGrayed(rclCR._bOutsideGrayed),
|
||||
_clTotal(rclCR._clTotal),
|
||||
_clTop(rclCR._clTop),
|
||||
_clBottom(rclCR._clBottom)
|
||||
{
|
||||
*this = rclCR;
|
||||
}
|
||||
|
||||
ColorGradient& ColorGradient::operator = (const ColorGradient &rclCR)
|
||||
|
@ -245,9 +258,9 @@ unsigned short ColorGradient::getMinColors (void) const
|
|||
{
|
||||
switch (_tStyle)
|
||||
{
|
||||
case FLOW:
|
||||
case FLOW:
|
||||
return _clColFld1.getMinColors();
|
||||
case ZERO_BASED:
|
||||
case ZERO_BASED:
|
||||
{
|
||||
if ((_fMin < 0.0f) && (_fMax > 0.0f))
|
||||
return _clColFld1.getMinColors() + _clColFld2.getMinColors();
|
||||
|
@ -301,13 +314,13 @@ void ColorGradient::setColorModel (void)
|
|||
|
||||
switch (_tStyle)
|
||||
{
|
||||
case FLOW:
|
||||
case FLOW:
|
||||
{
|
||||
_clColFld1.setColorModel(_clTotal);
|
||||
_clColFld2.setColorModel(_clBottom);
|
||||
break;
|
||||
}
|
||||
case ZERO_BASED:
|
||||
case ZERO_BASED:
|
||||
{
|
||||
_clColFld1.setColorModel(_clTop);
|
||||
_clColFld2.setColorModel(_clBottom);
|
||||
|
|
|
@ -1388,7 +1388,8 @@ bool Document::save (void)
|
|||
fn = str.str();
|
||||
}
|
||||
|
||||
fi.renameFile(fn.c_str());
|
||||
if (fi.renameFile(fn.c_str()) == false)
|
||||
Base::Console().Warning("Cannot rename project file to backup file\n");
|
||||
}
|
||||
else {
|
||||
fi.deleteFile();
|
||||
|
|
|
@ -97,7 +97,7 @@ private:
|
|||
};
|
||||
}
|
||||
|
||||
MergeDocuments::MergeDocuments(App::Document* doc) : guiup(false), appdoc(doc)
|
||||
MergeDocuments::MergeDocuments(App::Document* doc) : guiup(false), verbose(true), stream(0), appdoc(doc)
|
||||
{
|
||||
connectExport = doc->signalExportObjects.connect
|
||||
(boost::bind(&MergeDocuments::exportObject, this, _1, _2));
|
||||
|
|
|
@ -90,7 +90,7 @@ std::string PropertyFileIncluded::getDocTransientPath(void) const
|
|||
std::string path;
|
||||
PropertyContainer *co = getContainer();
|
||||
if (co->isDerivedFrom(DocumentObject::getClassTypeId())) {
|
||||
path = dynamic_cast<DocumentObject*>(co)->getDocument()->TransientDir.getValue();
|
||||
path = static_cast<DocumentObject*>(co)->getDocument()->TransientDir.getValue();
|
||||
std::replace(path.begin(), path.end(), '\\', '/');
|
||||
}
|
||||
return path;
|
||||
|
|
|
@ -39,7 +39,7 @@ using namespace App;
|
|||
PROPERTY_SOURCE(App::VRMLObject, App::GeoFeature)
|
||||
|
||||
|
||||
VRMLObject::VRMLObject()
|
||||
VRMLObject::VRMLObject() : index(0)
|
||||
{
|
||||
ADD_PROPERTY_TYPE(VrmlFile,(0),"",Prop_None,"Included file with the VRML definition");
|
||||
ADD_PROPERTY_TYPE(Urls,(""),"",static_cast<PropertyType>(Prop_ReadOnly|Prop_Output|Prop_Transient),
|
||||
|
|
|
@ -125,7 +125,7 @@ inline void Assert(int expr, char *msg) // C++ assert
|
|||
/// some basic python macros
|
||||
#define Py_NEWARGS 1
|
||||
/// return with no return value if nothing happens
|
||||
#define Py_Return Py_INCREF(Py_None); return Py_None;
|
||||
#define Py_Return return Py_INCREF(Py_None), Py_None
|
||||
/// returns an error
|
||||
#define Py_Error(E, M) {PyErr_SetString(E, M); return NULL;}
|
||||
/// checks on a condition and returns an error on failure
|
||||
|
|
|
@ -910,7 +910,7 @@ PyObject* MeshPy::removeNonManifolds(PyObject *args)
|
|||
if (!PyArg_ParseTuple(args, ""))
|
||||
return NULL;
|
||||
getMeshObjectPtr()->removeNonManifolds();
|
||||
Py_Return
|
||||
Py_Return;
|
||||
}
|
||||
|
||||
PyObject* MeshPy::removeNonManifoldPoints(PyObject *args)
|
||||
|
@ -918,7 +918,7 @@ PyObject* MeshPy::removeNonManifoldPoints(PyObject *args)
|
|||
if (!PyArg_ParseTuple(args, ""))
|
||||
return NULL;
|
||||
getMeshObjectPtr()->removeNonManifoldPoints();
|
||||
Py_Return
|
||||
Py_Return;
|
||||
}
|
||||
|
||||
PyObject* MeshPy::hasSelfIntersections(PyObject *args)
|
||||
|
|
Loading…
Reference in New Issue
Block a user