Commit 914a79d4 authored by Torben Hohn's avatar Torben Hohn
Browse files

use constant JACK_UUID_SIZE for uuid size.

parent 542aa6c7
......@@ -277,7 +277,7 @@ int JackClient::ClientNotify(int refnum, const char* name, int notify, int sync,
jack_log("JackClient::kSessionCallback");
if (fSession) {
jack_session_event_t *event = (jack_session_event_t *) malloc( sizeof(jack_session_event_t) );
char uuid_buf[32];
char uuid_buf[JACK_UUID_SIZE];
event->type = (jack_session_event_type_t) value1;
event->session_dir = strdup( message );
event->command_line = NULL;
......@@ -1111,7 +1111,7 @@ int JackClient::SessionReply( jack_session_event_t *ev )
char* JackClient::GetUUIDForClientName(const char* client_name)
{
char uuid_res[JACK_CLIENT_NAME_SIZE + 1];
char uuid_res[JACK_UUID_SIZE];
int result = -1;
fChannel->GetUUIDForClientName( GetClientControl()->fRefNum, client_name, uuid_res, &result);
......
......@@ -47,7 +47,7 @@ struct JackClientControl : public JackShmMemAble
bool fActive;
int fSessionID;
char fSessionCommand[256 + 1];
char fSessionCommand[JACK_SESSION_COMMAND_SIZE];
jack_session_flags_t fSessionFlags;
JackClientControl(const char* name, int pid, int refnum, int uuid)
......
......@@ -33,6 +33,8 @@
#define JACK_CLIENT_NAME_SIZE 64
#define JACK_MESSAGE_SIZE 256
#define JACK_UUID_SIZE 32
#define JACK_SESSION_COMMAND_SIZE 256
#ifndef PORT_NUM
#define PORT_NUM 2048
......@@ -71,6 +73,7 @@
#define FREEWHEEL_DRIVER_TIMEOUT 10 // in sec
#define DRIVER_TIMEOUT_FACTOR 10
#define NO_PORT 0xFFFE
#define EMPTY 0xFFFD
......
......@@ -955,7 +955,7 @@ void JackEngine::SessionNotify(int refnum, const char *target, jack_session_even
if (result == 2) {
fSessionPendingReplies += 1;
} else if (result == 1) {
char uuid_buf[32];
char uuid_buf[JACK_UUID_SIZE];
snprintf( uuid_buf, sizeof(uuid_buf), "%d", client->GetClientControl()->fSessionID );
fSessionResult->fCommandList.push_back( JackSessionCommand( uuid_buf,
client->GetClientControl()->fName,
......@@ -977,7 +977,7 @@ void JackEngine::SessionNotify(int refnum, const char *target, jack_session_even
void JackEngine::SessionReply(int refnum)
{
JackClientInterface* client = fClientTable[refnum];
char uuid_buf[32];
char uuid_buf[JACK_UUID_SIZE];
snprintf( uuid_buf, sizeof(uuid_buf), "%d", client->GetClientControl()->fSessionID );
fSessionResult->fCommandList.push_back( JackSessionCommand( uuid_buf,
client->GetClientControl()->fName,
......@@ -998,7 +998,7 @@ void JackEngine::GetUUIDForClientName(const char *client_name, char *uuid_res, i
JackClientInterface* client = fClientTable[i];
if (client && (strcmp(client_name, client->GetClientControl()->fName)==0)) {
snprintf(uuid_res, 32, "%d", client->GetClientControl()->fSessionID);
snprintf(uuid_res, JACK_UUID_SIZE, "%d", client->GetClientControl()->fSessionID);
*result = 0;
return;
}
......@@ -1016,8 +1016,8 @@ void JackEngine::GetClientNameForUUID(const char *uuid, char *name_res, int *res
if (!client)
continue;
char uuid_buf[33];
snprintf(uuid_buf, 32, "%d", client->GetClientControl()->fSessionID);
char uuid_buf[JACK_UUID_SIZE];
snprintf(uuid_buf, JACK_UUID_SIZE, "%d", client->GetClientControl()->fSessionID);
if (strcmp(uuid,uuid_buf) == 0) {
strncpy(name_res, client->GetClientControl()->fName, JACK_CLIENT_NAME_SIZE);
......
......@@ -1084,9 +1084,9 @@ struct JackClientNotificationRequest : public JackRequest
struct JackSessionCommand
{
char fUUID[32];
char fUUID[JACK_UUID_SIZE];
char fClientName[JACK_CLIENT_NAME_SIZE+1];
char fCommand[MAX_PATH+1];
char fCommand[JACK_SESSION_COMMAND_SIZE];
jack_session_flags_t fFlags;
JackSessionCommand()
......@@ -1252,7 +1252,7 @@ struct JackClientNameResult : public JackResult
struct JackUUIDResult : public JackResult
{
char fUUID[32 + 1];
char fUUID[JACK_UUID_SIZE];
JackUUIDResult(): JackResult()
{}
......@@ -1309,7 +1309,7 @@ struct JackGetUUIDRequest : public JackRequest
struct JackGetClientNameRequest : public JackRequest
{
char fUUID[32 + 1];
char fUUID[JACK_UUID_SIZE];
JackGetClientNameRequest()
{}
......@@ -1340,7 +1340,7 @@ struct JackReserveNameRequest : public JackRequest
{
int fRefNum;
char fName[JACK_CLIENT_NAME_SIZE + 1];
char fUUID[32 + 1];
char fUUID[JACK_UUID_SIZE];
JackReserveNameRequest()
{}
......
......@@ -286,7 +286,7 @@ void JackSocketClientChannel::GetUUIDForClientName( int refnum, const char *clie
JackGetUUIDRequest req(client_name);
JackUUIDResult res;
ServerSyncCall(&req, &res, result);
strncpy( uuid_res, res.fUUID, 32 );
strncpy( uuid_res, res.fUUID, JACK_UUID_SIZE );
}
void JackSocketClientChannel::GetClientNameForUUID( int refnum, const char *uuid, char *name_res, int *result )
......
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