From: Stefano Zacchiroli Date: Wed, 2 Apr 2003 09:14:10 +0000 (+0000) Subject: C++ 3.2 aware changes X-Git-Tag: before_refactoring~67 X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=commitdiff_plain;h=701bff1d89e9dbf8b1f6d6b627bab375cb71f1af;p=helm.git C++ 3.2 aware changes --- 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"