From 51a7fc12788bf403550d23fd99ef5515762414d8 Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Fri, 27 Jan 2012 19:31:35 +0000 Subject: [PATCH] Fixed namespace issues with the Fortran module --- Cantera/fortran/src/fct.cpp | 10 +++++----- Cantera/fortran/src/fctxml.cpp | 12 +++++++----- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/Cantera/fortran/src/fct.cpp b/Cantera/fortran/src/fct.cpp index fa6c3ba0c..dba3244c3 100644 --- a/Cantera/fortran/src/fct.cpp +++ b/Cantera/fortran/src/fct.cpp @@ -95,7 +95,7 @@ extern "C" { try { std::string pnm = _fph(n)->name(); int lout = min(lennm,pnm.size()); - copy(pnm.c_str(), pnm.c_str() + lout, nm); + std::copy(pnm.c_str(), pnm.c_str() + lout, nm); for (int nn = lout; nn < lennm; nn++) nm[nn] = ' '; return 0; } @@ -228,7 +228,7 @@ extern "C" { try { std::string spnm = _fph(n)->speciesName(*k-1); int lout = min(lennm,spnm.size()); - copy(spnm.c_str(), spnm.c_str() + lout, nm); + std::copy(spnm.c_str(), spnm.c_str() + lout, nm); for (int nn = lout; nn < lennm; nn++) nm[nn] = ' '; return 0; } @@ -239,7 +239,7 @@ extern "C" { try { std::string elnm = _fph(n)->elementName(*m-1); int lout = min(lennm,elnm.size()); - copy(elnm.c_str(), elnm.c_str() + lout, nm); + std::copy(elnm.c_str(), elnm.c_str() + lout, nm); for (int nn = lout; nn < lennm; nn++) nm[nn] = ' '; return 0; } @@ -436,7 +436,7 @@ extern "C" { const integer* neighbor4) { try { XML_Node* x = _xml(mxml); - vector phases; + std::vector phases; phases.push_back(_fth(iphase)); if (*neighbor1 >= 0) { phases.push_back(_fth(neighbor1)); @@ -599,7 +599,7 @@ extern "C" { Kinetics* k = _fkin(n); std::string r = k->reactionString(*i-1); int lout = min(lenbuf,r.size()); - copy(r.c_str(), r.c_str() + lout, buf); + std::copy(r.c_str(), r.c_str() + lout, buf); for (int nn = lout; nn < lenbuf; nn++) buf[nn] = ' '; return 0; } diff --git a/Cantera/fortran/src/fctxml.cpp b/Cantera/fortran/src/fctxml.cpp index 310d23be5..3c28d7b20 100644 --- a/Cantera/fortran/src/fctxml.cpp +++ b/Cantera/fortran/src/fctxml.cpp @@ -13,6 +13,8 @@ using namespace ctml; using namespace std; +using Cantera::XML_Node; +using Cantera::CanteraError; #include "clib/Cabinet.h" @@ -24,7 +26,7 @@ inline XML_Node* _xml(const integer* i) { } static void handleError() { - error(lastErrorMessage()); + Cantera::error(Cantera::lastErrorMessage()); } std::string f2string(const char* s, ftnlen n); @@ -42,7 +44,7 @@ extern "C" { status_t DLL_EXPORT fxml_get_xml_file_(const char* file, ftnlen filelen) { try { - XML_Node* x = get_XML_File(f2string(file, filelen)); + XML_Node* x = Cantera::get_XML_File(f2string(file, filelen)); int ix = Cabinet::cabinet(false)->add(x); return ix; } @@ -55,7 +57,7 @@ extern "C" { status_t DLL_EXPORT fxml_clear_() { try { Cabinet::cabinet(false)->clear(); - close_XML_File("all"); + Cantera::close_XML_File("all"); return 0; } catch (CanteraError) { handleError(); return -1;} @@ -242,7 +244,7 @@ extern "C" { doublereal* data, const integer* iconvert) { try { XML_Node& node = *_xml(i); - vector_fp v; + Cantera::vector_fp v; bool conv = false; if (*iconvert > 0) conv = true; getFloatArray(node, v, conv); @@ -251,7 +253,7 @@ extern "C" { // array not big enough if (*n < nv) { throw CanteraError("ctml_getfloatarray", - "array must be dimensioned at least "+int2str(nv)); + "array must be dimensioned at least "+Cantera::int2str(nv)); } for (int i = 0; i < nv; i++) {