Skip to content

Commit 04eb2d5

Browse files
committed
fix PLY parser issue after transition to C++11
1 parent 6b68f4d commit 04eb2d5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/shapes/ply/ply_parser.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ bool ply::ply_parser::parse(std::istream& istream)
5252
std::string format_string, version;
5353
char space_format_format_string, space_format_string_version;
5454
stringstream >> space_format_format_string >> std::ws >> format_string >> space_format_string_version >> std::ws >> version >> std::ws;
55-
if (!stringstream || !stringstream.eof() || !std::isspace(space_format_format_string) || !std::isspace(space_format_string_version)) {
55+
if (!stringstream.eof() || !std::isspace(space_format_format_string) || !std::isspace(space_format_string_version)) {
5656
if (error_callback_) {
5757
error_callback_(line_number_, "parse error");
5858
}
@@ -97,7 +97,7 @@ bool ply::ply_parser::parse(std::istream& istream)
9797
std::size_t count;
9898
char space_element_name, space_name_count;
9999
stringstream >> space_element_name >> std::ws >> name >> space_name_count >> std::ws >> count >> std::ws;
100-
if (!stringstream || !stringstream.eof() || !std::isspace(space_element_name) || !std::isspace(space_name_count)) {
100+
if ( !stringstream.eof() || !std::isspace(space_element_name) || !std::isspace(space_name_count)) {
101101
if (error_callback_) {
102102
error_callback_(line_number_, "parse error");
103103
}
@@ -131,7 +131,7 @@ bool ply::ply_parser::parse(std::istream& istream)
131131
std::string type_or_list;
132132
char space_property_type_or_list;
133133
stringstream >> space_property_type_or_list >> std::ws >> type_or_list;
134-
if (!stringstream || !std::isspace(space_property_type_or_list)) {
134+
if ( !std::isspace(space_property_type_or_list)) {
135135
if (error_callback_) {
136136
error_callback_(line_number_, "parse error");
137137
}
@@ -204,7 +204,7 @@ bool ply::ply_parser::parse(std::istream& istream)
204204
std::string size_type_string, scalar_type_string;
205205
char space_list_size_type, space_size_type_scalar_type, space_scalar_type_name;
206206
stringstream >> space_list_size_type >> std::ws >> size_type_string >> space_size_type_scalar_type >> std::ws >> scalar_type_string >> space_scalar_type_name >> std::ws >> name >> std::ws;
207-
if (!stringstream || !std::isspace(space_list_size_type) || !std::isspace(space_size_type_scalar_type) || !std::isspace(space_scalar_type_name)) {
207+
if ( !std::isspace(space_list_size_type) || !std::isspace(space_size_type_scalar_type) || !std::isspace(space_scalar_type_name)) {
208208
if (error_callback_) {
209209
error_callback_(line_number_, "parse error");
210210
}

0 commit comments

Comments
 (0)