From: Braden M. <br...@us...> - 2006-12-28 23:12:25
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11585/src/libopenvrml/openvrml Modified Files: browser.cpp vrml97node.cpp Log Message: Microsoft cl 14.00.50727.762 (Visual C++ 8.0 SP1) is consistent in its lack of support for function try blocks. The previous release (14.00.50727.42) was hit-or-miss. This changes code that the newer compiler complains about. Index: browser.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/browser.cpp,v retrieving revision 1.198 retrieving revision 1.199 diff -C2 -d -r1.198 -r1.199 *** browser.cpp 6 Dec 2006 01:52:58 -0000 1.198 --- browser.cpp 28 Dec 2006 23:12:20 -0000 1.199 *************** *** 3638,3718 **** void operator()() const OPENVRML_NOTHROW ! try { ! using openvrml::unreachable_url; try { ! using namespace openvrml; ! using std::auto_ptr; ! using std::ostringstream; ! using std::string; ! using std::vector; ! using boost::dynamic_pointer_cast; ! using boost::shared_ptr; ! using openvrml_::scope_guard; ! using openvrml_::make_obj_guard; ! scope_guard guard = ! make_obj_guard( ! *this->externproto_node_metatype_, ! &externproto_node_metatype::clear_externproto_node_types); ! boost::ignore_unused_variable_warning(guard); ! auto_ptr<resource_istream> in = ! this->scene_->get_resource(this->alt_uris_); ! if (!(*in)) { throw unreachable_url(); } ! // ! // We don't actually do anything with these; but the parser ! // wants them. ! // ! vector<boost::intrusive_ptr<node> > nodes; ! std::map<string, string> meta; ! parse_vrml(*in, in->url(), in->type(), ! *this->scene_, nodes, meta); ! shared_ptr<openvrml::proto_node_metatype> proto_node_metatype; ! for (vector<string>::const_iterator alt_uri = ! this->alt_uris_.begin(); ! alt_uri != this->alt_uris_.end() && !proto_node_metatype; ! ++alt_uri) { ! const uri absolute_uri = !relative(uri(*alt_uri)) ! ? uri(*alt_uri) ! : this->scene_->url().empty() ! ? create_file_url(uri(*alt_uri)) ! : uri(*alt_uri).resolve_against( ! uri(this->scene_->url())); ! const shared_ptr<openvrml::node_metatype> node_metatype = ! this->scene_->browser() ! .node_metatype(node_metatype_id(absolute_uri)); ! proto_node_metatype = ! dynamic_pointer_cast<openvrml::proto_node_metatype>( ! node_metatype); ! } ! if (!proto_node_metatype) { ! ostringstream err_msg; ! err_msg << "no PROTO definition at <" << in->url() << ">"; ! this->scene_->browser().err(err_msg.str()); ! return; ! } ! this->externproto_node_metatype_ ! ->set_proto_node_metatype(proto_node_metatype); } catch (std::exception & ex) { this->scene_->browser().err(ex.what()); - throw unreachable_url(); - } catch (...) { - // - // The implementation of resource_istream is provided by - // the user; and unfortunately, operations on it could - // throw anything. - // - throw unreachable_url(); } - } catch (std::exception & ex) { - this->scene_->browser().err(ex.what()); } --- 3638,3724 ---- void operator()() const OPENVRML_NOTHROW ! { try { ! using openvrml::unreachable_url; ! try { ! using namespace openvrml; ! using std::auto_ptr; ! using std::ostringstream; ! using std::string; ! using std::vector; ! using boost::dynamic_pointer_cast; ! using boost::shared_ptr; ! using openvrml_::scope_guard; ! using openvrml_::make_obj_guard; ! scope_guard guard = ! make_obj_guard( ! *this->externproto_node_metatype_, ! &externproto_node_metatype::clear_externproto_node_types); ! boost::ignore_unused_variable_warning(guard); ! auto_ptr<resource_istream> in = ! this->scene_->get_resource(this->alt_uris_); ! if (!(*in)) { throw unreachable_url(); } ! // ! // We don't actually do anything with these; but the parser ! // wants them. ! // ! vector<boost::intrusive_ptr<node> > nodes; ! std::map<string, string> meta; ! parse_vrml(*in, in->url(), in->type(), ! *this->scene_, nodes, meta); ! shared_ptr<openvrml::proto_node_metatype> ! proto_node_metatype; ! for (vector<string>::const_iterator alt_uri = ! this->alt_uris_.begin(); ! (alt_uri != this->alt_uris_.end()) ! && !proto_node_metatype; ! ++alt_uri) { ! const uri absolute_uri = !relative(uri(*alt_uri)) ! ? uri(*alt_uri) ! : this->scene_->url().empty() ! ? create_file_url(uri(*alt_uri)) ! : uri(*alt_uri).resolve_against( ! uri(this->scene_->url())); ! const shared_ptr<openvrml::node_metatype> ! node_metatype = ! this->scene_->browser() ! .node_metatype(node_metatype_id(absolute_uri)); ! proto_node_metatype = ! dynamic_pointer_cast<openvrml::proto_node_metatype>( ! node_metatype); ! } ! if (!proto_node_metatype) { ! ostringstream err_msg; ! err_msg << "no PROTO definition at <" << in->url() ! << ">"; ! this->scene_->browser().err(err_msg.str()); ! return; ! } ! this->externproto_node_metatype_ ! ->set_proto_node_metatype(proto_node_metatype); + } catch (std::exception & ex) { + this->scene_->browser().err(ex.what()); + throw unreachable_url(); + } catch (...) { + // + // The implementation of resource_istream is provided by + // the user; and unfortunately, operations on it could + // throw anything. + // + throw unreachable_url(); + } } catch (std::exception & ex) { this->scene_->browser().err(ex.what()); } } *************** *** 6122,6153 **** void operator()() const OPENVRML_NOTHROW ! try { ! boost::recursive_mutex::scoped_lock lock(this->browser_->mutex_); ! using std::endl; ! openvrml::browser & browser = *this->browser_; ! try { ! std::auto_ptr<resource_istream> in = ! browser.scene_->get_resource(this->url_); ! if (!(*in)) { throw unreachable_url(); } ! browser.set_world(*in); ! } catch (antlr::ANTLRException & ex) { ! browser.err(ex.getMessage()); ! } catch (invalid_vrml & ex) { ! std::ostringstream out; ! out << ex.url << ':' << ex.line << ':' << ex.column << ": error: " ! << ex.what(); ! browser.err(out.str()); ! } catch (unreachable_url &) { ! throw; ! } catch (std::exception & ex) { ! browser.err(ex.what()); ! } catch (...) { ! throw unreachable_url(); } - } catch (unreachable_url & ex) { - this->browser_->err(ex.what()); } --- 6128,6161 ---- void operator()() const OPENVRML_NOTHROW ! { ! try { ! boost::recursive_mutex::scoped_lock lock(this->browser_->mutex_); ! using std::endl; ! openvrml::browser & browser = *this->browser_; ! try { ! std::auto_ptr<resource_istream> in = ! browser.scene_->get_resource(this->url_); ! if (!(*in)) { throw unreachable_url(); } ! browser.set_world(*in); ! } catch (antlr::ANTLRException & ex) { ! browser.err(ex.getMessage()); ! } catch (invalid_vrml & ex) { ! std::ostringstream out; ! out << ex.url << ':' << ex.line << ':' << ex.column ! << ": error: " << ex.what(); ! browser.err(out.str()); ! } catch (unreachable_url &) { ! throw; ! } catch (std::exception & ex) { ! browser.err(ex.what()); ! } catch (...) { ! throw unreachable_url(); ! } ! } catch (unreachable_url & ex) { ! this->browser_->err(ex.what()); } } *************** *** 6260,6283 **** void operator()() const OPENVRML_NOTHROW ! try { try { ! std::auto_ptr<resource_istream> in = ! this->browser_->scene_->get_resource(*this->url_); ! if (!(*in)) { throw unreachable_url(); } ! mfnode nodes; ! nodes.value(this->browser_->create_vrml_from_stream(*in, in->type())); ! this->listener_->process_event(nodes, browser::current_time()); } catch (std::exception & ex) { this->browser_->err(ex.what()); - throw unreachable_url(); - } catch (...) { - // - // The implementation of resource_istream is provided by the user; - // and unfortunately, operations on it could throw anything. - // - throw unreachable_url(); } - } catch (std::exception & ex) { - this->browser_->err(ex.what()); } --- 6268,6295 ---- void operator()() const OPENVRML_NOTHROW ! { try { ! try { ! std::auto_ptr<resource_istream> in = ! this->browser_->scene_->get_resource(*this->url_); ! if (!(*in)) { throw unreachable_url(); } ! mfnode nodes; ! nodes.value( ! this->browser_->create_vrml_from_stream(*in, in->type())); ! this->listener_->process_event(nodes, browser::current_time()); ! } catch (std::exception & ex) { ! this->browser_->err(ex.what()); ! throw unreachable_url(); ! } catch (...) { ! // ! // The implementation of resource_istream is provided by the ! // user; and unfortunately, operations on it could throw ! // anything. ! // ! throw unreachable_url(); ! } } catch (std::exception & ex) { this->browser_->err(ex.what()); } } Index: vrml97node.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/vrml97node.cpp,v retrieving revision 1.115 retrieving revision 1.116 diff -C2 -d -r1.115 -r1.116 *** vrml97node.cpp 18 Oct 2006 05:56:59 -0000 1.115 --- vrml97node.cpp 28 Dec 2006 23:12:20 -0000 1.116 *************** *** 3889,3893 **** public: explicit string_exposedfield(text_node & node); ! string_exposedfield(const string_exposedfield & obj) OPENVRML_NOTHROW; virtual ~string_exposedfield() OPENVRML_NOTHROW; --- 3889,3894 ---- public: explicit string_exposedfield(text_node & node); ! string_exposedfield(const string_exposedfield & obj) ! OPENVRML_NOTHROW; virtual ~string_exposedfield() OPENVRML_NOTHROW; *************** *** 14142,14174 **** void operator()() const OPENVRML_NOTHROW ! try { ! using std::endl; ! using std::string; ! using std::vector; ! openvrml::scene & inline_scene = *this->inline_scene_; ! const vector<string> & url = *this->url_; ! assert(inline_scene.url().empty()); ! vector<boost::intrusive_ptr<node> > nodes; ! try { ! // ! // Any relative URLs passed here will be relative to the ! // *parent* scene; so we call get_resource on the parent. ! // ! assert(inline_scene.parent()); ! std::auto_ptr<resource_istream> in = ! inline_scene.parent()->get_resource(url); ! if (!(*in)) { throw unreachable_url(); } ! inline_scene.load(*in); } catch (std::exception & ex) { ! inline_scene.browser().err(ex.what()); ! throw unreachable_url(); ! } catch (...) { ! throw unreachable_url(); } - } catch (std::exception & ex) { - this->inline_scene_->browser().err(ex.what()); } --- 14143,14177 ---- void operator()() const OPENVRML_NOTHROW ! { ! try { ! using std::endl; ! using std::string; ! using std::vector; ! openvrml::scene & inline_scene = *this->inline_scene_; ! const vector<string> & url = *this->url_; ! assert(inline_scene.url().empty()); ! vector<boost::intrusive_ptr<node> > nodes; ! try { ! // ! // Any relative URLs passed here will be relative to the ! // *parent* scene; so we call get_resource on the parent. ! // ! assert(inline_scene.parent()); ! std::auto_ptr<resource_istream> in = ! inline_scene.parent()->get_resource(url); ! if (!(*in)) { throw unreachable_url(); } ! inline_scene.load(*in); ! } catch (std::exception & ex) { ! inline_scene.browser().err(ex.what()); ! throw unreachable_url(); ! } catch (...) { ! throw unreachable_url(); ! } } catch (std::exception & ex) { ! this->inline_scene_->browser().err(ex.what()); } } *************** *** 23009,23013 **** && std::equal(faceName, faceName + faceNameLen, valueName.begin())) { ! HRESULT strcat_result = StringCchCat(fontPath, MAX_PATH, fontsPath); --- 23012,23016 ---- && std::equal(faceName, faceName + faceNameLen, valueName.begin())) { ! HRESULT strcat_result = StringCchCat(fontPath, MAX_PATH, fontsPath); |