diff --git a/lib/checkbufferoverrun.cpp b/lib/checkbufferoverrun.cpp index c6ceb8fd8..13b5e42d9 100644 --- a/lib/checkbufferoverrun.cpp +++ b/lib/checkbufferoverrun.cpp @@ -1832,9 +1832,8 @@ void CheckBufferOverrun::negativeIndex() CheckBufferOverrun::ArrayInfo::ArrayInfo() + : _element_size(0), _varid(0) { - _element_size = 0; - _varid = 0; } CheckBufferOverrun::ArrayInfo::ArrayInfo(const CheckBufferOverrun::ArrayInfo &ai) @@ -1843,9 +1842,8 @@ CheckBufferOverrun::ArrayInfo::ArrayInfo(const CheckBufferOverrun::ArrayInfo &ai } CheckBufferOverrun::ArrayInfo::ArrayInfo(const Variable *var, const Tokenizer *tokenizer) + : _varname(var->name()), _varid(var->varId()) { - _varid = var->varId(); - _varname = var->name(); for (size_t i = 0; i < var->dimensions().size(); i++) _num.push_back(var->dimension(i)); if (var->typeEndToken()->str() == "*") @@ -1874,11 +1872,9 @@ CheckBufferOverrun::ArrayInfo & CheckBufferOverrun::ArrayInfo::operator=(const C * this will not be needed as the declare can be used instead. */ CheckBufferOverrun::ArrayInfo::ArrayInfo(unsigned int id, const std::string &name, MathLib::bigint size1, MathLib::bigint n) + : _element_size(size1), _varid(id), _varname(name) { - _element_size = size1; _num.push_back(n); - _varid = id; - _varname = name; } CheckBufferOverrun::ArrayInfo CheckBufferOverrun::ArrayInfo::limit(MathLib::bigint value) const @@ -1925,10 +1921,8 @@ private: /** internal constructor for creating extra checks */ ExecutionPathBufferOverrun(Check *c, const std::map &arrayinfo, unsigned int varid_) : ExecutionPath(c, varid_), - arrayInfo(arrayinfo) { - // Pretend that variables are initialized to 0 - // This checking is not about uninitialized variables - value = 0; + arrayInfo(arrayinfo), + value(0) { // Pretend that variables are initialized to 0. This checking is not about uninitialized variables. } /** @brief Variable value. */ diff --git a/lib/errorlogger.h b/lib/errorlogger.h index 21cc536bc..9f6c07fad 100644 --- a/lib/errorlogger.h +++ b/lib/errorlogger.h @@ -152,8 +152,8 @@ public: */ class FileLocation { public: - FileLocation() { - line = 0; + FileLocation() + : line(0) { } FileLocation(const std::string &file, unsigned int aline) @@ -176,8 +176,7 @@ public: void setfile(const std::string &file); /** - * Set the filename. - * @param file Filename to set. + * Returns the location as a string. Format: [file:line] */ std::string stringify() const; diff --git a/lib/symboldatabase.h b/lib/symboldatabase.h index 17940683d..6c038316f 100644 --- a/lib/symboldatabase.h +++ b/lib/symboldatabase.h @@ -533,8 +533,6 @@ private: * @param tok pointer to token to check * @param vartok populated with pointer to the variable token, if found * @param typetok populated with pointer to the type token, if found - * @param isArray reference to variable to set if array is found - * @param isPointer reference to variable to set if pointer is found * @return true if tok points to a variable declaration, false otherwise */ bool isVariableDeclaration(const Token* tok, const Token*& vartok, const Token*& typetok) const; diff --git a/lib/token.h b/lib/token.h index d029bd564..e20a1f617 100644 --- a/lib/token.h +++ b/lib/token.h @@ -342,7 +342,6 @@ public: * @param linebreaks Insert \n into string when line number changes * @param files print Files as numbers or as names (if fileNames is given) * @param fileNames Vector of filenames. Used (if given) to print filenames as strings instead of numbers. - * @param title Prints a title on top of output * @param end Stringification ends before this token is reached. 0 to stringify until end of list. * @return Stringified token list as a string */