diff options
author | David Robillard <d@drobilla.net> | 2012-05-11 04:19:54 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2012-05-11 04:19:54 +0000 |
commit | f90d64eb7d90dc03fe4215bef8d77de51ca0ae78 (patch) | |
tree | ee973145a55bb352e06d9172d7ebfb2e07d2571e /src | |
parent | f6bddf045a0d94766961b037d9d295eb12ca84f5 (diff) | |
download | ingen-f90d64eb7d90dc03fe4215bef8d77de51ca0ae78.tar.gz ingen-f90d64eb7d90dc03fe4215bef8d77de51ca0ae78.tar.bz2 ingen-f90d64eb7d90dc03fe4215bef8d77de51ca0ae78.zip |
Lint.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4347 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/ConnectWindow.cpp | 34 | ||||
-rw-r--r-- | src/gui/NodeMenu.cpp | 2 | ||||
-rw-r--r-- | src/server/PortType.hpp | 2 | ||||
-rw-r--r-- | src/socket/Socket.cpp | 6 | ||||
-rw-r--r-- | src/socket/Socket.hpp | 2 | ||||
-rw-r--r-- | src/socket/SocketListener.hpp | 2 | ||||
-rw-r--r-- | src/socket/SocketReader.cpp | 4 |
7 files changed, 26 insertions, 26 deletions
diff --git a/src/gui/ConnectWindow.cpp b/src/gui/ConnectWindow.cpp index b27a9f70..2e7cc2e0 100644 --- a/src/gui/ConnectWindow.cpp +++ b/src/gui/ConnectWindow.cpp @@ -175,7 +175,7 @@ ConnectWindow::connect(bool existing) Glib::signal_timeout().connect( sigc::mem_fun(this, &ConnectWindow::gtk_callback), 40); - + return; } else if (_mode == LAUNCH_REMOTE) { int port = _port_spinbutton->get_value_as_int(); char port_str[8]; @@ -193,28 +193,28 @@ ConnectWindow::connect(bool existing) Glib::signal_timeout().connect( sigc::mem_fun(this, &ConnectWindow::gtk_callback), 40); - } else { error << "Failed to launch ingen process." << endl; } - } else + return; + } #endif - if (_mode == INTERNAL) { - if (!world->engine()) { - world->load_module("server"); - world->load_module("jack"); - world->engine()->activate(); - } + if (_mode == INTERNAL) { + if (!world->engine()) { + world->load_module("server"); + world->load_module("jack"); + world->engine()->activate(); + } - SharedPtr<SigClientInterface> client(new SigClientInterface()); + SharedPtr<SigClientInterface> client(new SigClientInterface()); - world->interface()->set_respondee(client); - _app->attach(client); - _app->register_callbacks(); + world->interface()->set_respondee(client); + _app->attach(client); + _app->register_callbacks(); - Glib::signal_timeout().connect( - sigc::mem_fun(this, &ConnectWindow::gtk_callback), 10); - } + Glib::signal_timeout().connect( + sigc::mem_fun(this, &ConnectWindow::gtk_callback), 10); + } } void @@ -373,7 +373,7 @@ ConnectWindow::gtk_callback() _app->client()->signal_response().connect( sigc::mem_fun(this, &ConnectWindow::ingen_response)); - _ping_id = abs(rand()) / 2 * 2; // avoid -1 + _ping_id = abs(g_random_int()); _app->interface()->set_response_id(_ping_id); _app->interface()->get("ingen:engine"); diff --git a/src/gui/NodeMenu.cpp b/src/gui/NodeMenu.cpp index c184384e..f6c8a4b1 100644 --- a/src/gui/NodeMenu.cpp +++ b/src/gui/NodeMenu.cpp @@ -151,7 +151,7 @@ NodeMenu::on_menu_randomize() if ((*i)->is_input() && _app->can_control(i->get())) { float min = 0.0f, max = 1.0f; nm->port_value_range(*i, min, max, _app->sample_rate()); - const float val = ((rand() / (float)RAND_MAX) * (max - min) + min); + const float val = g_random_double_range(0.0, 1.0) * (max - min) + min; _app->interface()->set_property( (*i)->path(), _app->uris().ingen_value, diff --git a/src/server/PortType.hpp b/src/server/PortType.hpp index 14cb721a..cef47703 100644 --- a/src/server/PortType.hpp +++ b/src/server/PortType.hpp @@ -40,7 +40,7 @@ public: ATOM = 4 }; - PortType(const Raul::URI& uri) + explicit PortType(const Raul::URI& uri) : _symbol(UNKNOWN) { if (uri == type_uri(AUDIO)) { diff --git a/src/socket/Socket.cpp b/src/socket/Socket.cpp index 9c2a050c..97411b64 100644 --- a/src/socket/Socket.cpp +++ b/src/socket/Socket.cpp @@ -116,7 +116,7 @@ Socket::bind(const std::string& uri) if (set_addr(uri) && ::bind(_sock, _addr, _addr_len) != -1) { return true; } - + LOG(Raul::error)(Raul::fmt("Failed to bind <%1%> (%2%)\n") % _uri % strerror(errno)); return false; @@ -128,7 +128,7 @@ Socket::connect(const std::string& uri) if (set_addr(uri) && ::connect(_sock, _addr, _addr_len) != -1) { return true; } - + LOG(Raul::error)(Raul::fmt("Failed to connect <%1%> (%2%)\n") % _uri % strerror(errno)); return false; @@ -166,7 +166,7 @@ Socket::accept() host, sizeof(host), NULL, 0, 0)) { client_uri = _uri.substr(0, _uri.find(":") + 1) + host; } - + return SharedPtr<Socket>( new Socket(_type, client_uri, client_addr, client_addr_len, conn)); } diff --git a/src/socket/Socket.hpp b/src/socket/Socket.hpp index e4dbb60a..8aa172cb 100644 --- a/src/socket/Socket.hpp +++ b/src/socket/Socket.hpp @@ -46,7 +46,7 @@ public: } /** Create a new unbound/unconnected socket of a given type. */ - Socket(Type t); + explicit Socket(Type t); /** Wrap an existing open socket. */ Socket(Type t, diff --git a/src/socket/SocketListener.hpp b/src/socket/SocketListener.hpp index ca05f325..e9c27d85 100644 --- a/src/socket/SocketListener.hpp +++ b/src/socket/SocketListener.hpp @@ -32,7 +32,7 @@ namespace Socket { class SocketListener : public Raul::Thread { public: - SocketListener(Ingen::Shared::World& world); + explicit SocketListener(Ingen::Shared::World& world); ~SocketListener(); private: diff --git a/src/socket/SocketReader.cpp b/src/socket/SocketReader.cpp index bef14f92..80a9bd22 100644 --- a/src/socket/SocketReader.cpp +++ b/src/socket/SocketReader.cpp @@ -91,7 +91,7 @@ SocketReader::_run() { Sord::World* world = _world.rdf_world(); LV2_URID_Map* map = &_world.uri_map().urid_map_feature()->urid_map; - + // Use <path:> as base URI so e.g. </foo/bar> will be a path SordNode* base_uri = sord_new_uri( world->c_obj(), (const uint8_t*)"path:"); @@ -130,7 +130,7 @@ SocketReader::_run() } serd_reader_start_stream(reader, f, (const uint8_t*)"(socket)", false); - + // Make an AtomReader to call Ingen Interface methods based on Atom Shared::AtomReader ar( _world.uri_map(), _world.uris(), _world.forge(), _iface); |