Commit 022e5513 authored by sletz's avatar sletz
Browse files

Cleanup.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@4608 0c269be4-1314-0410-8aa9-9f06e86f4224
parent 4f25dd86
......@@ -1494,7 +1494,7 @@ LIB_EXPORT int jack_client_name_size(void)
LIB_EXPORT int jack_port_name_size(void)
{
return JACK_CLIENT_NAME_SIZE + JACK_PORT_NAME_SIZE;
return REAL_JACK_PORT_NAME_SIZE;
}
LIB_EXPORT int jack_port_type_size(void)
......
......@@ -140,8 +140,8 @@ int JackAudioDriver::Attach()
{
JackPort* port;
jack_port_id_t port_index;
char name[JACK_CLIENT_NAME_SIZE + JACK_PORT_NAME_SIZE];
char alias[JACK_CLIENT_NAME_SIZE + JACK_PORT_NAME_SIZE];
char name[REAL_JACK_PORT_NAME_SIZE];
char alias[REAL_JACK_PORT_NAME_SIZE];
int i;
jack_log("JackAudioDriver::Attach fBufferSize = %ld fSampleRate = %ld", fEngineControl->fBufferSize, fEngineControl->fSampleRate);
......
......@@ -640,14 +640,14 @@ int JackClient::PortRegister(const char* port_name, const char* port_type, unsig
{
// Check if port name is empty
string port_name_str = string(port_name);
if (port_name_str.size() == 0) {
if (port_name_str.size() == 0)
jack_error("port_name is empty");
return 0; // Means failure here...
}
// Check port name length
string name = string(GetClientControl()->fName) + string(":") + port_name_str;
if (name.size() >= JACK_PORT_NAME_SIZE) {
if (name.size() >= REAL_JACK_PORT_NAME_SIZE) {
jack_error("\"%s:%s\" is too long to be used as a JACK port name.\n"
"Please use %lu characters or less",
GetClientControl()->fName,
......
......@@ -36,6 +36,8 @@
#define JACK_UUID_SIZE 32
#define JACK_SESSION_COMMAND_SIZE 256
#define REAL_JACK_PORT_NAME_SIZE JACK_CLIENT_NAME_SIZE + JACK_PORT_NAME_SIZE
#ifndef PORT_NUM
#define PORT_NUM 2048
#endif
......
......@@ -461,8 +461,8 @@ void JackDriver::SaveConnections()
{
const char** connections;
fConnections.clear();
char alias1[JACK_CLIENT_NAME_SIZE + JACK_PORT_NAME_SIZE];
char alias2[JACK_CLIENT_NAME_SIZE + JACK_PORT_NAME_SIZE];
char alias1[REAL_JACK_PORT_NAME_SIZE];
char alias2[REAL_JACK_PORT_NAME_SIZE];
char* aliases[2];
aliases[0] = alias1;
......
......@@ -921,7 +921,7 @@ int JackEngine::PortDisconnect(int refnum, jack_port_id_t src, jack_port_id_t ds
int JackEngine::PortRename(int refnum, jack_port_id_t port, const char* name)
{
char old_name[JACK_CLIENT_NAME_SIZE + JACK_PORT_NAME_SIZE];
char old_name[REAL_JACK_PORT_NAME_SIZE];
strcpy(old_name, fGraphManager->GetPort(port)->GetName());
fGraphManager->GetPort(port)->SetName(name);
NotifyPortRename(port, old_name);
......
......@@ -58,8 +58,8 @@ int JackMidiDriver::Attach()
{
JackPort* port;
jack_port_id_t port_index;
char name[JACK_CLIENT_NAME_SIZE + JACK_PORT_NAME_SIZE];
char alias[JACK_CLIENT_NAME_SIZE + JACK_PORT_NAME_SIZE];
char name[REAL_JACK_PORT_NAME_SIZE];
char alias[REAL_JACK_PORT_NAME_SIZE];
int i;
jack_log("JackMidiDriver::Attach fBufferSize = %ld fSampleRate = %ld", fEngineControl->fBufferSize, fEngineControl->fSampleRate);
......
......@@ -245,8 +245,8 @@ namespace Jack
JackPort* port;
jack_port_id_t port_index;
char name[JACK_CLIENT_NAME_SIZE + JACK_PORT_NAME_SIZE];
char alias[JACK_CLIENT_NAME_SIZE + JACK_PORT_NAME_SIZE];
char name[REAL_JACK_PORT_NAME_SIZE];
char alias[REAL_JACK_PORT_NAME_SIZE];
int audio_port_index;
int midi_port_index;
jack_latency_range_t range;
......
......@@ -225,7 +225,7 @@ void JackPort::SetName(const char* new_name)
bool JackPort::NameEquals(const char* target)
{
char buf[JACK_PORT_NAME_SIZE + 1];
char buf[REAL_JACK_PORT_NAME_SIZE];
/* this nasty, nasty kludge is here because between 0.109.0 and 0.109.1,
the ALSA audio backend had the name "ALSA", whereas as before and
......@@ -249,12 +249,12 @@ int JackPort::GetAliases(char* const aliases[2])
int cnt = 0;
if (fAlias1[0] != '\0') {
snprintf(aliases[0], JACK_CLIENT_NAME_SIZE + JACK_PORT_NAME_SIZE, "%s", fAlias1);
snprintf(aliases[0], REAL_JACK_PORT_NAME_SIZE, "%s", fAlias1);
cnt++;
}
if (fAlias2[0] != '\0') {
snprintf(aliases[1], JACK_CLIENT_NAME_SIZE + JACK_PORT_NAME_SIZE, "%s", fAlias2);
snprintf(aliases[1], REAL_JACK_PORT_NAME_SIZE, "%s", fAlias2);
cnt++;
}
......
......@@ -45,9 +45,9 @@ class SERVER_EXPORT JackPort
int fTypeId;
enum JackPortFlags fFlags;
char fName[JACK_CLIENT_NAME_SIZE + JACK_PORT_NAME_SIZE];
char fAlias1[JACK_CLIENT_NAME_SIZE + JACK_PORT_NAME_SIZE];
char fAlias2[JACK_CLIENT_NAME_SIZE + JACK_PORT_NAME_SIZE];
char fName[REAL_JACK_PORT_NAME_SIZE];
char fAlias1[REAL_JACK_PORT_NAME_SIZE];
char fAlias2[REAL_JACK_PORT_NAME_SIZE];
int fRefNum;
jack_nframes_t fLatency;
......
......@@ -96,8 +96,8 @@ int JackAlsaDriver::Attach()
JackPort* port;
jack_port_id_t port_index;
unsigned long port_flags = (unsigned long)CaptureDriverFlags;
char name[JACK_CLIENT_NAME_SIZE + JACK_PORT_NAME_SIZE];
char alias[JACK_CLIENT_NAME_SIZE + JACK_PORT_NAME_SIZE];
char name[REAL_JACK_PORT_NAME_SIZE];
char alias[REAL_JACK_PORT_NAME_SIZE];
assert(fCaptureChannels < DRIVER_PORT_NUM);
assert(fPlaybackChannels < DRIVER_PORT_NUM);
......
......@@ -31,12 +31,12 @@ namespace Jack {
private:
char alias[JACK_CLIENT_NAME_SIZE + JACK_PORT_NAME_SIZE];
char alias[REAL_JACK_PORT_NAME_SIZE];
struct pollfd *alsa_poll_fds;
int alsa_poll_fd_count;
int fds[2];
unsigned short io_mask;
char name[JACK_CLIENT_NAME_SIZE + JACK_PORT_NAME_SIZE];
char name[REAL_JACK_PORT_NAME_SIZE];
struct pollfd *queue_poll_fd;
protected:
......
......@@ -347,8 +347,8 @@ int JackFFADODriver::Attach()
{
JackPort* port;
jack_port_id_t port_index;
char buf[JACK_PORT_NAME_SIZE];
char portname[JACK_PORT_NAME_SIZE];
char buf[REAL_JACK_PORT_NAME_SIZE];
char portname[REAL_JACK_PORT_NAME_SIZE];
jack_latency_range_t range;
ffado_driver_t* driver = (ffado_driver_t*)fDriver;
......
......@@ -669,8 +669,8 @@ int JackFreebobDriver::Attach()
JackPort* port;
jack_port_id_t port_index;
char buf[JACK_PORT_NAME_SIZE];
char portname[JACK_PORT_NAME_SIZE];
char buf[REAL_JACK_PORT_NAME_SIZE];
char portname[REAL_JACK_PORT_NAME_SIZE];
jack_latency_range_t range;
freebob_driver_t* driver = (freebob_driver_t*)fDriver;
......
......@@ -1910,8 +1910,8 @@ int JackCoreAudioDriver::Attach()
UInt32 size;
Boolean isWritable;
char channel_name[64];
char name[JACK_CLIENT_NAME_SIZE + JACK_PORT_NAME_SIZE];
char alias[JACK_CLIENT_NAME_SIZE + JACK_PORT_NAME_SIZE];
char name[REAL_JACK_PORT_NAME_SIZE];
char alias[REAL_JACK_PORT_NAME_SIZE];
jack_log("JackCoreAudioDriver::Attach fBufferSize %ld fSampleRate %ld", fEngineControl->fBufferSize, fEngineControl->fSampleRate);
......
......@@ -62,7 +62,7 @@ JackCoreMidiPort::Initialize(const char *alias_name, const char *client_name,
const char *driver_name, int index,
MIDIEndpointRef endpoint, bool is_output)
{
char endpoint_name[JACK_CLIENT_NAME_SIZE + JACK_PORT_NAME_SIZE];
char endpoint_name[REAL_JACK_PORT_NAME_SIZE];
CFStringRef endpoint_name_ref;
int num = index + 1;
Boolean res;
......
......@@ -30,9 +30,9 @@ namespace Jack {
private:
char alias[JACK_CLIENT_NAME_SIZE + JACK_PORT_NAME_SIZE];
char alias[REAL_JACK_PORT_NAME_SIZE];
bool initialized;
char name[JACK_CLIENT_NAME_SIZE + JACK_PORT_NAME_SIZE];
char name[REAL_JACK_PORT_NAME_SIZE];
protected:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment