From: Edward d'Auvergne Date: Thu, 10 Dec 2015 08:02:00 +0000 (+0100) Subject: UIUC cleanup for -Wsign-compare compilation warnings. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=4eeeaf140c405a352f595838527b9fb57e1bc172;p=flightgear.git 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. --- 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