Fixed #478 (Warnings in Visual Studio build with -W4)

This commit is contained in:
Daniel Marjamäki 2009-09-13 09:03:48 +02:00
parent 1d974f7c05
commit c0ca375ef7
8 changed files with 23 additions and 5 deletions

View File

@ -127,6 +127,9 @@ private:
return (name() < other->name());
}
/** disabled assignment operator */
void operator=(const Check &);
};
/// @}

View File

@ -276,7 +276,7 @@ void CheckBufferOverrun::checkScope(const Token *tok, const char *varname[], con
pattern << varnames << " [ " << strindex << " ]";
int indentlevel2 = 0;
while ((tok2 = tok2->next()))
while ((tok2 = tok2->next()) != 0)
{
if (tok2->str() == ";" && indentlevel2 == 0)
break;
@ -429,7 +429,7 @@ void CheckBufferOverrun::checkScope(const Token *tok, const char *varname[], con
{
if (tok2->str()[0] == '\"')
{
len += Token::getStrLength(tok2);
len += (int)Token::getStrLength(tok2);
}
}
if (len >= (int)size)

View File

@ -56,6 +56,9 @@ private:
/** Disable the default constructors */
CheckMemoryLeak(const CheckMemoryLeak &);
/** disable assignment operator */
void operator=(const CheckMemoryLeak &);
/**
* Report error. Similar with the function Check::reportError
* @param location the token where the error occurs

View File

@ -430,7 +430,7 @@ unsigned int CppCheck::check()
_errorLogger->reportOut("Bailing out from checking " + fname + ": " + e.what());
}
_errorLogger->reportStatus(c + 1, _filenames.size());
_errorLogger->reportStatus(c + 1, (unsigned int)_filenames.size());
}
// This generates false positives - especially for libraries

View File

@ -1373,7 +1373,7 @@ public:
if (_variadic && i == _params.size() - 1)
{
str = "";
for (unsigned int j = _params.size() - 1; j < params2.size(); ++j)
for (unsigned int j = (unsigned int)_params.size() - 1; j < params2.size(); ++j)
{
if (optcomma || j > _params.size() - 1)
str += ",";

View File

@ -70,6 +70,12 @@ public:
}
#endif
private:
/** disabled copy constructor */
ThreadExecutor(const ThreadExecutor &);
/** disabled assignment operator */
void operator=(const ThreadExecutor &);
};
#endif // THREADEXECUTOR_H

View File

@ -839,7 +839,7 @@ void Tokenizer::updateClassList()
// Locate class
const Token *tok1 = tokens();
while ((tok1 = Token::findmatch(tok1, pattern_class)))
while ((tok1 = Token::findmatch(tok1, pattern_class)) != 0)
{
const char *className;
className = tok1->strAt(1);

View File

@ -304,6 +304,12 @@ private:
*/
void updateClassList();
/** Disable assignments.. */
Tokenizer(const Tokenizer &);
/** Disable assignment operator */
void operator=(const Tokenizer &);
Token *_tokens, *_tokensBack;
std::map<std::string, unsigned int> _typeSize;
std::vector<std::string> _files;