Fix compile warnings with gcc-4

Fixed compile warnings with gcc-4 about pointer signedness.
This commit is contained in:
Takashi Iwai 2005-06-28 10:24:44 +00:00
parent 0350a615b7
commit 7a89e3bbca
17 changed files with 69 additions and 71 deletions

View file

@ -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;

View file

@ -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));
}
/**

View file

@ -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;
}
/**