mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-12-16 08:56:42 -05:00
Fix compile warnings with gcc-4
Fixed compile warnings with gcc-4 about pointer signedness.
This commit is contained in:
parent
0350a615b7
commit
7a89e3bbca
17 changed files with 69 additions and 71 deletions
|
|
@ -1228,7 +1228,7 @@ static int parse_defs(snd_config_t *father, input_t *input, int skip, int overri
|
||||||
|
|
||||||
static void string_print(char *str, int id, snd_output_t *out)
|
static void string_print(char *str, int id, snd_output_t *out)
|
||||||
{
|
{
|
||||||
unsigned char *p = str;
|
unsigned char *p = (unsigned char *)str;
|
||||||
if (!id) {
|
if (!id) {
|
||||||
switch (*p) {
|
switch (*p) {
|
||||||
case 0:
|
case 0:
|
||||||
|
|
@ -1268,7 +1268,7 @@ static void string_print(char *str, int id, snd_output_t *out)
|
||||||
return;
|
return;
|
||||||
quoted:
|
quoted:
|
||||||
snd_output_putc(out, '\'');
|
snd_output_putc(out, '\'');
|
||||||
p = str;
|
p = (unsigned char *)str;
|
||||||
while (*p) {
|
while (*p) {
|
||||||
int c;
|
int c;
|
||||||
c = *p;
|
c = *p;
|
||||||
|
|
|
||||||
|
|
@ -130,7 +130,7 @@ int snd_card_get_index(const char *string)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
snd_ctl_close(handle);
|
snd_ctl_close(handle);
|
||||||
if (!strcmp(info.id, string))
|
if (!strcmp((const char *)info.id, string))
|
||||||
return card;
|
return card;
|
||||||
}
|
}
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
@ -157,7 +157,7 @@ int snd_card_get_name(int card, char **name)
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
snd_ctl_close(handle);
|
snd_ctl_close(handle);
|
||||||
*name = strdup(info.name);
|
*name = strdup((const char *)info.name);
|
||||||
if (*name == NULL)
|
if (*name == NULL)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
@ -184,7 +184,7 @@ int snd_card_get_longname(int card, char **name)
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
snd_ctl_close(handle);
|
snd_ctl_close(handle);
|
||||||
*name = strdup(info.longname);
|
*name = strdup((const char *)info.longname);
|
||||||
if (*name == NULL)
|
if (*name == NULL)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
||||||
|
|
@ -1028,7 +1028,7 @@ const char *snd_ctl_event_elem_get_name(const snd_ctl_event_t *obj)
|
||||||
{
|
{
|
||||||
assert(obj);
|
assert(obj);
|
||||||
assert(obj->type == SND_CTL_EVENT_ELEM);
|
assert(obj->type == SND_CTL_EVENT_ELEM);
|
||||||
return obj->data.elem.id.name;
|
return (const char *)obj->data.elem.id.name;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -1155,7 +1155,7 @@ unsigned int snd_ctl_elem_id_get_subdevice(const snd_ctl_elem_id_t *obj)
|
||||||
const char *snd_ctl_elem_id_get_name(const snd_ctl_elem_id_t *obj)
|
const char *snd_ctl_elem_id_get_name(const snd_ctl_elem_id_t *obj)
|
||||||
{
|
{
|
||||||
assert(obj);
|
assert(obj);
|
||||||
return obj->name;
|
return (const char *)obj->name;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -1221,7 +1221,7 @@ void snd_ctl_elem_id_set_subdevice(snd_ctl_elem_id_t *obj, unsigned int val)
|
||||||
void snd_ctl_elem_id_set_name(snd_ctl_elem_id_t *obj, const char *val)
|
void snd_ctl_elem_id_set_name(snd_ctl_elem_id_t *obj, const char *val)
|
||||||
{
|
{
|
||||||
assert(obj);
|
assert(obj);
|
||||||
strncpy(obj->name, val, sizeof(obj->name));
|
strncpy((char *)obj->name, val, sizeof(obj->name));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -1306,7 +1306,7 @@ int snd_ctl_card_info_get_card(const snd_ctl_card_info_t *obj)
|
||||||
const char *snd_ctl_card_info_get_id(const snd_ctl_card_info_t *obj)
|
const char *snd_ctl_card_info_get_id(const snd_ctl_card_info_t *obj)
|
||||||
{
|
{
|
||||||
assert(obj);
|
assert(obj);
|
||||||
return obj->id;
|
return (const char *)obj->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -1317,7 +1317,7 @@ const char *snd_ctl_card_info_get_id(const snd_ctl_card_info_t *obj)
|
||||||
const char *snd_ctl_card_info_get_driver(const snd_ctl_card_info_t *obj)
|
const char *snd_ctl_card_info_get_driver(const snd_ctl_card_info_t *obj)
|
||||||
{
|
{
|
||||||
assert(obj);
|
assert(obj);
|
||||||
return obj->driver;
|
return (const char *)obj->driver;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -1328,7 +1328,7 @@ const char *snd_ctl_card_info_get_driver(const snd_ctl_card_info_t *obj)
|
||||||
const char *snd_ctl_card_info_get_name(const snd_ctl_card_info_t *obj)
|
const char *snd_ctl_card_info_get_name(const snd_ctl_card_info_t *obj)
|
||||||
{
|
{
|
||||||
assert(obj);
|
assert(obj);
|
||||||
return obj->name;
|
return (const char *)obj->name;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -1339,7 +1339,7 @@ const char *snd_ctl_card_info_get_name(const snd_ctl_card_info_t *obj)
|
||||||
const char *snd_ctl_card_info_get_longname(const snd_ctl_card_info_t *obj)
|
const char *snd_ctl_card_info_get_longname(const snd_ctl_card_info_t *obj)
|
||||||
{
|
{
|
||||||
assert(obj);
|
assert(obj);
|
||||||
return obj->longname;
|
return (const char *)obj->longname;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -1350,7 +1350,7 @@ const char *snd_ctl_card_info_get_longname(const snd_ctl_card_info_t *obj)
|
||||||
const char *snd_ctl_card_info_get_mixername(const snd_ctl_card_info_t *obj)
|
const char *snd_ctl_card_info_get_mixername(const snd_ctl_card_info_t *obj)
|
||||||
{
|
{
|
||||||
assert(obj);
|
assert(obj);
|
||||||
return obj->mixername;
|
return (const char *)obj->mixername;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -1361,7 +1361,7 @@ const char *snd_ctl_card_info_get_mixername(const snd_ctl_card_info_t *obj)
|
||||||
const char *snd_ctl_card_info_get_components(const snd_ctl_card_info_t *obj)
|
const char *snd_ctl_card_info_get_components(const snd_ctl_card_info_t *obj)
|
||||||
{
|
{
|
||||||
assert(obj);
|
assert(obj);
|
||||||
return obj->components;
|
return (const char *)obj->components;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -1587,7 +1587,7 @@ const char *snd_ctl_elem_list_get_name(const snd_ctl_elem_list_t *obj, unsigned
|
||||||
{
|
{
|
||||||
assert(obj);
|
assert(obj);
|
||||||
assert(idx < obj->used);
|
assert(idx < obj->used);
|
||||||
return obj->pids[idx].name;
|
return (const char *)obj->pids[idx].name;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -1991,7 +1991,7 @@ unsigned int snd_ctl_elem_info_get_subdevice(const snd_ctl_elem_info_t *obj)
|
||||||
const char *snd_ctl_elem_info_get_name(const snd_ctl_elem_info_t *obj)
|
const char *snd_ctl_elem_info_get_name(const snd_ctl_elem_info_t *obj)
|
||||||
{
|
{
|
||||||
assert(obj);
|
assert(obj);
|
||||||
return obj->id.name;
|
return (const char *)obj->id.name;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -2068,7 +2068,7 @@ void snd_ctl_elem_info_set_subdevice(snd_ctl_elem_info_t *obj, unsigned int val)
|
||||||
void snd_ctl_elem_info_set_name(snd_ctl_elem_info_t *obj, const char *val)
|
void snd_ctl_elem_info_set_name(snd_ctl_elem_info_t *obj, const char *val)
|
||||||
{
|
{
|
||||||
assert(obj);
|
assert(obj);
|
||||||
strncpy(obj->id.name, val, sizeof(obj->id.name));
|
strncpy((char *)obj->id.name, val, sizeof(obj->id.name));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -2197,7 +2197,7 @@ unsigned int snd_ctl_elem_value_get_subdevice(const snd_ctl_elem_value_t *obj)
|
||||||
const char *snd_ctl_elem_value_get_name(const snd_ctl_elem_value_t *obj)
|
const char *snd_ctl_elem_value_get_name(const snd_ctl_elem_value_t *obj)
|
||||||
{
|
{
|
||||||
assert(obj);
|
assert(obj);
|
||||||
return obj->id.name;
|
return (const char *)obj->id.name;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -2274,7 +2274,7 @@ void snd_ctl_elem_value_set_subdevice(snd_ctl_elem_value_t *obj, unsigned int va
|
||||||
void snd_ctl_elem_value_set_name(snd_ctl_elem_value_t *obj, const char *val)
|
void snd_ctl_elem_value_set_name(snd_ctl_elem_value_t *obj, const char *val)
|
||||||
{
|
{
|
||||||
assert(obj);
|
assert(obj);
|
||||||
strncpy(obj->id.name, val, sizeof(obj->id.name));
|
strncpy((char *)obj->id.name, val, sizeof(obj->id.name));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -292,7 +292,7 @@ static int get_compare_weight(const snd_ctl_elem_id_t *id)
|
||||||
"Center",
|
"Center",
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
const char *name = id->name, *name1;
|
const char *name = (char *)id->name, *name1;
|
||||||
int res, res1;
|
int res, res1;
|
||||||
|
|
||||||
if ((res = snd_hctl_compare_mixer_priority_lookup((const char **)&name, names, 1000000)) == NOT_FOUND)
|
if ((res = snd_hctl_compare_mixer_priority_lookup((const char **)&name, names, 1000000)) == NOT_FOUND)
|
||||||
|
|
@ -472,7 +472,7 @@ static int snd_hctl_compare_default(const snd_hctl_elem_t *c1,
|
||||||
if (d != 0)
|
if (d != 0)
|
||||||
return d;
|
return d;
|
||||||
}
|
}
|
||||||
res = strcmp(c1->id.name, c2->id.name);
|
res = strcmp((const char *)c1->id.name, (const char *)c2->id.name);
|
||||||
if (res != 0)
|
if (res != 0)
|
||||||
return res;
|
return res;
|
||||||
d = c1->id.index - c2->id.index;
|
d = c1->id.index - c2->id.index;
|
||||||
|
|
@ -877,7 +877,7 @@ unsigned int snd_hctl_elem_get_subdevice(const snd_hctl_elem_t *obj)
|
||||||
const char *snd_hctl_elem_get_name(const snd_hctl_elem_t *obj)
|
const char *snd_hctl_elem_get_name(const snd_hctl_elem_t *obj)
|
||||||
{
|
{
|
||||||
assert(obj);
|
assert(obj);
|
||||||
return obj->id.name;
|
return (const char *)obj->id.name;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -399,7 +399,7 @@ unsigned int snd_hwdep_info_get_device(const snd_hwdep_info_t *info)
|
||||||
const char *snd_hwdep_info_get_id(const snd_hwdep_info_t *obj)
|
const char *snd_hwdep_info_get_id(const snd_hwdep_info_t *obj)
|
||||||
{
|
{
|
||||||
assert(obj);
|
assert(obj);
|
||||||
return obj->id;
|
return (const char *)obj->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -410,7 +410,7 @@ const char *snd_hwdep_info_get_id(const snd_hwdep_info_t *obj)
|
||||||
const char *snd_hwdep_info_get_name(const snd_hwdep_info_t *obj)
|
const char *snd_hwdep_info_get_name(const snd_hwdep_info_t *obj)
|
||||||
{
|
{
|
||||||
assert(obj);
|
assert(obj);
|
||||||
return obj->name;
|
return (const char *)obj->name;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -584,7 +584,7 @@ unsigned int snd_hwdep_dsp_status_get_version(const snd_hwdep_dsp_status_t *obj)
|
||||||
const char *snd_hwdep_dsp_status_get_id(const snd_hwdep_dsp_status_t *obj)
|
const char *snd_hwdep_dsp_status_get_id(const snd_hwdep_dsp_status_t *obj)
|
||||||
{
|
{
|
||||||
assert(obj);
|
assert(obj);
|
||||||
return obj->id;
|
return (const char *)obj->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -689,7 +689,7 @@ unsigned int snd_hwdep_dsp_image_get_index(const snd_hwdep_dsp_image_t *obj)
|
||||||
const char *snd_hwdep_dsp_image_get_name(const snd_hwdep_dsp_image_t *obj)
|
const char *snd_hwdep_dsp_image_get_name(const snd_hwdep_dsp_image_t *obj)
|
||||||
{
|
{
|
||||||
assert(obj);
|
assert(obj);
|
||||||
return obj->name;
|
return (const char *)obj->name;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -733,7 +733,7 @@ void snd_hwdep_dsp_image_set_index(snd_hwdep_dsp_image_t *obj, unsigned int inde
|
||||||
void snd_hwdep_dsp_image_set_name(snd_hwdep_dsp_image_t *obj, const char *name)
|
void snd_hwdep_dsp_image_set_name(snd_hwdep_dsp_image_t *obj, const char *name)
|
||||||
{
|
{
|
||||||
assert(obj && name);
|
assert(obj && name);
|
||||||
strncpy(obj->name, name, sizeof(obj->name));
|
strncpy((char *)obj->name, name, sizeof(obj->name));
|
||||||
obj->name[sizeof(obj->name)-1] = 0;
|
obj->name[sizeof(obj->name)-1] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -242,7 +242,7 @@ static int snd_input_buffer_scan(snd_input_t *input, const char *format, va_list
|
||||||
extern int vsscanf(const char *, const char *, va_list);
|
extern int vsscanf(const char *, const char *, va_list);
|
||||||
/* FIXME: how can I obtain consumed chars count? */
|
/* FIXME: how can I obtain consumed chars count? */
|
||||||
assert(0);
|
assert(0);
|
||||||
return vsscanf(buffer->ptr, format, args);
|
return vsscanf((char *)buffer->ptr, format, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *snd_input_buffer_gets(snd_input_t *input, char *str, size_t size)
|
static char *snd_input_buffer_gets(snd_input_t *input, char *str, size_t size)
|
||||||
|
|
|
||||||
|
|
@ -464,7 +464,7 @@ static char *look_for_id(snd_iwffff_handle_t *iwf ATTRIBUTE_UNUSED, unsigned cha
|
||||||
return NULL;
|
return NULL;
|
||||||
while ((long)start < (long)end) {
|
while ((long)start < (long)end) {
|
||||||
if (((struct header *)start)->id == id)
|
if (((struct header *)start)->id == id)
|
||||||
return start;
|
return (char *)start;
|
||||||
start += sizeof(struct header) + snd_LE_to_host_32(((struct header *)start)->length);
|
start += sizeof(struct header) + snd_LE_to_host_32(((struct header *)start)->length);
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
@ -493,7 +493,7 @@ static int copy_envelope(snd_iwffff_handle_t *iwf, iwffff_env_t *genv, ID eid)
|
||||||
ptr = iwf->fff_data;
|
ptr = iwf->fff_data;
|
||||||
end = iwf->fff_data + iwf->fff_size;
|
end = iwf->fff_data + iwf->fff_size;
|
||||||
while (1) {
|
while (1) {
|
||||||
ptr = look_for_id(iwf, ptr, end, envp_header);
|
ptr = (unsigned char *)look_for_id(iwf, ptr, end, envp_header);
|
||||||
if (ptr == NULL)
|
if (ptr == NULL)
|
||||||
return -ENOENT;
|
return -ENOENT;
|
||||||
envelope = ptr + sizeof(struct header);
|
envelope = ptr + sizeof(struct header);
|
||||||
|
|
@ -515,7 +515,7 @@ static int copy_envelope(snd_iwffff_handle_t *iwf, iwffff_env_t *genv, ID eid)
|
||||||
grecord->sustain_rate = snd_LE_to_host_16(*(((unsigned short *)record) + 6/2));
|
grecord->sustain_rate = snd_LE_to_host_16(*(((unsigned short *)record) + 6/2));
|
||||||
grecord->release_rate = snd_LE_to_host_16(*(((unsigned short *)record) + 8/2));
|
grecord->release_rate = snd_LE_to_host_16(*(((unsigned short *)record) + 8/2));
|
||||||
grecord->hirange = record[10];
|
grecord->hirange = record[10];
|
||||||
points = (short *)(record + ENVELOPE_RECORD_SIZE);
|
points = (unsigned short *)(record + ENVELOPE_RECORD_SIZE);
|
||||||
rpoints = (iwffff_env_point_t *)(grecord + 1);
|
rpoints = (iwffff_env_point_t *)(grecord + 1);
|
||||||
for (idx1 = 0; idx1 < grecord->nattack + grecord->nrelease; idx1++) {
|
for (idx1 = 0; idx1 < grecord->nattack + grecord->nrelease; idx1++) {
|
||||||
rpoints[idx1].offset = *points++;
|
rpoints[idx1].offset = *points++;
|
||||||
|
|
@ -585,7 +585,7 @@ static int load_iw_patch(snd_iwffff_handle_t *iwf, iwffff_instrument_t *instr,
|
||||||
instr->effect1_depth = patch[11];
|
instr->effect1_depth = patch[11];
|
||||||
instr->effect2 = patch[12];
|
instr->effect2 = patch[12];
|
||||||
instr->effect2_depth = patch[13];
|
instr->effect2_depth = patch[13];
|
||||||
current = (char *)patch + sizeof(struct patch);
|
current = (unsigned char *)patch + sizeof(struct patch);
|
||||||
instr->layer = player = NULL;
|
instr->layer = player = NULL;
|
||||||
for (idx_layer = 0; idx_layer < snd_LE_to_host_16(*(((unsigned short *)patch) + 4/2)); idx_layer++) {
|
for (idx_layer = 0; idx_layer < snd_LE_to_host_16(*(((unsigned short *)patch) + 4/2)); idx_layer++) {
|
||||||
if (((struct header *)current)->id != layer_header) {
|
if (((struct header *)current)->id != layer_header) {
|
||||||
|
|
@ -704,7 +704,7 @@ int snd_instr_iwffff_load(snd_iwffff_handle_t *iwf, int bank, int prg, snd_instr
|
||||||
ptr = iwf->fff_data;
|
ptr = iwf->fff_data;
|
||||||
end = iwf->fff_data + iwf->fff_size;
|
end = iwf->fff_data + iwf->fff_size;
|
||||||
while (1) {
|
while (1) {
|
||||||
ptr = look_for_id(iwf, ptr, end, program_header);
|
ptr = (unsigned char *)look_for_id(iwf, ptr, end, program_header);
|
||||||
if (ptr == NULL)
|
if (ptr == NULL)
|
||||||
break;
|
break;
|
||||||
program = ptr + sizeof(struct header);
|
program = ptr + sizeof(struct header);
|
||||||
|
|
|
||||||
|
|
@ -276,7 +276,7 @@ static int snd_output_buffer_print(snd_output_t *output, const char *format, va_
|
||||||
result = snd_output_buffer_need(output, size);
|
result = snd_output_buffer_need(output, size);
|
||||||
if (result < 0)
|
if (result < 0)
|
||||||
return result;
|
return result;
|
||||||
result = vsnprintf(buffer->buf + buffer->size, size, format, args);
|
result = vsnprintf((char *)buffer->buf + buffer->size, size, format, args);
|
||||||
assert(result >= 0);
|
assert(result >= 0);
|
||||||
if ((size_t)result <= size) {
|
if ((size_t)result <= size) {
|
||||||
buffer->size += result;
|
buffer->size += result;
|
||||||
|
|
@ -286,7 +286,7 @@ static int snd_output_buffer_print(snd_output_t *output, const char *format, va_
|
||||||
result = snd_output_buffer_need(output, size);
|
result = snd_output_buffer_need(output, size);
|
||||||
if (result < 0)
|
if (result < 0)
|
||||||
return result;
|
return result;
|
||||||
result = vsnprintf(buffer->buf + buffer->size, result, format, args);
|
result = vsnprintf((char *)buffer->buf + buffer->size, result, format, args);
|
||||||
assert(result == (int)size);
|
assert(result == (int)size);
|
||||||
buffer->size += result;
|
buffer->size += result;
|
||||||
return result;
|
return result;
|
||||||
|
|
@ -345,7 +345,7 @@ static snd_output_ops_t snd_output_buffer_ops = {
|
||||||
size_t snd_output_buffer_string(snd_output_t *output, char **buf)
|
size_t snd_output_buffer_string(snd_output_t *output, char **buf)
|
||||||
{
|
{
|
||||||
snd_output_buffer_t *buffer = output->private_data;
|
snd_output_buffer_t *buffer = output->private_data;
|
||||||
*buf = buffer->buf;
|
*buf = (char *)buffer->buf;
|
||||||
return buffer->size;
|
return buffer->size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3414,7 +3414,7 @@ int INTERNAL(snd_pcm_hw_params_get_format)(const snd_pcm_hw_params_t *params, sn
|
||||||
int snd_pcm_hw_params_get_format(const snd_pcm_hw_params_t *params, snd_pcm_format_t *format)
|
int snd_pcm_hw_params_get_format(const snd_pcm_hw_params_t *params, snd_pcm_format_t *format)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
return snd_pcm_hw_param_get(params, SND_PCM_HW_PARAM_FORMAT, format, NULL);
|
return snd_pcm_hw_param_get(params, SND_PCM_HW_PARAM_FORMAT, (unsigned int *)format, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -3454,7 +3454,7 @@ int INTERNAL(snd_pcm_hw_params_set_format_first)(snd_pcm_t *pcm, snd_pcm_hw_para
|
||||||
int snd_pcm_hw_params_set_format_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_t *format)
|
int snd_pcm_hw_params_set_format_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_t *format)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
return snd_pcm_hw_param_set_first(pcm, params, SND_PCM_HW_PARAM_FORMAT, format, NULL);
|
return snd_pcm_hw_param_set_first(pcm, params, SND_PCM_HW_PARAM_FORMAT, (unsigned int *)format, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -3470,7 +3470,7 @@ int INTERNAL(snd_pcm_hw_params_set_format_last)(snd_pcm_t *pcm, snd_pcm_hw_param
|
||||||
int snd_pcm_hw_params_set_format_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_t *format)
|
int snd_pcm_hw_params_set_format_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_t *format)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
return snd_pcm_hw_param_set_last(pcm, params, SND_PCM_HW_PARAM_FORMAT, format, NULL);
|
return snd_pcm_hw_param_set_last(pcm, params, SND_PCM_HW_PARAM_FORMAT, (unsigned int *)format, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -6020,7 +6020,7 @@ int snd_pcm_info_get_card(const snd_pcm_info_t *obj)
|
||||||
const char *snd_pcm_info_get_id(const snd_pcm_info_t *obj)
|
const char *snd_pcm_info_get_id(const snd_pcm_info_t *obj)
|
||||||
{
|
{
|
||||||
assert(obj);
|
assert(obj);
|
||||||
return obj->id;
|
return (const char *)obj->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -6031,7 +6031,7 @@ const char *snd_pcm_info_get_id(const snd_pcm_info_t *obj)
|
||||||
const char *snd_pcm_info_get_name(const snd_pcm_info_t *obj)
|
const char *snd_pcm_info_get_name(const snd_pcm_info_t *obj)
|
||||||
{
|
{
|
||||||
assert(obj);
|
assert(obj);
|
||||||
return obj->name;
|
return (const char *)obj->name;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -6042,7 +6042,7 @@ const char *snd_pcm_info_get_name(const snd_pcm_info_t *obj)
|
||||||
const char *snd_pcm_info_get_subdevice_name(const snd_pcm_info_t *obj)
|
const char *snd_pcm_info_get_subdevice_name(const snd_pcm_info_t *obj)
|
||||||
{
|
{
|
||||||
assert(obj);
|
assert(obj);
|
||||||
return obj->subname;
|
return (const char *)obj->subname;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -510,9 +510,9 @@ int snd_pcm_direct_info(snd_pcm_t *pcm, snd_pcm_info_t * info)
|
||||||
info->card = -1;
|
info->card = -1;
|
||||||
/* FIXME: fill this with something more useful: we know the hardware name */
|
/* FIXME: fill this with something more useful: we know the hardware name */
|
||||||
if (pcm->name) {
|
if (pcm->name) {
|
||||||
strncpy(info->id, pcm->name, sizeof(info->id));
|
strncpy((char *)info->id, pcm->name, sizeof(info->id));
|
||||||
strncpy(info->name, pcm->name, sizeof(info->name));
|
strncpy((char *)info->name, pcm->name, sizeof(info->name));
|
||||||
strncpy(info->subname, pcm->name, sizeof(info->subname));
|
strncpy((char *)info->subname, pcm->name, sizeof(info->subname));
|
||||||
}
|
}
|
||||||
info->subdevices_count = 1;
|
info->subdevices_count = 1;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
@ -736,7 +736,7 @@ int snd_pcm_direct_initialize_slave(snd_pcm_direct_t *dmix, snd_pcm_t *spcm, str
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ret = INTERNAL(snd_pcm_hw_params_set_rate_near)(spcm, hw_params, ¶ms->rate, 0);
|
ret = INTERNAL(snd_pcm_hw_params_set_rate_near)(spcm, hw_params, (unsigned int *)¶ms->rate, 0);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
SNDERR("requested rate is not available");
|
SNDERR("requested rate is not available");
|
||||||
return ret;
|
return ret;
|
||||||
|
|
@ -744,13 +744,13 @@ int snd_pcm_direct_initialize_slave(snd_pcm_direct_t *dmix, snd_pcm_t *spcm, str
|
||||||
|
|
||||||
buffer_is_not_initialized = 0;
|
buffer_is_not_initialized = 0;
|
||||||
if (params->buffer_time > 0) {
|
if (params->buffer_time > 0) {
|
||||||
ret = INTERNAL(snd_pcm_hw_params_set_buffer_time_near)(spcm, hw_params, ¶ms->buffer_time, 0);
|
ret = INTERNAL(snd_pcm_hw_params_set_buffer_time_near)(spcm, hw_params, (unsigned int *)¶ms->buffer_time, 0);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
SNDERR("unable to set buffer time");
|
SNDERR("unable to set buffer time");
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
} else if (params->buffer_size > 0) {
|
} else if (params->buffer_size > 0) {
|
||||||
ret = INTERNAL(snd_pcm_hw_params_set_buffer_size_near)(spcm, hw_params, ¶ms->buffer_size);
|
ret = INTERNAL(snd_pcm_hw_params_set_buffer_size_near)(spcm, hw_params, (snd_pcm_uframes_t *)¶ms->buffer_size);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
SNDERR("unable to set buffer size");
|
SNDERR("unable to set buffer size");
|
||||||
return ret;
|
return ret;
|
||||||
|
|
@ -760,13 +760,13 @@ int snd_pcm_direct_initialize_slave(snd_pcm_direct_t *dmix, snd_pcm_t *spcm, str
|
||||||
}
|
}
|
||||||
|
|
||||||
if (params->period_time > 0) {
|
if (params->period_time > 0) {
|
||||||
ret = INTERNAL(snd_pcm_hw_params_set_period_time_near)(spcm, hw_params, ¶ms->period_time, 0);
|
ret = INTERNAL(snd_pcm_hw_params_set_period_time_near)(spcm, hw_params, (unsigned int *)¶ms->period_time, 0);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
SNDERR("unable to set period_time");
|
SNDERR("unable to set period_time");
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
} else if (params->period_size > 0) {
|
} else if (params->period_size > 0) {
|
||||||
ret = INTERNAL(snd_pcm_hw_params_set_period_size_near)(spcm, hw_params, ¶ms->period_size, 0);
|
ret = INTERNAL(snd_pcm_hw_params_set_period_size_near)(spcm, hw_params, (snd_pcm_uframes_t *)¶ms->period_size, 0);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
SNDERR("unable to set period_size");
|
SNDERR("unable to set period_size");
|
||||||
return ret;
|
return ret;
|
||||||
|
|
|
||||||
|
|
@ -66,9 +66,9 @@ static int snd_pcm_ioplug_info(snd_pcm_t *pcm, snd_pcm_info_t *info)
|
||||||
info->stream = pcm->stream;
|
info->stream = pcm->stream;
|
||||||
info->card = -1;
|
info->card = -1;
|
||||||
if (pcm->name) {
|
if (pcm->name) {
|
||||||
strncpy(info->id, pcm->name, sizeof(info->id));
|
strncpy((char *)info->id, pcm->name, sizeof(info->id));
|
||||||
strncpy(info->name, pcm->name, sizeof(info->name));
|
strncpy((char *)info->name, pcm->name, sizeof(info->name));
|
||||||
strncpy(info->subname, pcm->name, sizeof(info->subname));
|
strncpy((char *)info->subname, pcm->name, sizeof(info->subname));
|
||||||
}
|
}
|
||||||
info->subdevices_count = 1;
|
info->subdevices_count = 1;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
||||||
|
|
@ -71,9 +71,9 @@ static int snd_pcm_null_info(snd_pcm_t *pcm, snd_pcm_info_t * info)
|
||||||
info->stream = pcm->stream;
|
info->stream = pcm->stream;
|
||||||
info->card = -1;
|
info->card = -1;
|
||||||
if (pcm->name) {
|
if (pcm->name) {
|
||||||
strncpy(info->id, pcm->name, sizeof(info->id));
|
strncpy((char *)info->id, pcm->name, sizeof(info->id));
|
||||||
strncpy(info->name, pcm->name, sizeof(info->name));
|
strncpy((char *)info->name, pcm->name, sizeof(info->name));
|
||||||
strncpy(info->subname, pcm->name, sizeof(info->subname));
|
strncpy((char *)info->subname, pcm->name, sizeof(info->subname));
|
||||||
}
|
}
|
||||||
info->subdevices_count = 1;
|
info->subdevices_count = 1;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
||||||
|
|
@ -834,7 +834,7 @@ int snd_pcm_hw_param_set_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params,
|
||||||
int err;
|
int err;
|
||||||
unsigned int best = *val, saved_min;
|
unsigned int best = *val, saved_min;
|
||||||
int last = 0;
|
int last = 0;
|
||||||
int min, max;
|
unsigned int min, max;
|
||||||
int mindir, maxdir;
|
int mindir, maxdir;
|
||||||
int valdir = dir ? *dir : 0;
|
int valdir = dir ? *dir : 0;
|
||||||
snd_interval_t *i;
|
snd_interval_t *i;
|
||||||
|
|
@ -865,9 +865,7 @@ int snd_pcm_hw_param_set_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params,
|
||||||
|
|
||||||
if (err >= 0) {
|
if (err >= 0) {
|
||||||
snd_pcm_hw_params_t params1;
|
snd_pcm_hw_params_t params1;
|
||||||
if (max < 0)
|
if (min == saved_min && mindir == valdir)
|
||||||
goto _end;
|
|
||||||
if ((unsigned int)min == saved_min && mindir == valdir)
|
|
||||||
goto _end;
|
goto _end;
|
||||||
params1 = save;
|
params1 = save;
|
||||||
err = snd_pcm_hw_param_set_max(pcm, ¶ms1, SND_CHANGE, var, &max, &maxdir);
|
err = snd_pcm_hw_param_set_max(pcm, ¶ms1, SND_CHANGE, var, &max, &maxdir);
|
||||||
|
|
|
||||||
|
|
@ -574,7 +574,7 @@ unsigned int snd_rawmidi_info_get_flags(const snd_rawmidi_info_t *info)
|
||||||
const char *snd_rawmidi_info_get_id(const snd_rawmidi_info_t *info)
|
const char *snd_rawmidi_info_get_id(const snd_rawmidi_info_t *info)
|
||||||
{
|
{
|
||||||
assert(info);
|
assert(info);
|
||||||
return info->id;
|
return (const char *)info->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -585,7 +585,7 @@ const char *snd_rawmidi_info_get_id(const snd_rawmidi_info_t *info)
|
||||||
const char *snd_rawmidi_info_get_name(const snd_rawmidi_info_t *info)
|
const char *snd_rawmidi_info_get_name(const snd_rawmidi_info_t *info)
|
||||||
{
|
{
|
||||||
assert(info);
|
assert(info);
|
||||||
return info->name;
|
return (const char *)info->name;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -596,7 +596,7 @@ const char *snd_rawmidi_info_get_name(const snd_rawmidi_info_t *info)
|
||||||
const char *snd_rawmidi_info_get_subdevice_name(const snd_rawmidi_info_t *info)
|
const char *snd_rawmidi_info_get_subdevice_name(const snd_rawmidi_info_t *info)
|
||||||
{
|
{
|
||||||
assert(info);
|
assert(info);
|
||||||
return info->subname;
|
return (const char *)info->subname;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -85,9 +85,9 @@ static int snd_rawmidi_virtual_info(snd_rawmidi_t *rmidi, snd_rawmidi_info_t * i
|
||||||
info->device = 0;
|
info->device = 0;
|
||||||
info->subdevice = 0;
|
info->subdevice = 0;
|
||||||
info->flags = 0;
|
info->flags = 0;
|
||||||
strcpy(info->id, "Virtual");
|
strcpy((char *)info->id, "Virtual");
|
||||||
strcpy(info->name, "Virtual RawMIDI");
|
strcpy((char *)info->name, "Virtual RawMIDI");
|
||||||
strcpy(info->subname, "Virtual RawMIDI");
|
strcpy((char *)info->subname, "Virtual RawMIDI");
|
||||||
info->subdevices_count = 1;
|
info->subdevices_count = 1;
|
||||||
info->subdevices_avail = 0;
|
info->subdevices_avail = 0;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
@ -250,7 +250,7 @@ static ssize_t snd_rawmidi_virtual_read(snd_rawmidi_t *rmidi, void *buffer, size
|
||||||
} else {
|
} else {
|
||||||
virt->in_buf_ptr = virt->in_tmp_buf;
|
virt->in_buf_ptr = virt->in_tmp_buf;
|
||||||
virt->in_buf_size = snd_midi_event_decode(virt->midi_event,
|
virt->in_buf_size = snd_midi_event_decode(virt->midi_event,
|
||||||
virt->in_tmp_buf,
|
(unsigned char *)virt->in_tmp_buf,
|
||||||
sizeof(virt->in_tmp_buf),
|
sizeof(virt->in_tmp_buf),
|
||||||
virt->in_event);
|
virt->in_event);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -505,7 +505,7 @@ int snd_timer_info_get_card(snd_timer_info_t * info)
|
||||||
const char *snd_timer_info_get_id(snd_timer_info_t * info)
|
const char *snd_timer_info_get_id(snd_timer_info_t * info)
|
||||||
{
|
{
|
||||||
assert(info);
|
assert(info);
|
||||||
return info->id;
|
return (const char *)info->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -516,7 +516,7 @@ const char *snd_timer_info_get_id(snd_timer_info_t * info)
|
||||||
const char *snd_timer_info_get_name(snd_timer_info_t * info)
|
const char *snd_timer_info_get_name(snd_timer_info_t * info)
|
||||||
{
|
{
|
||||||
assert(info);
|
assert(info);
|
||||||
return info->name;
|
return (const char *)info->name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -319,7 +319,7 @@ int snd_timer_ginfo_get_card(snd_timer_ginfo_t *obj)
|
||||||
*/
|
*/
|
||||||
char *snd_timer_ginfo_get_id(snd_timer_ginfo_t *obj)
|
char *snd_timer_ginfo_get_id(snd_timer_ginfo_t *obj)
|
||||||
{
|
{
|
||||||
return obj->id;
|
return (char *)obj->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -329,7 +329,7 @@ char *snd_timer_ginfo_get_id(snd_timer_ginfo_t *obj)
|
||||||
*/
|
*/
|
||||||
char *snd_timer_ginfo_get_name(snd_timer_ginfo_t *obj)
|
char *snd_timer_ginfo_get_name(snd_timer_ginfo_t *obj)
|
||||||
{
|
{
|
||||||
return obj->name;
|
return (char *)obj->name;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue