Base: fix several warnings reported by code analyzers

This commit is contained in:
wmayer
2022-08-02 13:04:50 +02:00
parent c6de515b20
commit 7824d7b1df
9 changed files with 40 additions and 27 deletions

View File

@@ -446,7 +446,7 @@ ConsoleSingleton & ConsoleSingleton::Instance()
//**************************************************************************
// Python stuff
// ConsoleSingleton Methods // Methods structure
// ConsoleSingleton Methods structure
PyMethodDef ConsoleSingleton::Methods[] = {
{"PrintMessage", ConsoleSingleton::sPyMessage, METH_VARARGS,
"PrintMessage(obj) -> None\n\n"
@@ -479,7 +479,7 @@ PyMethodDef ConsoleSingleton::Methods[] = {
{"GetObservers", ConsoleSingleton::sPyGetObservers, METH_VARARGS,
"GetObservers() -> list of str\n\n"
"Get the names of the current logging interfaces."},
{nullptr, nullptr, 0, nullptr} /* Sentinel */
{nullptr, nullptr, 0, nullptr} /* Sentinel */
};
namespace {

View File

@@ -48,7 +48,7 @@ namespace Base {
btn->setText("Continue");
btn->show();
Base::Debugger dbg;
connect(btn, SIGNAL(clicked()), &dbg, SLOT(quit()));
connect(btn, &QPushButton::clicked, &dbg, &Debugger::quit);
dbg.exec();
\endcode
\author Werner Mayer
@@ -61,9 +61,14 @@ public:
Debugger(QObject* parent=nullptr);
~Debugger() override;
Debugger(const Debugger&) = delete;
Debugger(Debugger&&) = delete;
Debugger& operator= (const Debugger&) = delete;
Debugger& operator= (Debugger&&) = delete;
void attach();
void detach();
bool eventFilter(QObject*, QEvent*) override;
bool eventFilter(QObject* obj, QEvent* event) override;
int exec();
public Q_SLOTS:

View File

@@ -39,8 +39,13 @@ public:
FutureWatcherProgress(const char* text, unsigned int steps);
~FutureWatcherProgress() override;
FutureWatcherProgress(const FutureWatcherProgress&) = delete;
FutureWatcherProgress(FutureWatcherProgress&&) = delete;
FutureWatcherProgress& operator= (const FutureWatcherProgress&) = delete;
FutureWatcherProgress& operator= (FutureWatcherProgress&&) = delete;
private Q_SLOTS:
void progressValueChanged(int v);
void progressValueChanged(int value);
private:
Base::SequencerLauncher seq;

View File

@@ -686,11 +686,11 @@ int InterpreterSingleton::runCommandLine(const char *prompt)
void InterpreterSingleton::runMethodVoid(PyObject *pobject, const char *method)
{
PyGILStateLocker locker;
if (PP_Run_Method(pobject , // object
method, // run method
nullptr, // no return type
nullptr, // so no return object
"()") // no arguments
if (PP_Run_Method(pobject , // object
method, // run method
nullptr, // no return type
nullptr, // so no return object
"()") // no arguments
!= 0)
throw PyException(/*"Error running InterpreterSingleton::RunMethodVoid()"*/);
@@ -701,11 +701,11 @@ PyObject* InterpreterSingleton::runMethodObject(PyObject *pobject, const char *m
PyObject *pcO;
PyGILStateLocker locker;
if (PP_Run_Method(pobject , // object
method, // run method
"O", // return type
&pcO, // return object
"()") // no arguments
if (PP_Run_Method(pobject , // object
method, // run method
"O", // return type
&pcO, // return object
"()") // no arguments
!= 0)
throw PyException();

View File

@@ -287,13 +287,15 @@ inline Matrix4D Matrix4D::operator * (const Matrix4D& rclMtrx) const
Matrix4D clMat;
unsigned short ie, iz, is;
for (iz = 0; iz < 4; iz++)
for (iz = 0; iz < 4; iz++) {
for (is = 0; is < 4; is++) {
clMat.dMtrx4D[iz][is] = 0;
for (ie = 0; ie < 4; ie++)
clMat.dMtrx4D[iz][is] += dMtrx4D[iz][ie] *
for (ie = 0; ie < 4; ie++) {
clMat.dMtrx4D[iz][is] += dMtrx4D[iz][ie] *
rclMtrx.dMtrx4D[ie][is];
}
}
}
return clMat;
}

View File

@@ -796,9 +796,9 @@ void ParameterGrp::RemoveBlob(const char* /*Name*/)
DOMElement *pcElem = FindElement(_pGroupNode,"FCGrp",Name);
// if not return
if(!pcElem)
return;
return;
else
_pGroupNode->removeChild(pcElem);
_pGroupNode->removeChild(pcElem);
*/
}
@@ -1643,10 +1643,10 @@ short DOMPrintFilter::acceptNode(const DOMNode* node) const
case DOMNode::ELEMENT_NODE: {
// for element whose name is "person", skip it
//if (XMLString::compareString(node->getNodeName(), element_person)==0)
// return DOMNodeFilter::FILTER_SKIP;
// return DOMNodeFilter::FILTER_SKIP;
// for element whose name is "line", reject it
//if (XMLString::compareString(node->getNodeName(), element_link)==0)
// return DOMNodeFilter::FILTER_REJECT;
// return DOMNodeFilter::FILTER_REJECT;
// for rest, accept it
return DOMNodeFilter::FILTER_ACCEPT;

View File

@@ -249,7 +249,7 @@ public:
static Quantity MilliNewtonPerMeter;
static Quantity KiloNewtonPerMeter;
static Quantity MegaNewtonPerMeter;
static Quantity Pascal;
static Quantity KiloPascal;
static Quantity MegaPascal;

View File

@@ -131,7 +131,7 @@ public:
static Unit YoungsModulus;
static Unit Stiffness;
static Unit Force;
static Unit Work;
static Unit Power;

View File

@@ -18,11 +18,11 @@
// ============================================================================
//
// File : gzstream.h
// Revision : Revision: 1.5
// Revision : Revision: 1.5
// Revision_date : Date: 2002/04/26 23:30:15
// Author(s) : Deepak Bandyopadhyay, Lutz Kettner
//
// Standard streambuf implementation following Nicolai Josuttis, "The
//
// Standard streambuf implementation following Nicolai Josuttis, "The
// Standard C++ Library".
// ============================================================================
@@ -31,6 +31,7 @@
#include <sstream>
#include <zlib.h>
#include <FCGlobal.h>
#ifdef _MSC_VER
using std::ostream;