mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2026-02-08 10:06:19 -05:00
replace SNDMSG,SYSMSG,SNDERR,SYSERR with new log macros
... with interface identifiers Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
492df4bb94
commit
62c8e635dc
82 changed files with 1292 additions and 1201 deletions
|
|
@ -914,30 +914,30 @@ static int snd_seq_open_conf(snd_seq_t **seqp, const char *name,
|
|||
void *h = NULL;
|
||||
if (snd_config_get_type(seq_conf) != SND_CONFIG_TYPE_COMPOUND) {
|
||||
if (name)
|
||||
SNDERR("Invalid type for SEQ %s definition", name);
|
||||
snd_error(SEQUENCER, "Invalid type for SEQ %s definition", name);
|
||||
else
|
||||
SNDERR("Invalid type for SEQ definition");
|
||||
snd_error(SEQUENCER, "Invalid type for SEQ definition");
|
||||
return -EINVAL;
|
||||
}
|
||||
err = snd_config_search(seq_conf, "type", &conf);
|
||||
if (err < 0) {
|
||||
SNDERR("type is not defined");
|
||||
snd_error(SEQUENCER, "type is not defined");
|
||||
return err;
|
||||
}
|
||||
err = snd_config_get_id(conf, &id);
|
||||
if (err < 0) {
|
||||
SNDERR("unable to get id");
|
||||
snd_error(SEQUENCER, "unable to get id");
|
||||
return err;
|
||||
}
|
||||
err = snd_config_get_string(conf, &str);
|
||||
if (err < 0) {
|
||||
SNDERR("Invalid type for %s", id);
|
||||
snd_error(SEQUENCER, "Invalid type for %s", id);
|
||||
return err;
|
||||
}
|
||||
err = snd_config_search_definition(seq_root, "seq_type", str, &type_conf);
|
||||
if (err >= 0) {
|
||||
if (snd_config_get_type(type_conf) != SND_CONFIG_TYPE_COMPOUND) {
|
||||
SNDERR("Invalid type for SEQ type %s definition", str);
|
||||
snd_error(SEQUENCER, "Invalid type for SEQ type %s definition", str);
|
||||
goto _err;
|
||||
}
|
||||
snd_config_for_each(i, next, type_conf) {
|
||||
|
|
@ -950,7 +950,7 @@ static int snd_seq_open_conf(snd_seq_t **seqp, const char *name,
|
|||
if (strcmp(id, "lib") == 0) {
|
||||
err = snd_config_get_string(n, &lib);
|
||||
if (err < 0) {
|
||||
SNDERR("Invalid type for %s", id);
|
||||
snd_error(SEQUENCER, "Invalid type for %s", id);
|
||||
goto _err;
|
||||
}
|
||||
continue;
|
||||
|
|
@ -958,12 +958,12 @@ static int snd_seq_open_conf(snd_seq_t **seqp, const char *name,
|
|||
if (strcmp(id, "open") == 0) {
|
||||
err = snd_config_get_string(n, &open_name);
|
||||
if (err < 0) {
|
||||
SNDERR("Invalid type for %s", id);
|
||||
snd_error(SEQUENCER, "Invalid type for %s", id);
|
||||
goto _err;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
SNDERR("Unknown field %s", id);
|
||||
snd_error(SEQUENCER, "Unknown field %s", id);
|
||||
err = -EINVAL;
|
||||
goto _err;
|
||||
}
|
||||
|
|
@ -980,10 +980,10 @@ static int snd_seq_open_conf(snd_seq_t **seqp, const char *name,
|
|||
open_func = snd_dlsym(h, open_name, SND_DLSYM_VERSION(SND_SEQ_DLSYM_VERSION));
|
||||
err = 0;
|
||||
if (!h) {
|
||||
SNDERR("Cannot open shared library %s (%s)", lib, errbuf);
|
||||
snd_error(SEQUENCER, "Cannot open shared library %s (%s)", lib, errbuf);
|
||||
err = -ENOENT;
|
||||
} else if (!open_func) {
|
||||
SNDERR("symbol %s is not defined inside %s", open_name, lib);
|
||||
snd_error(SEQUENCER, "symbol %s is not defined inside %s", open_name, lib);
|
||||
snd_dlclose(h);
|
||||
err = -ENXIO;
|
||||
}
|
||||
|
|
@ -1008,7 +1008,7 @@ static int snd_seq_open_noupdate(snd_seq_t **seqp, snd_config_t *root,
|
|||
snd_config_t *seq_conf;
|
||||
err = snd_config_search_definition(root, "seq", name, &seq_conf);
|
||||
if (err < 0) {
|
||||
SNDERR("Unknown SEQ %s", name);
|
||||
snd_error(SEQUENCER, "Unknown SEQ %s", name);
|
||||
return err;
|
||||
}
|
||||
snd_config_set_hop(seq_conf, hop);
|
||||
|
|
@ -4594,7 +4594,7 @@ static int snd_seq_event_input_feed(snd_seq_t *seq, int timeout)
|
|||
pfd.events = POLLIN;
|
||||
err = poll(&pfd, 1, timeout);
|
||||
if (err < 0) {
|
||||
SYSERR("poll");
|
||||
snd_errornum(SEQUENCER, "poll");
|
||||
return -errno;
|
||||
}
|
||||
if (pfd.revents & POLLIN)
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ static int snd_seq_hw_close(snd_seq_t *seq)
|
|||
|
||||
if (close(hw->fd)) {
|
||||
err = -errno;
|
||||
SYSERR("close failed\n");
|
||||
snd_errornum(SEQUENCER, "close failed\n");
|
||||
}
|
||||
free(hw);
|
||||
return err;
|
||||
|
|
@ -58,7 +58,7 @@ static int snd_seq_hw_nonblock(snd_seq_t *seq, int nonblock)
|
|||
long flags;
|
||||
|
||||
if ((flags = fcntl(hw->fd, F_GETFL)) < 0) {
|
||||
SYSERR("F_GETFL failed");
|
||||
snd_errornum(SEQUENCER, "F_GETFL failed");
|
||||
return -errno;
|
||||
}
|
||||
if (nonblock)
|
||||
|
|
@ -66,7 +66,7 @@ static int snd_seq_hw_nonblock(snd_seq_t *seq, int nonblock)
|
|||
else
|
||||
flags &= ~O_NONBLOCK;
|
||||
if (fcntl(hw->fd, F_SETFL, flags) < 0) {
|
||||
SYSERR("F_SETFL for O_NONBLOCK failed");
|
||||
snd_errornum(SEQUENCER, "F_SETFL for O_NONBLOCK failed");
|
||||
return -errno;
|
||||
}
|
||||
return 0;
|
||||
|
|
@ -77,7 +77,7 @@ static int snd_seq_hw_client_id(snd_seq_t *seq)
|
|||
snd_seq_hw_t *hw = seq->private_data;
|
||||
int client;
|
||||
if (ioctl(hw->fd, SNDRV_SEQ_IOCTL_CLIENT_ID, &client) < 0) {
|
||||
SYSERR("SNDRV_SEQ_IOCTL_CLIENT_ID failed");
|
||||
snd_errornum(SEQUENCER, "SNDRV_SEQ_IOCTL_CLIENT_ID failed");
|
||||
return -errno;
|
||||
}
|
||||
return client;
|
||||
|
|
@ -87,7 +87,7 @@ static int snd_seq_hw_system_info(snd_seq_t *seq, snd_seq_system_info_t * info)
|
|||
{
|
||||
snd_seq_hw_t *hw = seq->private_data;
|
||||
if (ioctl(hw->fd, SNDRV_SEQ_IOCTL_SYSTEM_INFO, info) < 0) {
|
||||
SYSERR("SNDRV_SEQ_IOCTL_SYSTEM_INFO failed");
|
||||
snd_errornum(SEQUENCER, "SNDRV_SEQ_IOCTL_SYSTEM_INFO failed");
|
||||
return -errno;
|
||||
}
|
||||
return 0;
|
||||
|
|
@ -537,11 +537,11 @@ int snd_seq_hw_open(snd_seq_t **handle, const char *name, int streams, int mode)
|
|||
}
|
||||
#endif
|
||||
if (fd < 0) {
|
||||
SYSERR("open %s failed", filename);
|
||||
snd_errornum(SEQUENCER, "open %s failed", filename);
|
||||
return -errno;
|
||||
}
|
||||
if (ioctl(fd, SNDRV_SEQ_IOCTL_PVERSION, &ver) < 0) {
|
||||
SYSERR("SNDRV_SEQ_IOCTL_PVERSION failed");
|
||||
snd_errornum(SEQUENCER, "SNDRV_SEQ_IOCTL_PVERSION failed");
|
||||
ret = -errno;
|
||||
close(fd);
|
||||
return ret;
|
||||
|
|
|
|||
|
|
@ -525,7 +525,7 @@ int snd_seq_create_ump_endpoint(snd_seq_t *seq,
|
|||
return -EINVAL;
|
||||
|
||||
if (!(info->protocol_caps & info->protocol)) {
|
||||
SNDERR("Inconsistent UMP protocol_caps and protocol\n");
|
||||
snd_error(SEQUENCER, "Inconsistent UMP protocol_caps and protocol\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
|
@ -534,13 +534,13 @@ int snd_seq_create_ump_endpoint(snd_seq_t *seq,
|
|||
} else if (info->protocol & SND_UMP_EP_INFO_PROTO_MIDI1) {
|
||||
version = SND_SEQ_CLIENT_UMP_MIDI_1_0;
|
||||
} else {
|
||||
SNDERR("Invalid UMP protocol set 0x%x\n", info->protocol);
|
||||
snd_error(SEQUENCER, "Invalid UMP protocol set 0x%x\n", info->protocol);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
err = snd_seq_set_client_midi_version(seq, version);
|
||||
if (err < 0) {
|
||||
SNDERR("Failed to set to MIDI protocol 0x%x\n", version);
|
||||
snd_error(SEQUENCER, "Failed to set to MIDI protocol 0x%x\n", version);
|
||||
return err;
|
||||
}
|
||||
|
||||
|
|
@ -560,7 +560,7 @@ int snd_seq_create_ump_endpoint(snd_seq_t *seq,
|
|||
|
||||
err = snd_seq_set_ump_endpoint_info(seq, seq->ump_ep);
|
||||
if (err < 0) {
|
||||
SNDERR("Failed to set UMP EP info\n");
|
||||
snd_error(SEQUENCER, "Failed to set UMP EP info\n");
|
||||
goto error_free;
|
||||
}
|
||||
|
||||
|
|
@ -586,7 +586,7 @@ int snd_seq_create_ump_endpoint(snd_seq_t *seq,
|
|||
snd_seq_port_info_set_ump_group(pinfo, 0);
|
||||
err = snd_seq_create_port(seq, pinfo);
|
||||
if (err < 0) {
|
||||
SNDERR("Failed to create MIDI 2.0 port\n");
|
||||
snd_error(SEQUENCER, "Failed to create MIDI 2.0 port\n");
|
||||
goto error_free;
|
||||
}
|
||||
|
||||
|
|
@ -601,7 +601,7 @@ int snd_seq_create_ump_endpoint(snd_seq_t *seq,
|
|||
snd_seq_port_info_set_ump_group(pinfo, i + 1);
|
||||
err = snd_seq_create_port(seq, pinfo);
|
||||
if (err < 0) {
|
||||
SNDERR("Failed to create Group port %d\n", i + 1);
|
||||
snd_error(SEQUENCER, "Failed to create Group port %d\n", i + 1);
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
|
|
@ -725,7 +725,7 @@ int snd_seq_create_ump_block(snd_seq_t *seq, int blkid,
|
|||
|
||||
err = snd_seq_set_ump_block_info(seq, blkid, bp);
|
||||
if (err < 0) {
|
||||
SNDERR("Failed to set UMP EP info\n");
|
||||
snd_error(SEQUENCER, "Failed to set UMP EP info\n");
|
||||
free(bp);
|
||||
seq->ump_blks[blkid] = NULL;
|
||||
return err;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue