From 4eeeaf140c405a352f595838527b9fb57e1bc172 Mon Sep 17 00:00:00 2001 From: Edward d'Auvergne Date: Thu, 10 Dec 2015 09:02:00 +0100 Subject: [PATCH] UIUC cleanup for -Wsign-compare compilation warnings. The string find_first_not_of() and find_first_of() functions return string::npos if not found, rather than -1. --- src/FDM/UIUCModel/uiuc_parsefile.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/FDM/UIUCModel/uiuc_parsefile.cpp b/src/FDM/UIUCModel/uiuc_parsefile.cpp index 640df9e75..0858aa39a 100644 --- a/src/FDM/UIUCModel/uiuc_parsefile.cpp +++ b/src/FDM/UIUCModel/uiuc_parsefile.cpp @@ -108,7 +108,7 @@ string ParseFile :: getToken(string inputLine, int tokenNo) while (tokencounter < tokenNo) { - if ((pos1 == inputLine.npos) || (pos1 == -1) || (pos == -1) ) + if ( (pos1 == inputLine.npos) || (pos1 == string::npos) || (pos == string::npos) ) return ""; //return an empty string if tokenNo exceeds the No of tokens in the line inputLine = inputLine.substr(pos1 , MAXLINE); @@ -117,7 +117,7 @@ string ParseFile :: getToken(string inputLine, int tokenNo) tokencounter ++; } - if (pos1== -1 || pos == -1) + if (pos1== string::npos || pos == string::npos) return ""; else return inputLine.substr(pos , pos1-pos); // return the desired token -- 2.39.5