Fixed initialization list usage according to cppcheck results

Fixed comments mentioning nonexistent parameters
This commit is contained in:
PKEuS 2012-05-18 07:57:11 -07:00
parent e77f348d82
commit de79a4c84f
4 changed files with 8 additions and 18 deletions

View File

@ -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<unsigned int, CheckBufferOverrun::ArrayInfo> &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. */

View File

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

View File

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

View File

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