diff --git a/src/Base/AxisPyImp.cpp b/src/Base/AxisPyImp.cpp index 57de505bf5..9c652ba75b 100644 --- a/src/Base/AxisPyImp.cpp +++ b/src/Base/AxisPyImp.cpp @@ -47,7 +47,7 @@ std::string AxisPy::representation() const return str.str(); } -PyObject* AxisPy::PyMake(struct _typeobject*, PyObject*, PyObject*) // Python wrapper +PyObject* AxisPy::PyMake(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) { // create a new instance of AxisPy and the Twin object return new AxisPy(new Axis); diff --git a/src/Base/BaseClass.cpp b/src/Base/BaseClass.cpp index 2d6f024aca..301cb5c33b 100644 --- a/src/Base/BaseClass.cpp +++ b/src/Base/BaseClass.cpp @@ -106,11 +106,8 @@ void BaseClass::initSubclass(Base::Type& toInit, */ PyObject* BaseClass::getPyObject() { - assert(0); Py_Return; } -void BaseClass::setPyObject(PyObject*) -{ - assert(0); -} +void BaseClass::setPyObject(PyObject* /*unused*/) +{} diff --git a/src/Base/BoundBoxPyImp.cpp b/src/Base/BoundBoxPyImp.cpp index 8dbeabd605..f2b7b0bb00 100644 --- a/src/Base/BoundBoxPyImp.cpp +++ b/src/Base/BoundBoxPyImp.cpp @@ -45,7 +45,7 @@ std::string BoundBoxPy::representation() const return str.str(); } -PyObject* BoundBoxPy::PyMake(struct _typeobject*, PyObject*, PyObject*) // Python wrapper +PyObject* BoundBoxPy::PyMake(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) { // create a new instance of BoundBoxPy and the Twin object return new BoundBoxPy(new BoundBox3d); diff --git a/src/Base/Builder3D.cpp b/src/Base/Builder3D.cpp index 550308ebe8..c46dae7691 100644 --- a/src/Base/Builder3D.cpp +++ b/src/Base/Builder3D.cpp @@ -456,9 +456,9 @@ void ArrowItem::write(InventorOutput& out) const dir.Scale(sf2, sf2, sf2); Vector3f cpt = line.p1 + dir; - Vector3f rot = Vector3f(0.0f, 1.0f, 0.0f) % dir; + Vector3f rot = Vector3f(0.0F, 1.0F, 0.0F) % dir; rot.Normalize(); - float angle = Vector3f(0.0f, 1.0f, 0.0f).GetAngle(dir); + float angle = Vector3f(0.0F, 1.0F, 0.0F).GetAngle(dir); out.write() << "Separator {\n"; out.write() << " Material { diffuseColor " << rgb.red() << " " << rgb.green() << " " diff --git a/src/Base/CoordinateSystemPyImp.cpp b/src/Base/CoordinateSystemPyImp.cpp index 7afd90484c..23dfb0a101 100644 --- a/src/Base/CoordinateSystemPyImp.cpp +++ b/src/Base/CoordinateSystemPyImp.cpp @@ -38,7 +38,8 @@ std::string CoordinateSystemPy::representation() const return {""}; } -PyObject* CoordinateSystemPy::PyMake(struct _typeobject*, PyObject*, PyObject*) // Python wrapper +PyObject* +CoordinateSystemPy::PyMake(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) { // create a new instance of CoordinateSystemPy and the Twin object return new CoordinateSystemPy(new CoordinateSystem); diff --git a/src/Base/Debugger.cpp b/src/Base/Debugger.cpp index 94c6d9c9c6..302b4f9311 100644 --- a/src/Base/Debugger.cpp +++ b/src/Base/Debugger.cpp @@ -51,7 +51,7 @@ void Debugger::detach() isAttached = false; } -bool Debugger::eventFilter(QObject*, QEvent* event) +bool Debugger::eventFilter(QObject* /*watched*/, QEvent* event) { if (event->type() == QEvent::KeyPress) { if (loop.isRunning()) { diff --git a/src/Base/Handle.cpp b/src/Base/Handle.cpp index b64d10d7d2..9a8e7589f0 100644 --- a/src/Base/Handle.cpp +++ b/src/Base/Handle.cpp @@ -76,7 +76,7 @@ int Handled::getRefCount() const return static_cast(*_lRefCount); } -Handled& Handled::operator=(const Handled&) +Handled& Handled::operator=(const Handled& /*unused*/) { // we must not assign _lRefCount return *this; diff --git a/src/Base/Matrix.h b/src/Base/Matrix.h index c74eb1a147..c802af8dbd 100644 --- a/src/Base/Matrix.h +++ b/src/Base/Matrix.h @@ -98,8 +98,8 @@ public: inline Vector3d operator*(const Vector3d& vec) const; inline void multVec(const Vector3d& src, Vector3d& dst) const; inline void multVec(const Vector3f& src, Vector3f& dst) const; - inline Matrix4D operator*(double) const; - inline Matrix4D& operator*=(double); + inline Matrix4D operator*(double scalar) const; + inline Matrix4D& operator*=(double scalar); /// Comparison inline bool operator!=(const Matrix4D& mat) const; /// Comparison @@ -119,11 +119,11 @@ public: /// Get trace of the 4x4 matrix inline double trace() const; /// Set row to vector - inline void setRow(unsigned short usNdx, const Vector3d&); + inline void setRow(unsigned short usNdx, const Vector3d& vec); /// Set column to vector - inline void setCol(unsigned short usNdx, const Vector3d&); + inline void setCol(unsigned short usNdx, const Vector3d& vec); /// Set diagonal to vector - inline void setDiagonal(const Vector3d&); + inline void setDiagonal(const Vector3d& vec); /// Compute the determinant of the matrix double determinant() const; /// Compute the determinant of the 3x3 sub-matrix diff --git a/src/Base/MatrixPyImp.cpp b/src/Base/MatrixPyImp.cpp index 9dc8a5fb32..a279a8ec03 100644 --- a/src/Base/MatrixPyImp.cpp +++ b/src/Base/MatrixPyImp.cpp @@ -52,7 +52,7 @@ std::string MatrixPy::representation() const return str.str(); } -PyObject* MatrixPy::PyMake(struct _typeobject*, PyObject*, PyObject*) // Python wrapper +PyObject* MatrixPy::PyMake(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) { // create a new instance of MatrixPy and the Twin object return new MatrixPy(new Matrix4D); diff --git a/src/Base/Parameter.cpp b/src/Base/Parameter.cpp index 98dd8ccc53..d67aedd2ce 100644 --- a/src/Base/Parameter.cpp +++ b/src/Base/Parameter.cpp @@ -121,7 +121,7 @@ public: //@{ /** @ interface from DOMWriterFilter */ - FilterAction acceptNode(const XERCES_CPP_NAMESPACE_QUALIFIER DOMNode*) const override; + FilterAction acceptNode(const XERCES_CPP_NAMESPACE_QUALIFIER DOMNode* node) const override; //@{ ShowType getWhatToShow() const override @@ -2007,7 +2007,7 @@ void ParameterManager::CheckDocument() const // DOMTreeErrorReporter //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -void DOMTreeErrorReporter::warning(const SAXParseException&) +void DOMTreeErrorReporter::warning(const SAXParseException& /*exc*/) { // // Ignore all warnings. diff --git a/src/Base/PlacementPyImp.cpp b/src/Base/PlacementPyImp.cpp index b2d34a6865..4802987224 100644 --- a/src/Base/PlacementPyImp.cpp +++ b/src/Base/PlacementPyImp.cpp @@ -52,7 +52,7 @@ std::string PlacementPy::representation() const return str.str(); } -PyObject* PlacementPy::PyMake(struct _typeobject*, PyObject*, PyObject*) // Python wrapper +PyObject* PlacementPy::PyMake(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) { // create a new instance of PlacementPy and the Twin object return new PlacementPy(new Placement); diff --git a/src/Base/ProgressIndicatorPy.cpp b/src/Base/ProgressIndicatorPy.cpp index a28e3183bc..fffed5ff2e 100644 --- a/src/Base/ProgressIndicatorPy.cpp +++ b/src/Base/ProgressIndicatorPy.cpp @@ -58,7 +58,8 @@ bool ProgressIndicatorPy::check(PyObject* py) return Py::PythonExtension::check(py); } -PyObject* ProgressIndicatorPy::PyMake(struct _typeobject*, PyObject*, PyObject*) +PyObject* +ProgressIndicatorPy::PyMake(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) { return new ProgressIndicatorPy(); } diff --git a/src/Base/QuantityPyImp.cpp b/src/Base/QuantityPyImp.cpp index e7b9c24fe0..a1b7387392 100644 --- a/src/Base/QuantityPyImp.cpp +++ b/src/Base/QuantityPyImp.cpp @@ -69,7 +69,7 @@ PyObject* QuantityPy::toStr(PyObject* args) return Py_BuildValue("s", ret.str().c_str()); } -PyObject* QuantityPy::PyMake(struct _typeobject*, PyObject*, PyObject*) // Python wrapper +PyObject* QuantityPy::PyMake(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) { // create a new instance of QuantityPy and the Twin object return new QuantityPy(new Quantity); diff --git a/src/Base/Reader.cpp b/src/Base/Reader.cpp index d3036492a8..6b6068bf12 100644 --- a/src/Base/Reader.cpp +++ b/src/Base/Reader.cpp @@ -504,7 +504,7 @@ bool Base::XMLReader::isRegistered(Base::Persistence* Object) const return false; } -void Base::XMLReader::addName(const char*, const char*) +void Base::XMLReader::addName(const char* /*unused*/, const char* /*unused*/) {} const char* Base::XMLReader::getName(const char* name) const diff --git a/src/Base/RotationPyImp.cpp b/src/Base/RotationPyImp.cpp index 5fabe4e560..fdd3f5555e 100644 --- a/src/Base/RotationPyImp.cpp +++ b/src/Base/RotationPyImp.cpp @@ -53,7 +53,7 @@ std::string RotationPy::representation() const return str.str(); } -PyObject* RotationPy::PyMake(struct _typeobject*, PyObject*, PyObject*) // Python wrapper +PyObject* RotationPy::PyMake(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) { // create a new instance of RotationPy and the Twin object return new RotationPy(new Rotation); diff --git a/src/Base/Sequencer.cpp b/src/Base/Sequencer.cpp index 5dfaf4027a..4d41dc0009 100644 --- a/src/Base/Sequencer.cpp +++ b/src/Base/Sequencer.cpp @@ -119,8 +119,8 @@ void SequencerBase::startStep() bool SequencerBase::next(bool canAbort) { this->nProgress++; - float fDiv = this->nTotalSteps > 0 ? static_cast(this->nTotalSteps) : 1000.0f; - int perc = int((float(this->nProgress) * (100.0f / fDiv))); + float fDiv = this->nTotalSteps > 0 ? static_cast(this->nTotalSteps) : 1000.0F; + int perc = int((float(this->nProgress) * (100.0F / fDiv))); // do only an update if we have increased by one percent if (perc > this->_nLastPercentage) { @@ -135,10 +135,10 @@ bool SequencerBase::next(bool canAbort) return this->nProgress < this->nTotalSteps; } -void SequencerBase::nextStep(bool) +void SequencerBase::nextStep(bool /*next*/) {} -void SequencerBase::setProgress(size_t) +void SequencerBase::setProgress(size_t /*value*/) {} bool SequencerBase::stop() @@ -204,7 +204,7 @@ void SequencerBase::resetData() this->_bCanceled = false; } -void SequencerBase::setText(const char*) +void SequencerBase::setText(const char* /*text*/) {} // --------------------------------------------------------- @@ -219,7 +219,7 @@ void ConsoleSequencer::setText(const char* pszTxt) void ConsoleSequencer::startStep() {} -void ConsoleSequencer::nextStep(bool) +void ConsoleSequencer::nextStep(bool /*canAbort*/) { if (this->nTotalSteps != 0) { printf("\t\t\t\t\t\t(%d %%)\t\r", progressInPercent()); diff --git a/src/Base/Stream.h b/src/Base/Stream.h index 511989d6b4..3db89acedf 100644 --- a/src/Base/Stream.h +++ b/src/Base/Stream.h @@ -299,7 +299,7 @@ protected: int_type overflow(int_type c = EOF) override; std::streamsize xsputn(const char* s, std::streamsize num) override; int sync() override; - pos_type seekoff(off_type offset, seekdir dir, openmode) override; + pos_type seekoff(off_type offset, seekdir dir, openmode mode) override; pos_type seekpos(pos_type offset, openmode mode) override; private: diff --git a/src/Base/Swap.cpp b/src/Base/Swap.cpp index 26cdb337bb..41734b48b3 100644 --- a/src/Base/Swap.cpp +++ b/src/Base/Swap.cpp @@ -31,10 +31,10 @@ unsigned short Base::SwapOrder() return *((char*)&usDummy) == 1 ? LOW_ENDIAN : HIGH_ENDIAN; } -void Base::SwapVar(char&) +void Base::SwapVar(char& /*unused*/) {} -void Base::SwapVar(unsigned char&) +void Base::SwapVar(unsigned char& /*unused*/) {} void Base::SwapVar(short& s) diff --git a/src/Base/TimeInfo.cpp b/src/Base/TimeInfo.cpp index b89e8d5c58..6a16eed8f0 100644 --- a/src/Base/TimeInfo.cpp +++ b/src/Base/TimeInfo.cpp @@ -95,7 +95,7 @@ float TimeInfo::diffTimeF(const TimeInfo& timeStart, const TimeInfo& timeEnd) int64_t ds = int64_t(timeEnd.getSeconds() - timeStart.getSeconds()); int dms = int(timeEnd.getMiliseconds()) - int(timeStart.getMiliseconds()); - return float(ds) + float(dms) * 0.001f; + return float(ds) + float(dms) * 0.001F; } TimeInfo TimeInfo::null() diff --git a/src/Base/Tools2D.h b/src/Base/Tools2D.h index a61c9e7526..396e42cd40 100644 --- a/src/Base/Tools2D.h +++ b/src/Base/Tools2D.h @@ -113,7 +113,7 @@ public: inline BoundBox2d(double fX1, double fY1, double fX2, double fY2); ~BoundBox2d() = default; inline bool IsValid(); - inline bool IsEqual(const BoundBox2d&, double tolerance) const; + inline bool IsEqual(const BoundBox2d& bbox, double tolerance) const; // operators inline BoundBox2d& operator=(const BoundBox2d&) = default; @@ -471,16 +471,18 @@ inline bool BoundBox2d::IsValid() return (MaxX >= MinX) && (MaxY >= MinY); } -inline bool BoundBox2d::IsEqual(const BoundBox2d& b, double tolerance) const +inline bool BoundBox2d::IsEqual(const BoundBox2d& bbox, double tolerance) const { - return Vector2d(MinX, MinY).IsEqual(Vector2d(b.MinX, b.MinY), tolerance) - && Vector2d(MaxX, MaxY).IsEqual(Vector2d(b.MaxX, b.MaxY), tolerance); + return Vector2d(MinX, MinY).IsEqual(Vector2d(bbox.MinX, bbox.MinY), tolerance) + && Vector2d(MaxX, MaxY).IsEqual(Vector2d(bbox.MaxX, bbox.MaxY), tolerance); } -inline bool BoundBox2d::operator==(const BoundBox2d& rclBB) const +inline bool BoundBox2d::operator==(const BoundBox2d& bbox) const { - return (MinX == rclBB.MinX) && (MinY == rclBB.MinY) && (MaxX == rclBB.MaxX) - && (MaxY == rclBB.MaxY); + // clang-format off + return (MinX == bbox.MinX) && (MinY == bbox.MinY) + && (MaxX == bbox.MaxX) && (MaxY == bbox.MaxY); + // clang-format on } inline double BoundBox2d::Width() const diff --git a/src/Base/UnitPyImp.cpp b/src/Base/UnitPyImp.cpp index a658aa83f6..e8db65865a 100644 --- a/src/Base/UnitPyImp.cpp +++ b/src/Base/UnitPyImp.cpp @@ -54,7 +54,7 @@ std::string UnitPy::representation() const return ret.str(); } -PyObject* UnitPy::PyMake(struct _typeobject*, PyObject*, PyObject*) // Python wrapper +PyObject* UnitPy::PyMake(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) { // create a new instance of UnitPy and the Twin object return new UnitPy(new Unit); diff --git a/src/Base/VectorPyImp.cpp b/src/Base/VectorPyImp.cpp index 5ce642fbf7..7329508373 100644 --- a/src/Base/VectorPyImp.cpp +++ b/src/Base/VectorPyImp.cpp @@ -52,7 +52,7 @@ std::string VectorPy::representation() const return str.str(); } -PyObject* VectorPy::PyMake(struct _typeobject*, PyObject*, PyObject*) // Python wrapper +PyObject* VectorPy::PyMake(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) { // create a new instance of VectorPy and the Twin object return new VectorPy(new Vector3d); @@ -174,7 +174,7 @@ PyObject* VectorPy::number_multiply_handler(PyObject* self, PyObject* other) } } -Py_ssize_t VectorPy::sequence_length(PyObject*) +Py_ssize_t VectorPy::sequence_length(PyObject* /*unused*/) { return 3; } diff --git a/src/Base/ViewProj.cpp b/src/Base/ViewProj.cpp index defbe43455..c679e9a46c 100644 --- a/src/Base/ViewProj.cpp +++ b/src/Base/ViewProj.cpp @@ -136,7 +136,7 @@ Vector3f ViewProjMatrix::operator()(const Vector3f& inp) const if (!isOrthographic) { dst = src; perspectiveTransform(_clMtx, dst); - dst.Set(0.5f * dst.x + 0.5f, 0.5f * dst.y + 0.5f, 0.5f * dst.z + 0.5f); + dst.Set(0.5F * dst.x + 0.5F, 0.5F * dst.y + 0.5F, 0.5F * dst.z + 0.5F); } else { _clMtx.multVec(src, dst); @@ -167,7 +167,7 @@ Vector3f ViewProjMatrix::inverse(const Vector3f& src) const { Vector3f dst; if (!isOrthographic) { - dst.Set(2.0f * src.x - 1.0f, 2.0f * src.y - 1.0f, 2.0f * src.z - 1.0f); + dst.Set(2.0F * src.x - 1.0F, 2.0F * src.y - 1.0F, 2.0F * src.z - 1.0F); perspectiveTransform(_clMtxInv, dst); } else { diff --git a/src/Base/Writer.cpp b/src/Base/Writer.cpp index 58c277cf12..ef3b87f6df 100644 --- a/src/Base/Writer.cpp +++ b/src/Base/Writer.cpp @@ -378,7 +378,7 @@ void FileWriter::putNextEntry(const char* file) this->FileStream.open(fileName.c_str(), std::ios::out | std::ios::binary); } -bool FileWriter::shouldWrite(const std::string&, const Base::Persistence*) const +bool FileWriter::shouldWrite(const std::string& /*name*/, const Base::Persistence* /*obj*/) const { return true; }