Browse Source

Make JackPortRenameCallback return void, to match JACK1 API

JACK2 added this function first, but the int return has been always wrong.
When JACK1 added JackPortRenameCallback it used the proper return.

Now that JACK1 supports port renames, devs will start to use it.
(previously it didn't work properly because of the missing jack_client_t* arg)

Some code might be broken because of this, but it's a very simple change,
and existing code would have been broken when changing JACK1 to JACK2.

Finally, JACK2 code never uses the int return value of this callback.
So there's no real reason to NOT change this.
tags/v1.9.11-RC1
falkTX 8 years ago
parent
commit
05216197b4
2 changed files with 2 additions and 5 deletions
  1. +1
    -3
      common/jack/types.h
  2. +1
    -2
      tests/test.cpp

+ 1
- 3
common/jack/types.h View File

@@ -403,10 +403,8 @@ typedef void (*JackPortConnectCallback)(jack_port_id_t a, jack_port_id_t b, int
* @param port the port that has been renamed
* @param new_name the new name
* @param arg pointer to a client supplied structure
*
* @return zero on success, non-zero on error
*/
typedef int (*JackPortRenameCallback)(jack_port_id_t port, const char* old_name, const char* new_name, void *arg);
typedef void (*JackPortRenameCallback)(jack_port_id_t port, const char* old_name, const char* new_name, void *arg);

/**
* Prototype for the client supplied function that is called


+ 1
- 2
tests/test.cpp View File

@@ -186,11 +186,10 @@ void Jack_Client_Registration_Callback(const char* name, int val, void *arg)
client_register--;
}

int Jack_Port_Rename_Callback(jack_port_id_t port, const char* old_name, const char* new_name, void *arg)
void Jack_Port_Rename_Callback(jack_port_id_t port, const char* old_name, const char* new_name, void *arg)
{
Log("Rename callback has been successfully called with old_name '%s' and new_name '%s'. (msg from callback)\n", old_name, new_name);
port_rename_clbk = 1;
return 0;
}

int Jack_Update_Buffer_Size(jack_nframes_t nframes, void *arg)


Loading…
Cancel
Save