Browse Source

Correct jack_lsp and use STL find

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@1293 0c269be4-1314-0410-8aa9-9f06e86f4224
tags/0.59
sletz 19 years ago
parent
commit
b43e380ae1
2 changed files with 4 additions and 5 deletions
  1. +2
    -3
      common/JackClient.cpp
  2. +2
    -2
      example-clients/lsp.c

+ 2
- 3
common/JackClient.cpp View File

@@ -28,6 +28,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#include "JackTransportEngine.h"
#include <math.h>
#include <string>
#include <algorithm>

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<jack_port_id_t>::iterator it;
for (it = fPortList.begin(); it != fPortList.end() && *it != port_index; it++)
;
list<jack_port_id_t>::iterator it = find(fPortList.begin(), fPortList.end(), port_index);

if (it != fPortList.end()) {
fPortList.erase(it);


+ 2
- 2
example-clients/lsp.c View File

@@ -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);
}
}


Loading…
Cancel
Save