[beast: 37/57] SFI: prepare for having 'Aida' as independent toplevel namespace



commit 8827fb4ee0672511bbdcb280d6e8c2e4e66ff472
Author: Tim Janik <timj gnu org>
Date:   Mon Jul 17 11:49:00 2017 +0200

    SFI: prepare for having 'Aida' as independent toplevel namespace
    
    Signed-off-by: Tim Janik <timj gnu org>

 sfi/bcore.hh        |    6 ++----
 sfi/glib-extra.cc   |    6 ++----
 sfi/glib-extra.hh   |    4 ++++
 sfi/sfidl-cbase.cc  |    2 +-
 sfi/sfidl-parser.cc |   14 +++++++-------
 sfi/sfidl-utils.hh  |    8 ++++++--
 sfi/sfiparams.cc    |    2 +-
 sfi/sfiparams.hh    |    4 ++--
 sfi/sfivisitors.hh  |    4 ++--
 9 files changed, 27 insertions(+), 23 deletions(-)
---
diff --git a/sfi/bcore.hh b/sfi/bcore.hh
index 8f7715c..b290b5f 100644
--- a/sfi/bcore.hh
+++ b/sfi/bcore.hh
@@ -5,10 +5,8 @@
 #include <sfi/platform.hh>
 #include <sfi/strings.hh>
 #include <sfi/glib-extra.hh>
-#include <rapicorn-core.hh>
 
 namespace Bse {
-namespace Aida = Rapicorn::Aida;
 
 // == type aliases ==
 typedef uint8_t         uint8;          ///< An 8-bit unsigned integer.
@@ -27,8 +25,8 @@ using   std::map;
 using   std::vector;
 typedef std::string String;             ///< Convenience alias for std::string.
 typedef vector<String> StringVector;    ///< Convenience alias for a std::vector<std::string>.
-using   Rapicorn::Aida::Any;
-using   Rapicorn::Aida::EventFd;
+using   Aida::Any;
+using   Aida::EventFd;
 using   Rapicorn::DataKey;
 using   Rapicorn::DataListContainer;
 
diff --git a/sfi/glib-extra.cc b/sfi/glib-extra.cc
index 42aa277..1e1a862 100644
--- a/sfi/glib-extra.cc
+++ b/sfi/glib-extra.cc
@@ -1026,22 +1026,20 @@ g_scanner_new64 (const GScannerConfig *config_templ)
   return g_scanner_new (config_templ);
 }
 
-
 #include "../config/config.h"
