mitigated most clang-tidy warnings in headers (#4175)
This commit is contained in:
parent
58d7185d64
commit
887463855b
|
@ -45,23 +45,23 @@ public:
|
||||||
* @brief Create the report (file).
|
* @brief Create the report (file).
|
||||||
* @return true if succeeded, false if file could not be created.
|
* @return true if succeeded, false if file could not be created.
|
||||||
*/
|
*/
|
||||||
virtual bool create() override;
|
bool create() override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Write report header.
|
* @brief Write report header.
|
||||||
*/
|
*/
|
||||||
virtual void writeHeader() override;
|
void writeHeader() override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Write report footer.
|
* @brief Write report footer.
|
||||||
*/
|
*/
|
||||||
virtual void writeFooter() override;
|
void writeFooter() override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Write error to report.
|
* @brief Write error to report.
|
||||||
* @param error Error data.
|
* @param error Error data.
|
||||||
*/
|
*/
|
||||||
virtual void writeError(const ErrorItem &error) override;
|
void writeError(const ErrorItem &error) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|
|
@ -40,23 +40,23 @@ public:
|
||||||
* @brief Create the report (file).
|
* @brief Create the report (file).
|
||||||
* @return true if succeeded, false if file could not be created.
|
* @return true if succeeded, false if file could not be created.
|
||||||
*/
|
*/
|
||||||
virtual bool create() override;
|
bool create() override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Write report header.
|
* @brief Write report header.
|
||||||
*/
|
*/
|
||||||
virtual void writeHeader() override;
|
void writeHeader() override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Write report footer.
|
* @brief Write report footer.
|
||||||
*/
|
*/
|
||||||
virtual void writeFooter() override;
|
void writeFooter() override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Write error to report.
|
* @brief Write error to report.
|
||||||
* @param error Error data.
|
* @param error Error data.
|
||||||
*/
|
*/
|
||||||
virtual void writeError(const ErrorItem &error) override;
|
void writeError(const ErrorItem &error) override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Returns the formatted report.
|
* @brief Returns the formatted report.
|
||||||
|
|
|
@ -37,7 +37,7 @@ class ScratchPad : public QDialog {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit ScratchPad(MainWindow& mainWindow);
|
explicit ScratchPad(MainWindow& mainWindow);
|
||||||
~ScratchPad();
|
~ScratchPad() override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Translate dialog
|
* @brief Translate dialog
|
||||||
|
|
|
@ -46,23 +46,23 @@ public:
|
||||||
* @brief Create the report (file).
|
* @brief Create the report (file).
|
||||||
* @return true if succeeded, false if file could not be created.
|
* @return true if succeeded, false if file could not be created.
|
||||||
*/
|
*/
|
||||||
virtual bool create() override;
|
bool create() override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Write report header.
|
* @brief Write report header.
|
||||||
*/
|
*/
|
||||||
virtual void writeHeader() override;
|
void writeHeader() override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Write report footer.
|
* @brief Write report footer.
|
||||||
*/
|
*/
|
||||||
virtual void writeFooter() override;
|
void writeFooter() override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Write error to report.
|
* @brief Write error to report.
|
||||||
* @param error Error data.
|
* @param error Error data.
|
||||||
*/
|
*/
|
||||||
virtual void writeError(const ErrorItem &error) override;
|
void writeError(const ErrorItem &error) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|
|
@ -45,33 +45,33 @@ public:
|
||||||
* @brief Create the report (file).
|
* @brief Create the report (file).
|
||||||
* @return true if succeeded, false if file could not be created.
|
* @return true if succeeded, false if file could not be created.
|
||||||
*/
|
*/
|
||||||
virtual bool create() override;
|
bool create() override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Open existing report file.
|
* @brief Open existing report file.
|
||||||
*/
|
*/
|
||||||
virtual bool open() override;
|
bool open() override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Write report header.
|
* @brief Write report header.
|
||||||
*/
|
*/
|
||||||
virtual void writeHeader() override;
|
void writeHeader() override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Write report footer.
|
* @brief Write report footer.
|
||||||
*/
|
*/
|
||||||
virtual void writeFooter() override;
|
void writeFooter() override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Write error to report.
|
* @brief Write error to report.
|
||||||
* @param error Error data.
|
* @param error Error data.
|
||||||
*/
|
*/
|
||||||
virtual void writeError(const ErrorItem &error) override;
|
void writeError(const ErrorItem &error) override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Read contents of the report file.
|
* @brief Read contents of the report file.
|
||||||
*/
|
*/
|
||||||
virtual QList<ErrorItem> read() override;
|
QList<ErrorItem> read() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -122,8 +122,8 @@ struct CWE {
|
||||||
unsigned short id;
|
unsigned short id;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef std::pair<const Token *, std::string> ErrorPathItem;
|
using ErrorPathItem = std::pair<const Token *, std::string>;
|
||||||
typedef std::list<ErrorPathItem> ErrorPath;
|
using ErrorPath = std::list<ErrorPathItem>;
|
||||||
|
|
||||||
/// @}
|
/// @}
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
|
@ -478,7 +478,7 @@ public:
|
||||||
std::vector<std::string> defines; // to provide some library defines
|
std::vector<std::string> defines; // to provide some library defines
|
||||||
|
|
||||||
struct SmartPointer {
|
struct SmartPointer {
|
||||||
std::string name = "";
|
std::string name;
|
||||||
bool unique = false;
|
bool unique = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -66,8 +66,8 @@ public:
|
||||||
value shiftRight(const value &v) const;
|
value shiftRight(const value &v) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef long long bigint;
|
using bigint = long long;
|
||||||
typedef unsigned long long biguint;
|
using biguint = unsigned long long;
|
||||||
static const int bigint_bits;
|
static const int bigint_bits;
|
||||||
|
|
||||||
static bigint toLongNumber(const std::string & str);
|
static bigint toLongNumber(const std::string & str);
|
||||||
|
|
|
@ -1490,8 +1490,8 @@ private:
|
||||||
Function *findFunctionInScope(const Token *func, const Scope *ns, const std::string & path, nonneg int path_length);
|
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;
|
const Type *findVariableTypeInBase(const Scope *scope, const Token *typeTok) const;
|
||||||
|
|
||||||
typedef std::map<unsigned int, unsigned int> MemberIdMap;
|
using MemberIdMap = std::map<unsigned int, unsigned int>;
|
||||||
typedef std::map<unsigned int, MemberIdMap> VarIdMap;
|
using VarIdMap = std::map<unsigned int, MemberIdMap>;
|
||||||
|
|
||||||
void fixVarId(VarIdMap & varIds, const Token * vartok, Token * membertok, const Variable * membervar);
|
void fixVarId(VarIdMap & varIds, const Token * vartok, Token * membertok, const Variable * membervar);
|
||||||
|
|
||||||
|
|
|
@ -242,7 +242,7 @@ public:
|
||||||
bool isSameFamily(const TemplateSimplifier::TokenAndName &decl) const {
|
bool isSameFamily(const TemplateSimplifier::TokenAndName &decl) const {
|
||||||
// Make sure a family flag is set and matches.
|
// Make sure a family flag is set and matches.
|
||||||
// This works because at most only one flag will be set.
|
// This works because at most only one flag will be set.
|
||||||
return ((mFlags & fFamilyMask) & (decl.mFlags & fFamilyMask)) != 0;
|
return ((mFlags & fFamilyMask) && (decl.mFlags & fFamilyMask));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -83,8 +83,8 @@ namespace ValueFlow {
|
||||||
};
|
};
|
||||||
class CPPCHECKLIB Value {
|
class CPPCHECKLIB Value {
|
||||||
public:
|
public:
|
||||||
typedef std::pair<const Token *, std::string> ErrorPathItem;
|
using ErrorPathItem = std::pair<const Token *, std::string>;
|
||||||
typedef std::list<ErrorPathItem> ErrorPath;
|
using ErrorPath = std::list<ErrorPathItem>;
|
||||||
enum class Bound { Upper, Lower, Point };
|
enum class Bound { Upper, Lower, Point };
|
||||||
|
|
||||||
explicit Value(long long val = 0, Bound b = Bound::Point)
|
explicit Value(long long val = 0, Bound b = Bound::Point)
|
||||||
|
|
Loading…
Reference in New Issue