Fix some I/O returns

This commit is contained in:
Mael Rouxel-Labbé 2020-01-24 23:27:04 +01:00
parent 87e85c2634
commit 97eddd9135
4 changed files with 11 additions and 11 deletions

View File

@ -107,7 +107,7 @@ public:
std::getline(input, s);
}
return true;
return !input.fail();
}
};
@ -143,7 +143,7 @@ bool read_GOCAD(std::istream& in,
name = builder.name;
color = builder.color;
return g.is_valid(); // @fixme keep validity check?
return is_valid(g); // @fixme keep validity check?
}
/*!

View File

@ -87,7 +87,7 @@ bool read_OBJ(std::istream& input,
return false;
}
return true;
return !input.fail();
}
} // namespace CGAL

View File

@ -67,7 +67,7 @@ bool read_OFF(std::istream& in,
scanner.skip_to_next_vertex(i);
}
if(!in)
if(!in.good())
return false;
}
@ -77,7 +77,7 @@ bool read_OFF(std::istream& in,
std::size_t no;
scanner.scan_facet(no, i);
if(!in)
if(!in.good())
return false;
IO::internal::resize(polygons[i], no);
@ -114,7 +114,7 @@ bool read_OFF(std::istream& in,
}
}
return in.good();
return !in.fail();
}
/*!
@ -163,7 +163,7 @@ bool read_OFF(std::istream& in,
}
}
return in.good();
return !in.fail();
}
////////////////////////////////////////////////////////////////////////////////////////////////////

View File

@ -121,7 +121,7 @@ bool parse_ASCII_STL(std::istream& input,
std::cout << "Parsing ASCII file..." << std::endl;
if(!input.good())
return true;
return false;
// Here, we have already read the word 'solid'
@ -158,7 +158,7 @@ bool parse_ASCII_STL(std::istream& input,
return false;
}
return true;
return !input.fail();
}
template <class PointRange, class TriangleRange>
@ -178,7 +178,7 @@ bool parse_binary_STL(std::istream& input,
input.seekg(0, std::ios::beg);
if(!input.good())
return true;
return false;
// Discard the first 80 chars (unused header)
int pos = 0;
@ -281,7 +281,7 @@ bool parse_binary_STL(std::istream& input,
}
}
return true;
return !input.fail();
}
} // namespace internal