mitigated most clang-tidy warnings in headers (#4175)

This commit is contained in:
Oliver Stöneberg 2022-07-26 11:10:03 +02:00 committed by GitHub
parent 58d7185d64
commit 887463855b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 29 additions and 29 deletions

View File

@ -45,23 +45,23 @@ public:
* @brief Create the report (file).
* @return true if succeeded, false if file could not be created.
*/
virtual bool create() override;
bool create() override;
/**
* @brief Write report header.
*/
virtual void writeHeader() override;
void writeHeader() override;
/**
* @brief Write report footer.
*/
virtual void writeFooter() override;
void writeFooter() override;
/**
* @brief Write error to report.
* @param error Error data.
*/
virtual void writeError(const ErrorItem &error) override;
void writeError(const ErrorItem &error) override;
private:

View File

@ -40,23 +40,23 @@ public:
* @brief Create the report (file).
* @return true if succeeded, false if file could not be created.
*/
virtual bool create() override;
bool create() override;
/**
* @brief Write report header.
*/
virtual void writeHeader() override;
void writeHeader() override;
/**
* @brief Write report footer.
*/
virtual void writeFooter() override;
void writeFooter() override;
/**
* @brief Write error to report.
* @param error Error data.
*/
virtual void writeError(const ErrorItem &error) override;
void writeError(const ErrorItem &error) override;
/**
* @brief Returns the formatted report.

View File

@ -37,7 +37,7 @@ class ScratchPad : public QDialog {
Q_OBJECT
public:
explicit ScratchPad(MainWindow& mainWindow);
~ScratchPad();
~ScratchPad() override;
/**
* @brief Translate dialog

View File

@ -46,23 +46,23 @@ public:
* @brief Create the report (file).
* @return true if succeeded, false if file could not be created.
*/
virtual bool create() override;
bool create() override;
/**
* @brief Write report header.
*/
virtual void writeHeader() override;
void writeHeader() override;
/**
* @brief Write report footer.
*/
virtual void writeFooter() override;
void writeFooter() override;
/**
* @brief Write error to report.
* @param error Error data.
*/
virtual void writeError(const ErrorItem &error) override;
void writeError(const ErrorItem &error) override;
private:

View File

@ -45,33 +45,33 @@ public:
* @brief Create the report (file).
* @return true if succeeded, false if file could not be created.
*/
virtual bool create() override;
bool create() override;
/**
* @brief Open existing report file.
*/
virtual bool open() override;
bool open() override;
/**
* @brief Write report header.
*/
virtual void writeHeader() override;
void writeHeader() override;
/**
* @brief Write report footer.
*/
virtual void writeFooter() override;
void writeFooter() override;
/**
* @brief Write error to report.
* @param error Error data.
*/
virtual void writeError(const ErrorItem &error) override;
void writeError(const ErrorItem &error) override;
/**
* @brief Read contents of the report file.
*/
virtual QList<ErrorItem> read() override;
QList<ErrorItem> read() override;
protected:
/**

View File

@ -122,8 +122,8 @@ struct CWE {
unsigned short id;
};
typedef std::pair<const Token *, std::string> ErrorPathItem;
typedef std::list<ErrorPathItem> ErrorPath;
using ErrorPathItem = std::pair<const Token *, std::string>;
using ErrorPath = std::list<ErrorPathItem>;
/// @}
//---------------------------------------------------------------------------

View File

@ -478,7 +478,7 @@ public:
std::vector<std::string> defines; // to provide some library defines
struct SmartPointer {
std::string name = "";
std::string name;
bool unique = false;
};

View File

@ -66,8 +66,8 @@ public:
value shiftRight(const value &v) const;
};
typedef long long bigint;
typedef unsigned long long biguint;
using bigint = long long;
using biguint = unsigned long long;
static const int bigint_bits;
static bigint toLongNumber(const std::string & str);

View File

@ -1490,8 +1490,8 @@ private:
Function *findFunctionInScope(const Token *func, const Scope *ns, const std::string & path, nonneg int path_length);
const Type *findVariableTypeInBase(const Scope *scope, const Token *typeTok) const;
typedef std::map<unsigned int, unsigned int> MemberIdMap;
typedef std::map<unsigned int, MemberIdMap> VarIdMap;
using MemberIdMap = std::map<unsigned int, unsigned int>;
using VarIdMap = std::map<unsigned int, MemberIdMap>;
void fixVarId(VarIdMap & varIds, const Token * vartok, Token * membertok, const Variable * membervar);

View File

@ -242,7 +242,7 @@ public:
bool isSameFamily(const TemplateSimplifier::TokenAndName &decl) const {
// Make sure a family flag is set and matches.
// This works because at most only one flag will be set.
return ((mFlags & fFamilyMask) & (decl.mFlags & fFamilyMask)) != 0;
return ((mFlags & fFamilyMask) && (decl.mFlags & fFamilyMask));
}
};

View File

@ -83,8 +83,8 @@ namespace ValueFlow {
};
class CPPCHECKLIB Value {
public:
typedef std::pair<const Token *, std::string> ErrorPathItem;
typedef std::list<ErrorPathItem> ErrorPath;
using ErrorPathItem = std::pair<const Token *, std::string>;
using ErrorPath = std::list<ErrorPathItem>;
enum class Bound { Upper, Lower, Point };
explicit Value(long long val = 0, Bound b = Bound::Point)