-#include <rapicorn-core.hh>
 
 namespace Bse {
 
 void
 assertion_failed (const char *file, uint line, const char *expr)
 {
-  return Rapicorn::Aida::assertion_failed (file, line, expr);
+  return Aida::assertion_failed (file, line, expr);
 }
 
 void
 assertion_failed_hook (const std::function<void()> &hook)
 {
-  return Rapicorn::Aida::assertion_failed_hook (hook);
+  return Aida::assertion_failed_hook (hook);
 }
 
 // == BSE_INSTALLPATH ==
diff --git a/sfi/glib-extra.hh b/sfi/glib-extra.hh
index eaafefc..fd1f723 100644
--- a/sfi/glib-extra.hh
+++ b/sfi/glib-extra.hh
@@ -7,6 +7,10 @@
 #include <string>
 #include <functional>
 
+#include <rapicorn-core.hh>
+
+namespace Aida = Rapicorn::Aida;
+
 typedef int64_t         int64;          ///< A 64-bit unsigned integer, use PRI*64 in format strings.
 
 #if (GLIB_SIZEOF_LONG > 4)
diff --git a/sfi/sfidl-cbase.cc b/sfi/sfidl-cbase.cc
index 22a23c4..74ea8e8 100644
--- a/sfi/sfidl-cbase.cc
+++ b/sfi/sfidl-cbase.cc
@@ -520,7 +520,7 @@ void CodeGeneratorCBase::printProcedure (const Method& mdef, bool proto, const S
   if (rfree != "")
     printf ("  %s _retval_conv;\n", cTypeRet (mdef.result.type));
 
-  map<String, String> cname;
+  std::map<String, String> cname;
   for(pi = mdef.params.begin(); pi != mdef.params.end(); pi++)
     {
       String conv = createTypeCode (pi->type, pi->name, MODEL_VCALL_CONV);
diff --git a/sfi/sfidl-parser.cc b/sfi/sfidl-parser.cc
index 3f7561d..48b1e7a 100644
--- a/sfi/sfidl-parser.cc
+++ b/sfi/sfidl-parser.cc
@@ -183,25 +183,25 @@ bool operator== (GTokenType t, ExtraToken e) { return (int) t == (int) e; }
 
 bool Parser::isChoice(const String& type) const
 {
-  map<String,int>::const_iterator i = typeMap.find (type);
+  std::map<String,int>::const_iterator i = typeMap.find (type);
   return (i != typeMap.end()) && ((i->second & (~tdProto)) == tdChoice);
 }
 
 bool Parser::isSequence(const String& type) const
 {
-  map<String,int>::const_iterator i = typeMap.find (type);
+  std::map<String,int>::const_iterator i = typeMap.find (type);
   return (i != typeMap.end()) && ((i->second & (~tdProto)) == tdSequence);
 }
 
 bool Parser::isRecord(const String& type) const
 {
-  map<String,int>::const_iterator i = typeMap.find (type);
+  std::map<String,int>::const_iterator i = typeMap.find (type);
   return (i != typeMap.end()) && ((i->second & (~tdProto)) == tdRecord);
 }
 
 bool Parser::isClass(const String& type) const
 {
-  map<String,int>::const_iterator i = typeMap.find (type);
+  std::map<String,int>::const_iterator i = typeMap.find (type);
   return (i != typeMap.end()) && ((i->second & (~tdProto)) == tdClass);
 }
 
@@ -356,7 +356,7 @@ bool Parser::haveIncluded (const String& filename) const
 
 static void collectImplIncludes (set<String>& result,
                                 const String& root,
-                                map<String, set<String> >& implIncludeMap)
+                                std::map<String, set<String> >& implIncludeMap)
 {
   if (result.count (root) == 0)
     {
@@ -371,7 +371,7 @@ static void collectImplIncludes (set<String>& result,
 void Parser::preprocess (const String& filename, bool includeImpl)
 {
   static stack<String> includeStack;
-  static map<String, set<String> > implIncludeMap;
+  static std::map<String, set<String> > implIncludeMap;
 
   // make a note whenever "file 1" implincludes "file 2"
   if (!includeStack.empty() && includeImpl)
@@ -723,7 +723,7 @@ namespace {
 class ClassCompare {
 public:
   const Parser& parser;
-  map<String, int> inheritanceLevel;
+  std::map<String, int> inheritanceLevel;
 
   ClassCompare (const Parser& parser) : parser (parser)
   {
diff --git a/sfi/sfidl-utils.hh b/sfi/sfidl-utils.hh
index 588f165..2a2b562 100644
--- a/sfi/sfidl-utils.hh
+++ b/sfi/sfidl-utils.hh
@@ -9,8 +9,12 @@
 /// The Sfidl namespace contains implementation and API of the Sfi IDL compiler.
 namespace Sfidl {
 
-/* lots of helpers like string_from_int, but also typedefs like String */
-using namespace Rapicorn;
+using Rapicorn::String;
+using Rapicorn::string_tolower;
+using Rapicorn::printerr;
+using Rapicorn::string_from_int;
+using Rapicorn::string_from_uint;
+using Rapicorn::string_format;
 
 /* common data structures */
 using std::list;
diff --git a/sfi/sfiparams.cc b/sfi/sfiparams.cc
index 81943e9..2803ad1 100644
--- a/sfi/sfiparams.cc
+++ b/sfi/sfiparams.cc
@@ -1733,7 +1733,7 @@ namespace Bse { // bsecore
 static std::map<String, SfiChoiceValues> aida_enum_choice_map;
 
 SfiChoiceValues
-choice_values_from_enum_values (const String &enumname, const ::Rapicorn::Aida::EnumValueVector &evvec)
+choice_values_from_enum_values (const String &enumname, const Aida::EnumValueVector &evvec)
 {
   SfiChoiceValues &cv = aida_enum_choice_map[enumname];
   if (!cv.values && !evvec.empty())
diff --git a/sfi/sfiparams.hh b/sfi/sfiparams.hh
index 77e9f96..959f903 100644
--- a/sfi/sfiparams.hh
+++ b/sfi/sfiparams.hh
@@ -317,12 +317,12 @@ GParamSpec*       sfi_pspec_from_rec      (SfiRec         *prec);
 
 namespace Bse { // bsecore
 
-SfiChoiceValues choice_values_from_enum_values (const String &enumname, const 
::Rapicorn::Aida::EnumValueVector &evvec);
+SfiChoiceValues choice_values_from_enum_values (const String &enumname, const Aida::EnumValueVector &evvec);
 
 template<class EnumType> SfiChoiceValues
 choice_values_from_enum ()
 {
-  ::Rapicorn::Aida::EnumInfo einfo = ::Rapicorn::Aida::enum_info<EnumType>();
+  Aida::EnumInfo einfo = Aida::enum_info<EnumType>();
   return choice_values_from_enum_values (einfo.name(), einfo.value_vector());
 }
 
diff --git a/sfi/sfivisitors.hh b/sfi/sfivisitors.hh
index 8d3b567..d51af57 100644
--- a/sfi/sfivisitors.hh
+++ b/sfi/sfivisitors.hh
@@ -150,7 +150,7 @@ public:
   template<class A> void
   visit_enum (A &a, Name name)
   {
-    sfi_rec_set_choice (rec_, name, Rapicorn::Aida::enum_info<A>().value_to_string (a).c_str());
+    sfi_rec_set_choice (rec_, name, Aida::enum_info<A>().value_to_string (a).c_str());
   }
   template<class SeqA> void
   visit_vector (SeqA &a, Name name)
@@ -204,7 +204,7 @@ public:
   visit_enum (A &a, Name name)
   {
     const char *c = sfi_rec_get_choice (rec_, name);
-    a = !c ? (A) 0 : Rapicorn::Aida::enum_value_from_string<A>(c);
+    a = !c ? (A) 0 : Aida::enum_value_from_string<A>(c);
   }
   template<class SeqA> void
   visit_vector (SeqA &a, Name name)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]