Commit bf19a0aa authored by Houtan Bastani's avatar Houtan Bastani
Browse files

fix warnings introduced in 3b20d41a92db4267c0ba13278f3885aba67e6c47 related to...

fix warnings introduced in 3b20d41a92db4267c0ba13278f3885aba67e6c47 related to size_t/int comparison #1201
parent 471df861
......@@ -1304,7 +1304,7 @@ ModelTree::fixNestedParenthesis(ostringstream &output, map<string, string> &tmp_
bool hit_limit = false;
int i1 = 0;
map<string, string>::iterator it;
for (int i = 0; i < str.length(); i++)
for (size_t i = 0; i < str.length(); i++)
{
if (str.at(i) == '(')
{
......@@ -1334,10 +1334,10 @@ ModelTree::fixNestedParenthesis(ostringstream &output, map<string, string> &tmp_
string varname;
while (testNestedParenthesis(str1))
{
int open_paren_idx = -1;
int match_paren_idx = -1;
int last_open_paren = -1;
for (int j = 0; j < str1.length(); j++)
size_t open_paren_idx = string::npos;
size_t match_paren_idx = string::npos;
size_t last_open_paren = string::npos;
for (size_t j = 0; j < str1.length(); j++)
{
if (str1.at(j) == '(')
{
......@@ -1355,7 +1355,7 @@ ModelTree::fixNestedParenthesis(ostringstream &output, map<string, string> &tmp_
match_paren_idx = j;
}
if (open_paren_idx != -1 && match_paren_idx != -1)
if (open_paren_idx != string::npos && match_paren_idx != string::npos)
{
string val = str1.substr(open_paren_idx, match_paren_idx - open_paren_idx + 1);
it = tmp_paren_vars.find(val);
......@@ -1399,7 +1399,7 @@ bool
ModelTree::testNestedParenthesis(const string &str) const
{
int open = 0;
for (int i = 0; i < str.length(); i++)
for (size_t i = 0; i < str.length(); i++)
{
if (str.at(i) == '(')
open++;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment