Fix some of the issues from #478 (Warnings in Visual Studio build with -W4)

http://sourceforge.net/apps/trac/cppcheck/ticket/478
This commit is contained in:
Reijo Tomperi 2009-07-20 23:24:23 +03:00
parent 973bb164ea
commit d2278b5ce0
3 changed files with 5 additions and 6 deletions

View File

@ -945,9 +945,8 @@ Token *CheckMemoryLeakInFunction::getcode(const Token *tok, std::list<const Toke
}
// Callback..
bool matchFirst;
if ((matchFirst = Token::Match(tok, "( %var%")) ||
Token::Match(tok, "( * %var%"))
bool matchFirst = Token::Match(tok, "( %var%");
if (matchFirst || Token::Match(tok, "( * %var%"))
{
int tokIdx = matchFirst ? 2 : 3;

View File

@ -67,7 +67,7 @@ bool ErrorLogger::ErrorMessage::deserialize(const std::string &data)
std::string temp;
for (unsigned int i = 0; i < len && iss.good(); ++i)
{
char c = iss.get();
char c = static_cast<char>(iss.get());
temp.append(1, c);
}
@ -94,7 +94,7 @@ bool ErrorLogger::ErrorMessage::deserialize(const std::string &data)
std::string temp;
for (unsigned int i = 0; i < len && iss.good(); ++i)
{
char c = iss.get();
char c = static_cast<char>(iss.get());
temp.append(1, c);
}

View File

@ -286,7 +286,7 @@ std::string Preprocessor::read(std::istream &istr)
if (ch == '\\')
{
char chNext = 0;
while (true)
for (;;)
{
chNext = (char)istr.peek();
if (chNext != '\n' && chNext != '\r' && (chNext > 0) &&