From b43e380ae18dc75175201159fd220e7f5e28fdf0 Mon Sep 17 00:00:00 2001 From: sletz Date: Tue, 14 Nov 2006 20:09:17 +0000 Subject: [PATCH] Correct jack_lsp and use STL find git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@1293 0c269be4-1314-0410-8aa9-9f06e86f4224 --- common/JackClient.cpp | 5 ++--- example-clients/lsp.c | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/common/JackClient.cpp b/common/JackClient.cpp index 8ca7e1ec..87e546ef 100644 --- a/common/JackClient.cpp +++ b/common/JackClient.cpp @@ -28,6 +28,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. #include "JackTransportEngine.h" #include #include +#include using namespace std; @@ -405,9 +406,7 @@ int JackClient::PortRegister(const char* port_name, const char* port_type, unsig int JackClient::PortUnRegister(jack_port_id_t port_index) { JackLog("JackClient::PortUnRegister port_index = %ld\n", port_index); - list::iterator it; - for (it = fPortList.begin(); it != fPortList.end() && *it != port_index; it++) - ; + list::iterator it = find(fPortList.begin(), fPortList.end(), port_index); if (it != fPortList.end()) { fPortList.erase(it); diff --git a/example-clients/lsp.c b/example-clients/lsp.c index bf208b64..b949db71 100644 --- a/example-clients/lsp.c +++ b/example-clients/lsp.c @@ -48,7 +48,7 @@ main (int argc, char *argv[]) int show_properties = 0; int show_type = 0; int c; - int option_index; + int option_index; jack_port_t *port; struct option long_options[] = { @@ -169,7 +169,7 @@ main (int argc, char *argv[]) if (show_type) { if (port) { putc ('\t', stdout); - //fputs (port->type_info->type_name, stdout); + fputs (jack_port_type (port), stdout); putc ('\n', stdout); } }