Standardize always-true while loop condition to "true"

This commit is contained in:
Ray Speth 2015-07-27 21:59:09 -04:00
parent 187fd27cef
commit a6e390dfc5
4 changed files with 10 additions and 10 deletions

View file

@ -341,7 +341,7 @@ void tokenizeString(const std::string& oval,
std::string val(oval);
std::string::size_type ibegin, iend;
v.clear();
while (1 > 0) {
while (true) {
ibegin = findFirstNotOfWS(val);
if (ibegin != std::string::npos) {
val = val.substr(ibegin,val.size());

View file

@ -81,7 +81,7 @@ public:
std::string::size_type k;
char action = '-';
while (1 > 0) {
while (true) {
// get token consisting of all characters up to the next
// dash, slash, or the end of the string

View file

@ -144,7 +144,7 @@ static string::size_type findUnbackslashed(const std::string& s, const char q,
string::size_type iloc, icurrent, len;
icurrent = istart;
len = s.size();
while (1) {
while (true) {
iloc = s.find(q, icurrent);
if (iloc == string::npos || iloc == 0) {
return iloc;
@ -215,7 +215,7 @@ void XML_Reader::parseTag(const std::string& tag, std::string& name,
}
// get attributes
while (1) {
while (true) {
iloc = s.find('=');
if (iloc == string::npos) {
break;
@ -245,13 +245,13 @@ std::string XML_Reader::readTag(std::map<std::string, std::string>& attribs)
string name, tag = "";
bool incomment = false;
char ch = '-';
while (1) {
while (true) {
if (m_s.eof() || (getchr(ch), ch == '<')) {
break;
}
}
char ch1 = ' ', ch2 = ' ';
while (1) {
while (true) {
if (m_s.eof()) {
tag = "EOF";
break;
@ -292,7 +292,7 @@ std::string XML_Reader::readValue()
char ch, lastch;
ch = '\n';
bool front = true;
while (1) {
while (true) {
if (m_s.eof()) {
break;
}
@ -923,7 +923,7 @@ XML_Node& XML_Node::child(const std::string& aloc) const
string loc = aloc;
std::multimap<std::string,XML_Node*>::const_iterator i;
while (1) {
while (true) {
iloc = loc.find('/');
if (iloc != string::npos) {
cname = loc.substr(0,iloc);
@ -984,7 +984,7 @@ void XML_Node::write_int(std::ostream& s, int level, int numRecursivesAllowed) c
string vv = m_value;
string::size_type ieol = vv.find('\n');
if (ieol != string::npos) {
while (1 > 0) {
while (true) {
ieol = vv.find('\n');
if (ieol != string::npos) {
if (ieol == 0) {

View file

@ -338,7 +338,7 @@ int MultiNewton::solve(doublereal* x0, doublereal* x1,
int j0 = jac.nEvals();
int nJacReeval = 0;
while (1 > 0) {
while (true) {
// Check whether the Jacobian should be re-evaluated.
if (jac.age() > m_maxAge) {
writelog("\nMaximum Jacobian age reached ("+int2str(m_maxAge)+")\n", loglevel);