mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-06 13:29:59 -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)
|
||||
{
|
||||
unsigned char *p = str;
|
||||
unsigned char *p = (unsigned char *)str;
|
||||
if (!id) {
|
||||
switch (*p) {
|
||||
case 0:
|
||||
|
|
@ -1268,7 +1268,7 @@ static void string_print(char *str, int id, snd_output_t *out)
|
|||
return;
|
||||
quoted:
|
||||
snd_output_putc(out, '\'');
|
||||
p = str;
|
||||
p = (unsigned char *)str;
|
||||
while (*p) {
|
||||
int c;
|
||||
c = *p;
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ int snd_card_get_index(const char *string)
|
|||
continue;
|
||||
}
|
||||
snd_ctl_close(handle);
|
||||
if (!strcmp(info.id, string))
|
||||
if (!strcmp((const char *)info.id, string))
|
||||
return card;
|
||||
}
|
||||
return -ENODEV;
|
||||
|
|
@ -157,7 +157,7 @@ int snd_card_get_name(int card, char **name)
|
|||
return err;
|
||||
}
|
||||
snd_ctl_close(handle);
|
||||
*name = strdup(info.name);
|
||||
*name = strdup((const char *)info.name);
|
||||
if (*name == NULL)
|
||||
return -ENOMEM;
|
||||
return 0;
|
||||
|
|
@ -184,7 +184,7 @@ int snd_card_get_longname(int card, char **name)
|
|||
return err;
|
||||
}
|
||||
snd_ctl_close(handle);
|
||||
*name = strdup(info.longname);
|
||||
*name = strdup((const char *)info.longname);
|
||||
if (*name == NULL)
|
||||
return -ENOMEM;
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -1028,7 +1028,7 @@ const char *snd_ctl_event_elem_get_name(const snd_ctl_event_t *obj)
|
|||
{
|
||||
assert(obj);
|
||||
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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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(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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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",
|
||||
NULL
|
||||
};
|
||||
const char *name = id->name, *name1;
|
||||
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)
|
||||
|
|
@ -472,7 +472,7 @@ static int snd_hctl_compare_default(const snd_hctl_elem_t *c1,
|
|||
if (d != 0)
|
||||
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)
|
||||
return res;
|
||||
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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
/* FIXME: how can I obtain consumed chars count? */
|
||||
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)
|
||||
|
|
|
|||
|
|
@ -464,7 +464,7 @@ static char *look_for_id(snd_iwffff_handle_t *iwf ATTRIBUTE_UNUSED, unsigned cha
|
|||
return NULL;
|
||||
while ((long)start < (long)end) {
|
||||
if (((struct header *)start)->id == id)
|
||||
return start;
|
||||
return (char *)start;
|
||||
start += sizeof(struct header) + snd_LE_to_host_32(((struct header *)start)->length);
|
||||
}
|
||||
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;
|
||||
end = iwf->fff_data + iwf->fff_size;
|
||||
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)
|
||||
return -ENOENT;
|
||||
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->release_rate = snd_LE_to_host_16(*(((unsigned short *)record) + 8/2));
|
||||
grecord->hirange = record[10];
|
||||
points = (short *)(record + ENVELOPE_RECORD_SIZE);
|
||||
points = (unsigned short *)(record + ENVELOPE_RECORD_SIZE);
|
||||
rpoints = (iwffff_env_point_t *)(grecord + 1);
|
||||
for (idx1 = 0; idx1 < grecord->nattack + grecord->nrelease; idx1++) {
|
||||
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->effect2 = patch[12];
|
||||
instr->effect2_depth = patch[13];
|
||||
current = (char *)patch + sizeof(struct patch);
|
||||
current = (unsigned char *)patch + sizeof(struct patch);
|
||||
instr->layer = player = NULL;
|
||||
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) {
|
||||
|
|
@ -704,7 +704,7 @@ int snd_instr_iwffff_load(snd_iwffff_handle_t *iwf, int bank, int prg, snd_instr
|
|||
ptr = iwf->fff_data;
|
||||
end = iwf->fff_data + iwf->fff_size;
|
||||
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)
|
||||
break;
|
||||
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);
|
||||
if (result < 0)
|
||||
return result;
|
||||
result = vsnprintf(buffer->buf + buffer->size, size, format, args);
|
||||
result = vsnprintf((char *)buffer->buf + buffer->size, size, format, args);
|
||||
assert(result >= 0);
|
||||
if ((size_t)result <= size) {
|
||||
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);
|
||||
if (result < 0)
|
||||
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);
|
||||
buffer->size += 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)
|
||||
{
|
||||
snd_output_buffer_t *buffer = output->private_data;
|
||||
*buf = buffer->buf;
|
||||
*buf = (char *)buffer->buf;
|
||||
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)
|
||||
#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)
|
||||
#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)
|
||||
#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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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;
|
||||
/* FIXME: fill this with something more useful: we know the hardware name */
|
||||
if (pcm->name) {
|
||||
strncpy(info->id, pcm->name, sizeof(info->id));
|
||||
strncpy(info->name, pcm->name, sizeof(info->name));
|
||||
strncpy(info->subname, pcm->name, sizeof(info->subname));
|
||||
strncpy((char *)info->id, pcm->name, sizeof(info->id));
|
||||
strncpy((char *)info->name, pcm->name, sizeof(info->name));
|
||||
strncpy((char *)info->subname, pcm->name, sizeof(info->subname));
|
||||
}
|
||||
info->subdevices_count = 1;
|
||||
return 0;
|
||||
|
|
@ -736,7 +736,7 @@ int snd_pcm_direct_initialize_slave(snd_pcm_direct_t *dmix, snd_pcm_t *spcm, str
|
|||
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) {
|
||||
SNDERR("requested rate is not available");
|
||||
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;
|
||||
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) {
|
||||
SNDERR("unable to set buffer time");
|
||||
return ret;
|
||||
}
|
||||
} 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) {
|
||||
SNDERR("unable to set buffer size");
|
||||
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) {
|
||||
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) {
|
||||
SNDERR("unable to set period_time");
|
||||
return ret;
|
||||
}
|
||||
} 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) {
|
||||
SNDERR("unable to set period_size");
|
||||
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->card = -1;
|
||||
if (pcm->name) {
|
||||
strncpy(info->id, pcm->name, sizeof(info->id));
|
||||
strncpy(info->name, pcm->name, sizeof(info->name));
|
||||
strncpy(info->subname, pcm->name, sizeof(info->subname));
|
||||
strncpy((char *)info->id, pcm->name, sizeof(info->id));
|
||||
strncpy((char *)info->name, pcm->name, sizeof(info->name));
|
||||
strncpy((char *)info->subname, pcm->name, sizeof(info->subname));
|
||||
}
|
||||
info->subdevices_count = 1;
|
||||
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->card = -1;
|
||||
if (pcm->name) {
|
||||
strncpy(info->id, pcm->name, sizeof(info->id));
|
||||
strncpy(info->name, pcm->name, sizeof(info->name));
|
||||
strncpy(info->subname, pcm->name, sizeof(info->subname));
|
||||
strncpy((char *)info->id, pcm->name, sizeof(info->id));
|
||||
strncpy((char *)info->name, pcm->name, sizeof(info->name));
|
||||
strncpy((char *)info->subname, pcm->name, sizeof(info->subname));
|
||||
}
|
||||
info->subdevices_count = 1;
|
||||
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;
|
||||
unsigned int best = *val, saved_min;
|
||||
int last = 0;
|
||||
int min, max;
|
||||
unsigned int min, max;
|
||||
int mindir, maxdir;
|
||||
int valdir = dir ? *dir : 0;
|
||||
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) {
|
||||
snd_pcm_hw_params_t params1;
|
||||
if (max < 0)
|
||||
goto _end;
|
||||
if ((unsigned int)min == saved_min && mindir == valdir)
|
||||
if (min == saved_min && mindir == valdir)
|
||||
goto _end;
|
||||
params1 = save;
|
||||
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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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->subdevice = 0;
|
||||
info->flags = 0;
|
||||
strcpy(info->id, "Virtual");
|
||||
strcpy(info->name, "Virtual RawMIDI");
|
||||
strcpy(info->subname, "Virtual RawMIDI");
|
||||
strcpy((char *)info->id, "Virtual");
|
||||
strcpy((char *)info->name, "Virtual RawMIDI");
|
||||
strcpy((char *)info->subname, "Virtual RawMIDI");
|
||||
info->subdevices_count = 1;
|
||||
info->subdevices_avail = 0;
|
||||
return 0;
|
||||
|
|
@ -250,7 +250,7 @@ static ssize_t snd_rawmidi_virtual_read(snd_rawmidi_t *rmidi, void *buffer, size
|
|||
} else {
|
||||
virt->in_buf_ptr = virt->in_tmp_buf;
|
||||
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),
|
||||
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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
return obj->name;
|
||||
return (char *)obj->name;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue