Skip to content

Commit

Permalink
COMP:Fixed a warning message of valnue comparison
Browse files Browse the repository at this point in the history
- Fixed a warning message of comparison between signed and unsigned
  integer expressions
  - /kwsCheckInternalVariables.cxx:279:
    warning: comparison between signed and unsigned integer expressions
  - /kwsCheckInternalVariables.cxx:315:
    warning: comparison between signed and unsigned integer expressions

- kwsCheckInternalVariables.cxx:362:
  warning: comparison of unsigned expression >= 0 is always true
  [-Wtautological-compare]
    if(i>=0)
       ~^ ~
  • Loading branch information
Hyun Jae Kang committed Nov 9, 2015
1 parent d4175fa commit 15ef74f
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions kwsCheckInternalVariables.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ bool Parser::CheckInternalVariables(const char* regEx,bool alignment,bool checkP

size_t previousline = 0;
size_t previouspos = 0;

size_t pos = publicFirst;
while(pos!= std::string::npos)
{
Expand All @@ -78,7 +78,7 @@ bool Parser::CheckInternalVariables(const char* regEx,bool alignment,bool checkP
m_ErrorList.push_back(error);
hasError = true;
}

// Check the alignment if specified
if(alignment)
{
Expand Down Expand Up @@ -140,7 +140,7 @@ bool Parser::CheckInternalVariables(const char* regEx,bool alignment,bool checkP
{
continue;
}

if(this->IsInStruct(pos) || this->IsInUnion(pos))
{
continue;
Expand Down Expand Up @@ -201,19 +201,19 @@ bool Parser::CheckInternalVariables(const char* regEx,bool alignment,bool checkP
previouspos = 0;
while(pos != std::string::npos)
{
std::string var = this->FindInternalVariable(pos+1,privateLast,pos);
std::string var = this->FindInternalVariable(pos+1,privateLast,pos);
if(var == "")
{
continue;
}

if(this->IsInStruct(pos) || this->IsInUnion(pos))
{
continue;
}

if(var.length() > 0)
{
{
// Check the alignment if specified
if(alignment)
{
Expand Down Expand Up @@ -257,11 +257,11 @@ bool Parser::CheckInternalVariables(const char* regEx,bool alignment,bool checkP
}
}
}

classPosBegin = this->GetClassPosition(classPosBegin+1);

} // End loop class pos

return !hasError;
}

Expand All @@ -272,7 +272,7 @@ std::string Parser::FindInternalVariable(size_t start, size_t end,size_t & pos)
while(posSemicolon != std::string::npos && posSemicolon<end)
{
// We try to find the word before that
long i=static_cast<long>(posSemicolon)-1;
unsigned long i=static_cast<unsigned long>(posSemicolon)-1;
bool inWord = true;
bool first = false;
std::string ivar = "";
Expand Down Expand Up @@ -359,10 +359,7 @@ std::string Parser::FindInternalVariable(size_t start, size_t end,size_t & pos)
}

std::string subphrase = "";
if(i>=0)
{
subphrase = m_BufferNoComment.substr(i+1,posSemicolon-i-1);
}
subphrase = m_BufferNoComment.substr(i+1,posSemicolon-i-1);

if( (subphrase.find("=") == std::string::npos)
&& (subphrase.find("(") == std::string::npos)
Expand Down

0 comments on commit 15ef74f

Please sign in to comment.