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). * @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:

View File

@ -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.

View File

@ -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

View File

@ -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:

View File

@ -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:
/** /**

View File

@ -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>;
/// @} /// @}
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------

View File

@ -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;
}; };

View File

@ -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);

View File

@ -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);

View File

@ -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));
} }
}; };

View File

@ -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)