Minor ply parsing bug fix. (#57)

* Minor ply parsing bug fix.

* Linux compilation fix.
metadata
Qingnan Zhou 2018-01-01 08:19:38 -05:00 committed by Wenzel Jakob
parent 46650b73a1
commit 25e110c999
2 changed files with 4 additions and 2 deletions

View File

@ -633,7 +633,9 @@ void Thread::initializeOpenMP(size_t threadCount) {
} }
const std::string threadName = "Mitsuba: " + thread->getName(); const std::string threadName = "Mitsuba: " + thread->getName();
#if defined(__LINUX__) || defined(__OSX__) #if defined(__LINUX__)
pthread_setname_np(pthread_self(), threadName.c_str());
#elif defined(__OSX__)
pthread_setname_np(threadName.c_str()); pthread_setname_np(threadName.c_str());
#elif defined(__WINDOWS__) #elif defined(__WINDOWS__)
SetThreadName(threadName.c_str()); SetThreadName(threadName.c_str());

View File

@ -142,7 +142,7 @@ bool ply::ply_parser::parse(std::istream& istream)
std::string& type = type_or_list; std::string& type = type_or_list;
char space_type_name; char space_type_name;
stringstream >> space_type_name >> std::ws >> name >> std::ws; stringstream >> space_type_name >> std::ws >> name >> std::ws;
if (!stringstream || !std::isspace(space_type_name)) { if (!stringstream.eof() || !std::isspace(space_type_name)) {
if (error_callback_) { if (error_callback_) {
error_callback_(line_number_, "parse error"); error_callback_(line_number_, "parse error");
} }