From 701bff1d89e9dbf8b1f6d6b627bab375cb71f1af Mon Sep 17 00:00:00 2001 From: Stefano Zacchiroli Date: Wed, 2 Apr 2003 09:14:10 +0000 Subject: [PATCH] C++ 3.2 aware changes --- helm/DEVEL/mathml_editor/src/CLoggerConsole.cc | 2 +- .../mathml_editor/src/CMathMLFactoryXSLTDiff.cc | 6 +++--- helm/DEVEL/mathml_editor/src/Diff.cc | 6 +++--- helm/DEVEL/mathml_editor/src/LPushLexer.cc | 1 + helm/DEVEL/mathml_editor/src/TDictionary.hh | 13 +++++++++++++ helm/DEVEL/mathml_editor/src/TDocument.cc | 2 +- helm/DEVEL/mathml_editor/src/TPushLexer.cc | 1 + 7 files changed, 23 insertions(+), 8 deletions(-) diff --git a/helm/DEVEL/mathml_editor/src/CLoggerConsole.cc b/helm/DEVEL/mathml_editor/src/CLoggerConsole.cc index f5d4749de..0265f389d 100644 --- a/helm/DEVEL/mathml_editor/src/CLoggerConsole.cc +++ b/helm/DEVEL/mathml_editor/src/CLoggerConsole.cc @@ -31,5 +31,5 @@ void CLoggerConsole::message(Level l, const std::string& msg) { const char* ls[] = { "Error", "Warning", "Info", "Debug" }; - cerr << "*** " << ls[l] << ": " << msg << endl; + std::cerr << "*** " << ls[l] << ": " << msg << std::endl; } diff --git a/helm/DEVEL/mathml_editor/src/CMathMLFactoryXSLTDiff.cc b/helm/DEVEL/mathml_editor/src/CMathMLFactoryXSLTDiff.cc index 91f32e539..d3706a704 100644 --- a/helm/DEVEL/mathml_editor/src/CMathMLFactoryXSLTDiff.cc +++ b/helm/DEVEL/mathml_editor/src/CMathMLFactoryXSLTDiff.cc @@ -52,11 +52,11 @@ CMathMLFactoryXSLTDiff::documentModified(TDocument& doc) assert(res); //cout << "*** THE TEX DOCUMENT" << endl; //style.save(doc.document(), stdout); - cout << "*** THE CURRENT DOCUMENT:" << endl; + std::cout << "*** THE CURRENT DOCUMENT:" << std::endl; if (result) style.save(result, stdout); - cout << "*** THE NEW DOCUMENT:" << endl; + std::cout << "*** THE NEW DOCUMENT:" << std::endl; style.save(res, stdout); - cout << "*** THE DIFF:" << endl; + std::cout << "*** THE DIFF:" << std::endl; DOMX::Diff diff = DOMX::Diff::diff(result, res); style.save(diff.document(), stdout); diff.patch(); diff --git a/helm/DEVEL/mathml_editor/src/Diff.cc b/helm/DEVEL/mathml_editor/src/Diff.cc index 294797195..6c226babd 100644 --- a/helm/DEVEL/mathml_editor/src/Diff.cc +++ b/helm/DEVEL/mathml_editor/src/Diff.cc @@ -291,7 +291,7 @@ namespace GdomeSmartDOMExt if (elem.hasAttribute("count")) { unsigned count; - istringstream is(elem.getAttribute("count")); + std::istringstream is(elem.getAttribute("count")); is >> count; assert(count == 1); } @@ -331,7 +331,7 @@ namespace GdomeSmartDOMExt unsigned count = 1; if (p2.hasAttribute("count")) { - istringstream is(p2.getAttribute("count")); + std::istringstream is(p2.getAttribute("count")); is >> count; } while (count-- > 0) @@ -365,7 +365,7 @@ namespace GdomeSmartDOMExt unsigned count = 1; if (p2.hasAttribute("count")) { - istringstream is(p2.getAttribute("count")); + std::istringstream is(p2.getAttribute("count")); is >> count; } while (count-- > 0) diff --git a/helm/DEVEL/mathml_editor/src/LPushLexer.cc b/helm/DEVEL/mathml_editor/src/LPushLexer.cc index 74cda410a..8a22d6678 100644 --- a/helm/DEVEL/mathml_editor/src/LPushLexer.cc +++ b/helm/DEVEL/mathml_editor/src/LPushLexer.cc @@ -24,6 +24,7 @@ */ #include +#include #include "ALogger.hh" #include "TToken.hh" diff --git a/helm/DEVEL/mathml_editor/src/TDictionary.hh b/helm/DEVEL/mathml_editor/src/TDictionary.hh index 8807f8377..4864630f9 100644 --- a/helm/DEVEL/mathml_editor/src/TDictionary.hh +++ b/helm/DEVEL/mathml_editor/src/TDictionary.hh @@ -30,7 +30,13 @@ #include #include +#if defined(HAVE_EXT_HASH_MAP) +#include +#elif defined(HAVE_HASH_MAP) #include +#else +#error "no hash_map could be found" +#endif #include #include "dom.hh" @@ -93,8 +99,15 @@ public: std::string complete(const std::string, std::list&) const; private: +#if defined(HAVE_EXT_HASH_MAP) + struct StringHash : public std::unary_function< std::string, size_t > + { size_t operator()(const std::string& s) const { return __gnu_cxx::hash()(s.c_str()); } }; +#elif defined(HAVE_HASH_MAP) struct StringHash : public std::unary_function< std::string, size_t > { size_t operator()(const std::string& s) const { return hash()(s.c_str()); } }; +#else +#error "no hash_map could be found" +#endif #if 0 struct StringEq : public std::binary_function< std::string, std::string, bool > diff --git a/helm/DEVEL/mathml_editor/src/TDocument.cc b/helm/DEVEL/mathml_editor/src/TDocument.cc index 5f5a07e4b..322a08d7f 100644 --- a/helm/DEVEL/mathml_editor/src/TDocument.cc +++ b/helm/DEVEL/mathml_editor/src/TDocument.cc @@ -70,7 +70,7 @@ TDocument::serialize(const char* filename) const std::string TDocument::makeId(unsigned id) { - ostringstream os; + std::ostringstream os; os << "I" << id; return os.str(); } diff --git a/helm/DEVEL/mathml_editor/src/TPushLexer.cc b/helm/DEVEL/mathml_editor/src/TPushLexer.cc index f9dc184c2..ee884cfe9 100644 --- a/helm/DEVEL/mathml_editor/src/TPushLexer.cc +++ b/helm/DEVEL/mathml_editor/src/TPushLexer.cc @@ -24,6 +24,7 @@ */ #include +#include #include "TToken.hh" #include "TPushLexer.hh" -- 2.39.2