[beast: 18/43] BSE: avoid sfi_error in library code



commit a29dfc69a6d70048fab31a7d660fbee072935fb1
Author: Tim Janik <timj gnu org>
Date:   Sun Jun 25 18:08:00 2017 +0200

    BSE: avoid sfi_error in library code
    
    Signed-off-by: Tim Janik <timj gnu org>

 bse/bsemain.cc    |   11 +++++------
 bse/bsestartup.cc |   11 +++++------
 2 files changed, 10 insertions(+), 12 deletions(-)
---
diff --git a/bse/bsemain.cc b/bse/bsemain.cc
index 167fd59..48ecf78 100644
--- a/bse/bsemain.cc
+++ b/bse/bsemain.cc
@@ -556,15 +556,14 @@ static void
 init_aida_idl ()
 {
   // setup Aida server connection, so ServerIface::__aida_connection__() yields non-NULL
-  Aida::ServerConnectionP scon =
+  Aida::ServerConnectionP bseserver_connection =
     Aida::ServerConnection::bind<Bse::ServerIface> (string_format ("inproc://BSE-%s", Bse::version()),
-                                                    shared_ptr_cast<Bse::ServerIface> 
(&Bse::ServerImpl::instance()));
-  if (!scon)
-    sfi_error ("%s: failed to create BSE connection: %s", __func__, g_strerror (errno));
-  static Aida::ServerConnectionP *static_connection = new Aida::ServerConnectionP (scon); // keep connection 
alive for entire runtime
+                                                    shared_ptr_cast<Bse::ServerIface> 
(&Bse::ServerImpl::instance())); // sets errno
+  assert_return (bseserver_connection != NULL);
+  static Aida::ServerConnectionP *static_connection = new Aida::ServerConnectionP (bseserver_connection); // 
keep connection alive for entire runtime
   (void) static_connection;
   // hook up server connection to main loop to process remote calls
-  AidaGlibSource *source = AidaGlibSource::create (scon.get());
+  AidaGlibSource *source = AidaGlibSource::create (bseserver_connection.get());
   g_source_set_priority (source, BSE_PRIORITY_GLUE);
   g_source_attach (source, bse_main_context);
 }
diff --git a/bse/bsestartup.cc b/bse/bsestartup.cc
index b1b964b..c166fb4 100644
--- a/bse/bsestartup.cc
+++ b/bse/bsestartup.cc
@@ -152,14 +152,13 @@ init_server_connection () // bse.hh
     {
       using namespace Rapicorn::Aida;
       ClientConnectionP connection = ClientConnection::connect ("inproc://BSE-" BST_VERSION);
-      ServerH server;
+      ServerH bseconnection_server_handle;
       if (connection)
-        server = connection->remote_origin<ServerH>();
-      if (!server) // shouldn't happen
-        sfi_error ("%s: failed to establish BSE connection: %s", __func__, g_strerror (errno));
+        bseconnection_server_handle = connection->remote_origin<ServerH>(); // sets errno
+      assert_return (bseconnection_server_handle != NULL, NULL);
       constexpr SfiProxy BSE_SERVER = 1;
-      assert_return (server.proxy_id() == BSE_SERVER, NULL);
-      assert_return (server.from_proxy (BSE_SERVER) == server, NULL);
+      assert_return (bseconnection_server_handle.proxy_id() == BSE_SERVER, NULL);
+      assert_return (bseconnection_server_handle.from_proxy (BSE_SERVER) == bseconnection_server_handle, 
NULL);
       assert_return (client_connection == NULL, NULL);
       client_connection = new Rapicorn::Aida::ClientConnectionP (connection);
     }


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