mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2026-02-06 04:06:34 -05:00
huge correction of tabulators and whitespaces
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
b37ac0982b
commit
66a3d542ac
157 changed files with 2008 additions and 2008 deletions
|
|
@ -108,7 +108,7 @@ int snd_card_load(int card)
|
|||
int snd_card_next(int *rcard)
|
||||
{
|
||||
int card;
|
||||
|
||||
|
||||
if (rcard == NULL)
|
||||
return -EINVAL;
|
||||
card = *rcard;
|
||||
|
|
@ -194,7 +194,7 @@ int snd_card_get_name(int card, char **name)
|
|||
snd_ctl_t *handle;
|
||||
snd_ctl_card_info_t info;
|
||||
int err;
|
||||
|
||||
|
||||
if (name == NULL)
|
||||
return -EINVAL;
|
||||
if ((err = snd_ctl_hw_open(&handle, NULL, card, 0)) < 0)
|
||||
|
|
@ -224,7 +224,7 @@ int snd_card_get_longname(int card, char **name)
|
|||
snd_ctl_t *handle;
|
||||
snd_ctl_card_info_t info;
|
||||
int err;
|
||||
|
||||
|
||||
if (name == NULL)
|
||||
return -EINVAL;
|
||||
if ((err = snd_ctl_hw_open(&handle, NULL, card, 0)) < 0)
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ file. The format is:
|
|||
|
||||
\verbatim
|
||||
index [ID ] Driver - name
|
||||
longname
|
||||
longname
|
||||
\endverbatim
|
||||
|
||||
Note that the mixername and components are not listed.
|
||||
|
|
@ -279,7 +279,7 @@ int snd_ctl_new(snd_ctl_t **ctlp, snd_ctl_type_t type, const char *name, int mod
|
|||
*ctlp = ctl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* \brief set async mode
|
||||
|
|
@ -353,7 +353,7 @@ int snd_ctl_poll_descriptors_revents(snd_ctl_t *ctl, struct pollfd *pfds, unsign
|
|||
return ctl->ops->poll_revents(ctl, pfds, nfds, revents);
|
||||
if (nfds == 1) {
|
||||
*revents = pfds->revents;
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
@ -1039,7 +1039,7 @@ int snd_ctl_elem_write(snd_ctl_t *ctl, snd_ctl_elem_value_t *data)
|
|||
|
||||
static int snd_ctl_tlv_do(snd_ctl_t *ctl, int op_flag,
|
||||
const snd_ctl_elem_id_t *id,
|
||||
unsigned int *tlv, unsigned int tlv_size)
|
||||
unsigned int *tlv, unsigned int tlv_size)
|
||||
{
|
||||
snd_ctl_elem_info_t *info = NULL;
|
||||
int err;
|
||||
|
|
@ -1060,8 +1060,8 @@ static int snd_ctl_tlv_do(snd_ctl_t *ctl, int op_flag,
|
|||
}
|
||||
err = ctl->ops->element_tlv(ctl, op_flag, id->numid, tlv, tlv_size);
|
||||
__err:
|
||||
if (info)
|
||||
free(info);
|
||||
if (info)
|
||||
free(info);
|
||||
return err;
|
||||
}
|
||||
|
||||
|
|
@ -1402,7 +1402,7 @@ int snd_ctl_wait(snd_ctl_t *ctl, int timeout)
|
|||
* \param private_data Callback private data
|
||||
* \return 0 otherwise a negative error code on failure
|
||||
*/
|
||||
int snd_async_add_ctl_handler(snd_async_handler_t **handler, snd_ctl_t *ctl,
|
||||
int snd_async_add_ctl_handler(snd_async_handler_t **handler, snd_ctl_t *ctl,
|
||||
snd_async_callback_t callback, void *private_data)
|
||||
{
|
||||
int err;
|
||||
|
|
@ -1752,7 +1752,7 @@ int snd_ctl_elem_list_alloc_space(snd_ctl_elem_list_t *obj, unsigned int entries
|
|||
}
|
||||
obj->space = entries;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief free previously allocated space for CTL element identifiers list
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ const char *_snd_module_control_ext = "";
|
|||
static int snd_ctl_ext_close(snd_ctl_t *handle)
|
||||
{
|
||||
snd_ctl_ext_t *ext = handle->private_data;
|
||||
|
||||
|
||||
if (ext->callback->close)
|
||||
ext->callback->close(ext);
|
||||
return 0;
|
||||
|
|
@ -458,7 +458,7 @@ static int snd_ctl_ext_poll_revents(snd_ctl_t *handle, struct pollfd *pfds, unsi
|
|||
return ext->callback->poll_revents(ext, pfds, nfds, revents);
|
||||
if (nfds == 1) {
|
||||
*revents = pfds->revents;
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
@ -529,7 +529,7 @@ usually you will call the external plugin API function
|
|||
#snd_ctl_ext_create().
|
||||
The control handle must be filled *phandle in return.
|
||||
Then this function must return either a value 0 when succeeded, or a
|
||||
negative value as the error code.
|
||||
negative value as the error code.
|
||||
|
||||
Finally, add #SND_CTL_PLUGIN_SYMBOL() with the name of your
|
||||
plugin as the argument at the end. This defines the proper versioned
|
||||
|
|
@ -625,7 +625,7 @@ PCM.
|
|||
\section ctl_ext_impl_cb Callback Functions of External Control Plugins
|
||||
|
||||
The callback functions in #snd_ctl_ext_callback_t define the real
|
||||
behavior of the driver. There are many callbacks but many of them are optional.
|
||||
behavior of the driver. There are many callbacks but many of them are optional.
|
||||
|
||||
The close callback is called when the PCM is closed. If the plugin
|
||||
allocates private resources, this is the place to release them
|
||||
|
|
@ -650,7 +650,7 @@ if you use get, read and write callbacks as follows.
|
|||
If you need to create a record dynamically (e.g. via malloc) at each find_elem call,
|
||||
the allocated record can be released with the optional free_key callback.
|
||||
|
||||
The get_attribute is a mandatory callback, which returns the attribute of the
|
||||
The get_attribute is a mandatory callback, which returns the attribute of the
|
||||
control element given via a key value (converted with find_elem callback).
|
||||
It must fill the control element type (#snd_ctl_elem_type_t), the access type
|
||||
(#snd_ctl_ext_access_t), and the count (element array size). The callback returns
|
||||
|
|
|
|||
|
|
@ -225,20 +225,20 @@ static int snd_ctl_hw_elem_tlv(snd_ctl_t *handle, int op_flag,
|
|||
unsigned int inum;
|
||||
snd_ctl_hw_t *hw = handle->private_data;
|
||||
struct snd_ctl_tlv *xtlv;
|
||||
|
||||
|
||||
/* we don't support TLV on protocol ver 2.0.3 or earlier */
|
||||
if (hw->protocol < SNDRV_PROTOCOL_VERSION(2, 0, 4))
|
||||
return -ENXIO;
|
||||
|
||||
switch (op_flag) {
|
||||
case -1: inum = SNDRV_CTL_IOCTL_TLV_COMMAND; break;
|
||||
case 0: inum = SNDRV_CTL_IOCTL_TLV_READ; break;
|
||||
case 0: inum = SNDRV_CTL_IOCTL_TLV_READ; break;
|
||||
case 1: inum = SNDRV_CTL_IOCTL_TLV_WRITE; break;
|
||||
default: return -EINVAL;
|
||||
}
|
||||
xtlv = malloc(sizeof(struct snd_ctl_tlv) + tlv_size);
|
||||
if (xtlv == NULL)
|
||||
return -ENOMEM;
|
||||
return -ENOMEM;
|
||||
xtlv->numid = numid;
|
||||
xtlv->length = tlv_size;
|
||||
memcpy(xtlv->tlv, tlv, tlv_size);
|
||||
|
|
@ -435,7 +435,7 @@ int snd_ctl_hw_open(snd_ctl_t **handle, const char *name, int card, int mode)
|
|||
snd_ctl_hw_t *hw;
|
||||
int err;
|
||||
|
||||
*handle = NULL;
|
||||
*handle = NULL;
|
||||
|
||||
if (CHECK_SANITY(card < 0 || card >= SND_MAX_CARDS)) {
|
||||
snd_check(CONTROL, "Invalid card index %d", card);
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ struct _snd_hctl_elem {
|
|||
struct _snd_hctl {
|
||||
snd_ctl_t *ctl;
|
||||
struct list_head elems; /* list of all controls */
|
||||
unsigned int alloc;
|
||||
unsigned int alloc;
|
||||
unsigned int count;
|
||||
snd_hctl_elem_t **pelems;
|
||||
snd_hctl_compare_t compare;
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stddef.h>
|
||||
|
|
@ -420,7 +420,7 @@ static int make_local_socket(const char *filename)
|
|||
sock = socket(PF_LOCAL, SOCK_STREAM, 0);
|
||||
if (sock < 0)
|
||||
return -errno;
|
||||
|
||||
|
||||
addr->sun_family = AF_LOCAL;
|
||||
memcpy(addr->sun_path, filename, l);
|
||||
|
||||
|
|
@ -492,7 +492,7 @@ int snd_ctl_shm_open(snd_ctl_t **handlep, const char *name, const char *sockname
|
|||
result = -errno;
|
||||
goto _err;
|
||||
}
|
||||
|
||||
|
||||
shm = calloc(1, sizeof(snd_ctl_shm_t));
|
||||
if (!shm) {
|
||||
result = -ENOMEM;
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ static const char **snd_control_open_objects[] = {
|
|||
&_snd_module_control_empty,
|
||||
#include "ctl_symbols_list.c"
|
||||
};
|
||||
|
||||
|
||||
void *snd_control_open_symbols(void)
|
||||
{
|
||||
return snd_control_open_objects;
|
||||
|
|
|
|||
|
|
@ -253,7 +253,7 @@ int __snd_ctl_ascii_elem_id_parse(snd_ctl_elem_id_t *dst, const char *str,
|
|||
if (*str)
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
}
|
||||
err = 0;
|
||||
|
||||
out:
|
||||
|
|
@ -277,12 +277,12 @@ int snd_ctl_ascii_elem_id_parse(snd_ctl_elem_id_t *dst, const char *str)
|
|||
static int get_ctl_enum_item_index(snd_ctl_t *handle,
|
||||
snd_ctl_elem_info_t *info,
|
||||
const char **ptrp)
|
||||
{
|
||||
{
|
||||
char *ptr = (char *)*ptrp;
|
||||
int items, i, len;
|
||||
const char *name;
|
||||
char end;
|
||||
|
||||
|
||||
items = snd_ctl_elem_info_get_items(info);
|
||||
if (items <= 0)
|
||||
return -1;
|
||||
|
|
@ -362,7 +362,7 @@ int snd_ctl_ascii_value_parse(snd_ctl_t *handle,
|
|||
|
||||
if (count > get_ctl_type_max_elements(type))
|
||||
count = get_ctl_type_max_elements(type);
|
||||
|
||||
|
||||
for (idx = 0; idx < count && ptr && *ptr; idx++) {
|
||||
if (*ptr == ',')
|
||||
goto skip;
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ int snd_hctl_open(snd_hctl_t **hctlp, const char *name, int mode)
|
|||
{
|
||||
snd_ctl_t *ctl;
|
||||
int err;
|
||||
|
||||
|
||||
if ((err = snd_ctl_open(&ctl, name, mode)) < 0)
|
||||
return err;
|
||||
err = snd_hctl_open_ctl(hctlp, ctl);
|
||||
|
|
@ -294,7 +294,7 @@ static int get_compare_weight(const snd_ctl_elem_id_t *id)
|
|||
};
|
||||
const char *name = (char *)id->name, *name1;
|
||||
int res, res1;
|
||||
|
||||
|
||||
if ((res = snd_hctl_compare_mixer_priority_lookup((const char **)&name, names, 1000000)) == NOT_FOUND)
|
||||
return NOT_FOUND;
|
||||
if (*name == '\0')
|
||||
|
|
@ -346,7 +346,7 @@ static int _snd_hctl_find_elem(snd_hctl_t *hctl, const snd_ctl_elem_id_t *id, in
|
|||
static int snd_hctl_elem_add(snd_hctl_t *hctl, snd_hctl_elem_t *elem)
|
||||
{
|
||||
int dir;
|
||||
int idx;
|
||||
int idx;
|
||||
elem->compare_weight = get_compare_weight(&elem->id);
|
||||
if (hctl->count == hctl->alloc) {
|
||||
snd_hctl_elem_t **h;
|
||||
|
|
@ -677,7 +677,7 @@ int snd_hctl_wait(snd_hctl_t *hctl, int timeout)
|
|||
struct pollfd *pfd;
|
||||
unsigned short *revents;
|
||||
int i, npfds, pollio, err, err_poll;
|
||||
|
||||
|
||||
npfds = snd_hctl_poll_descriptors_count(hctl);
|
||||
if (npfds <= 0 || npfds >= 16) {
|
||||
snd_error(CONTROL, "Invalid poll_fds %d", npfds);
|
||||
|
|
@ -781,7 +781,7 @@ int snd_hctl_handle_events(snd_hctl_t *hctl)
|
|||
snd_ctl_event_t event;
|
||||
int res;
|
||||
unsigned int count = 0;
|
||||
|
||||
|
||||
assert(hctl);
|
||||
assert(hctl->ctl);
|
||||
while ((res = snd_ctl_read(hctl->ctl, &event)) != 0 &&
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ struct hint_list {
|
|||
const char *siface;
|
||||
snd_ctl_elem_iface_t iface;
|
||||
snd_ctl_t *ctl;
|
||||
snd_ctl_card_info_t *info;
|
||||
snd_ctl_card_info_t *info;
|
||||
int card;
|
||||
int device;
|
||||
long device_input;
|
||||
|
|
@ -173,7 +173,7 @@ static char *get_dev_name(struct hint_list *list)
|
|||
{
|
||||
char *str1, *str2, *res;
|
||||
int device;
|
||||
|
||||
|
||||
device = list->device_input >= 0 ? list->device_input : list->device;
|
||||
if (get_dev_name1(list, &str1, device, 1) < 0)
|
||||
return NULL;
|
||||
|
|
@ -261,7 +261,7 @@ static int try_config(snd_config_t *config,
|
|||
snd_config_get_string(cfg, &str) >= 0 &&
|
||||
((strncmp(base, str, strlen(base)) == 0 &&
|
||||
str[strlen(base)] == '.') || strchr(str, '.') == NULL))
|
||||
goto __skip_add;
|
||||
goto __skip_add;
|
||||
if (list->card >= 0 && list->device >= 0)
|
||||
sprintf(buf, "%s:CARD=%s,DEV=%i", name, snd_ctl_card_info_get_id(list->info), list->device);
|
||||
else if (list->card >= 0)
|
||||
|
|
@ -294,7 +294,7 @@ static int try_config(snd_config_t *config,
|
|||
cfg1 = res;
|
||||
level = 0;
|
||||
__hint:
|
||||
level++;
|
||||
level++;
|
||||
if (snd_config_search(cfg1, "type", &cfg) >= 0 &&
|
||||
snd_config_get_string(cfg, &str) >= 0 &&
|
||||
strcmp(str, "hw") == 0) {
|
||||
|
|
@ -306,7 +306,7 @@ static int try_config(snd_config_t *config,
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (snd_config_search(cfg1, "hint", &cfg) >= 0) {
|
||||
if (snd_config_get_type(cfg) != SND_CONFIG_TYPE_COMPOUND) {
|
||||
snd_error(CONTROL, "hint (%s) must be a compound", buf);
|
||||
|
|
@ -363,7 +363,7 @@ static int try_config(snd_config_t *config,
|
|||
goto __skip_add;
|
||||
if (snd_config_search(cfg1, "slave", &cfg) >= 0 &&
|
||||
snd_config_search(cfg, base, &cfg1) >= 0)
|
||||
goto __hint;
|
||||
goto __hint;
|
||||
snd_config_delete(res);
|
||||
res = NULL;
|
||||
cleanup_res = 0;
|
||||
|
|
@ -395,38 +395,38 @@ static int try_config(snd_config_t *config,
|
|||
__ok:
|
||||
err = 0;
|
||||
__cleanup:
|
||||
if (err >= 0) {
|
||||
list->device = dev;
|
||||
str = list->card >= 0 ? get_dev_name(list) : NULL;
|
||||
if (str != NULL) {
|
||||
level = (buf1 == NULL ? 0 : strlen(buf1)) + 1 + strlen(str);
|
||||
buf2 = realloc((char *)str, level + 1);
|
||||
if (buf2 != NULL) {
|
||||
if (buf1 != NULL) {
|
||||
str = strchr(buf2, '|');
|
||||
if (str != NULL)
|
||||
if (err >= 0) {
|
||||
list->device = dev;
|
||||
str = list->card >= 0 ? get_dev_name(list) : NULL;
|
||||
if (str != NULL) {
|
||||
level = (buf1 == NULL ? 0 : strlen(buf1)) + 1 + strlen(str);
|
||||
buf2 = realloc((char *)str, level + 1);
|
||||
if (buf2 != NULL) {
|
||||
if (buf1 != NULL) {
|
||||
str = strchr(buf2, '|');
|
||||
if (str != NULL)
|
||||
memmove(buf2 + (level - strlen(str)), str, strlen(str));
|
||||
else
|
||||
str = buf2 + strlen(buf2);
|
||||
*(char *)str++ = '\n';
|
||||
memcpy((char *)str, buf1, strlen(buf1));
|
||||
buf2[level] = '\0';
|
||||
*(char *)str++ = '\n';
|
||||
memcpy((char *)str, buf1, strlen(buf1));
|
||||
buf2[level] = '\0';
|
||||
free(buf1);
|
||||
}
|
||||
buf1 = buf2;
|
||||
} else {
|
||||
free((char *)str);
|
||||
}
|
||||
} else if (list->device >= 0)
|
||||
goto __skip_add;
|
||||
err = hint_list_add(list, buf, buf1);
|
||||
} else if (list->device >= 0)
|
||||
goto __skip_add;
|
||||
err = hint_list_add(list, buf, buf1);
|
||||
}
|
||||
__skip_add:
|
||||
if (res && cleanup_res)
|
||||
snd_config_delete(res);
|
||||
snd_config_delete(res);
|
||||
if (buf1)
|
||||
free(buf1);
|
||||
free(buf);
|
||||
free(buf);
|
||||
return err;
|
||||
}
|
||||
|
||||
|
|
@ -455,7 +455,7 @@ static int add_card(snd_config_t *config, snd_config_t *rw_config, struct hint_l
|
|||
char ctl_name[16];
|
||||
snd_ctl_card_info_t info = {0};
|
||||
int device, max_device = 0;
|
||||
|
||||
|
||||
list->info = &info;
|
||||
err = snd_config_search(config, list->siface, &conf);
|
||||
if (err < 0)
|
||||
|
|
@ -471,7 +471,7 @@ static int add_card(snd_config_t *config, snd_config_t *rw_config, struct hint_l
|
|||
n = snd_config_iterator_entry(i);
|
||||
if (snd_config_get_id(n, &str) < 0)
|
||||
continue;
|
||||
|
||||
|
||||
if (next_devices[list->iface] != NULL) {
|
||||
list->card = card;
|
||||
device = max_device = -1;
|
||||
|
|
@ -510,7 +510,7 @@ static int add_card(snd_config_t *config, snd_config_t *rw_config, struct hint_l
|
|||
}
|
||||
err = 0;
|
||||
__error:
|
||||
snd_ctl_close(list->ctl);
|
||||
snd_ctl_close(list->ctl);
|
||||
return err;
|
||||
}
|
||||
|
||||
|
|
@ -665,9 +665,9 @@ int snd_device_name_hint(int card, const char *iface, void ***hints)
|
|||
if (!err && !list.list)
|
||||
err = hint_list_add(&list, NULL, NULL);
|
||||
if (err < 0)
|
||||
snd_device_name_free_hint((void **)list.list);
|
||||
snd_device_name_free_hint((void **)list.list);
|
||||
else
|
||||
*hints = (void **)list.list;
|
||||
*hints = (void **)list.list;
|
||||
free(list.cardname);
|
||||
if (local_config_rw)
|
||||
snd_config_delete(local_config_rw);
|
||||
|
|
@ -726,7 +726,7 @@ char *snd_device_name_get_hint(const void *hint, const char *id)
|
|||
return NULL;
|
||||
hint1 = delim + 1;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (delim == NULL)
|
||||
return strdup(hint1 + 4);
|
||||
size = delim - hint1 - 4;
|
||||
|
|
|
|||
|
|
@ -564,14 +564,14 @@ static int add_elem(snd_sctl_t *h, snd_config_t *_conf, snd_config_t *private_da
|
|||
if (err < 0)
|
||||
goto _err;
|
||||
}
|
||||
|
||||
|
||||
err = snd_config_get_ctl_elem_value(value, h->ctl, elem->val, elem->mask, elem->info);
|
||||
if (err < 0)
|
||||
goto _err;
|
||||
list_add_tail(&elem->list, &h->elems);
|
||||
|
||||
_err:
|
||||
if (err < 0 && elem) {
|
||||
if (err < 0 && elem) {
|
||||
if (elem->id)
|
||||
snd_ctl_elem_id_free(elem->id);
|
||||
if (elem->info)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue