From: Takashi Iwai Date: Fri, 16 Dec 2005 18:43:49 +0000 (+0000) Subject: Fix compile warnings X-Git-Tag: v1.0.11rc2~5 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=76f7af823b14cae103ae0ffd73c0e881ce246d1a;p=alsa-lib.git Fix compile warnings Fix trivial compile warnings. --- diff --git a/modules/mixer/simple/sbase.c b/modules/mixer/simple/sbase.c index 0c804b38..e55eab54 100644 --- a/modules/mixer/simple/sbase.c +++ b/modules/mixer/simple/sbase.c @@ -50,6 +50,7 @@ static unsigned int chanmap_to_channels(unsigned int chanmap) return res; } +#if 0 static long to_user(struct selem_base *s, int dir, struct helem_base *c, long value) { int64_t n; @@ -67,6 +68,7 @@ static long from_user(struct selem_base *s, int dir, struct helem_base *c, long n = (int64_t) (value - s->dir[dir].min) * (c->max - c->min); return c->min + (n + (s->dir[dir].max - s->dir[dir].min) / 2) / (s->dir[dir].max - s->dir[dir].min); } +#endif static void update_ranges(struct selem_base *s) { @@ -200,18 +202,22 @@ static int get_dB_ops(snd_mixer_elem_t *elem ATTRIBUTE_UNUSED, return -ENXIO; } -static int get_switch_ops(snd_mixer_elem_t *elem, int dir, - snd_mixer_selem_channel_id_t channel, int *value) +static int get_switch_ops(snd_mixer_elem_t *elem ATTRIBUTE_UNUSED, + int dir ATTRIBUTE_UNUSED, + snd_mixer_selem_channel_id_t channel ATTRIBUTE_UNUSED, + int *value) { - struct selem_base *s = snd_mixer_elem_get_private(elem); + /* struct selem_base *s = snd_mixer_elem_get_private(elem); */ *value = 0; return 0; } -static int set_volume_ops(snd_mixer_elem_t *elem, int dir, - snd_mixer_selem_channel_id_t channel, long value) +static int set_volume_ops(snd_mixer_elem_t *elem ATTRIBUTE_UNUSED, + int dir ATTRIBUTE_UNUSED, + snd_mixer_selem_channel_id_t channel ATTRIBUTE_UNUSED, + long value ATTRIBUTE_UNUSED) { - struct selem_base *s = snd_mixer_elem_get_private(elem); + /* struct selem_base *s = snd_mixer_elem_get_private(elem); */ return 0; } @@ -224,35 +230,38 @@ static int set_dB_ops(snd_mixer_elem_t *elem ATTRIBUTE_UNUSED, return -ENXIO; } -static int set_switch_ops(snd_mixer_elem_t *elem, int dir, - snd_mixer_selem_channel_id_t channel, int value) +static int set_switch_ops(snd_mixer_elem_t *elem ATTRIBUTE_UNUSED, + int dir ATTRIBUTE_UNUSED, + snd_mixer_selem_channel_id_t channel ATTRIBUTE_UNUSED, + int value ATTRIBUTE_UNUSED) { - struct selem_base *s = snd_mixer_elem_get_private(elem); - int changed; + /* struct selem_base *s = snd_mixer_elem_get_private(elem); */ + /* int changed; */ return 0; } -static int enum_item_name_ops(snd_mixer_elem_t *elem, - unsigned int item, - size_t maxlen, char *buf) +static int enum_item_name_ops(snd_mixer_elem_t *elem ATTRIBUTE_UNUSED, + unsigned int item ATTRIBUTE_UNUSED, + size_t maxlen ATTRIBUTE_UNUSED, + char *buf ATTRIBUTE_UNUSED) { - struct selem_base *s = snd_mixer_elem_get_private(elem); + /* struct selem_base *s = snd_mixer_elem_get_private(elem);*/ return 0; } -static int get_enum_item_ops(snd_mixer_elem_t *elem, - snd_mixer_selem_channel_id_t channel, - unsigned int *itemp) +static int get_enum_item_ops(snd_mixer_elem_t *elem ATTRIBUTE_UNUSED, + snd_mixer_selem_channel_id_t channel ATTRIBUTE_UNUSED, + unsigned int *itemp ATTRIBUTE_UNUSED) { - struct selem_base *s = snd_mixer_elem_get_private(elem); + /* struct selem_base *s = snd_mixer_elem_get_private(elem); */ return 0; } -static int set_enum_item_ops(snd_mixer_elem_t *elem, - snd_mixer_selem_channel_id_t channel, - unsigned int item) +static int set_enum_item_ops(snd_mixer_elem_t *elem ATTRIBUTE_UNUSED, + snd_mixer_selem_channel_id_t channel ATTRIBUTE_UNUSED, + unsigned int item ATTRIBUTE_UNUSED) { - struct selem_base *s = snd_mixer_elem_get_private(elem); + /* struct selem_base *s = snd_mixer_elem_get_private(elem); */ return 0; } @@ -283,7 +292,7 @@ static int selem_read(snd_mixer_elem_t *elem) } static int simple_event_remove(snd_hctl_elem_t *helem, - snd_mixer_elem_t *melem) + snd_mixer_elem_t *melem ATTRIBUTE_UNUSED) { printf("event remove: %p\n", helem); return 0; @@ -309,7 +318,6 @@ static int simple_event_add1(snd_mixer_class_t *class, struct helem_selector *sel) { struct bclass_private *priv = snd_mixer_sbasic_get_private(class); - int count; snd_mixer_elem_t *melem; snd_mixer_selem_id_t *id; snd_ctl_elem_info_t *info; @@ -571,7 +579,7 @@ int alsa_mixer_sbasic_sidreg(snd_mixer_class_t *class, INIT_LIST_HEAD(&priv->sids); snd_mixer_sbasic_set_private(class, priv); snd_mixer_sbasic_set_private_free(class, sbasic_cpriv_free); - } + } sid->sids = sids; sid->count = count; list_add(&sid->list, &priv->sids); diff --git a/src/mixer/mixer_local.h b/src/mixer/mixer_local.h index 07460938..180412a6 100644 --- a/src/mixer/mixer_local.h +++ b/src/mixer/mixer_local.h @@ -77,6 +77,6 @@ struct _snd_mixer { }; struct _snd_mixer_selem_id { - unsigned char name[60]; + char name[60]; unsigned int index; }; diff --git a/src/mixer/simple_none.c b/src/mixer/simple_none.c index 35940291..fdb57f44 100644 --- a/src/mixer/simple_none.c +++ b/src/mixer/simple_none.c @@ -1270,7 +1270,7 @@ static int simple_event_add(snd_mixer_class_t *class, snd_hctl_elem_t *helem) { const char *name = snd_hctl_elem_get_name(helem); size_t len; - selem_ctl_type_t type; + selem_ctl_type_t type = CTL_SINGLE; /* to shut up warning */ if (snd_hctl_elem_get_interface(helem) != SND_CTL_ELEM_IFACE_MIXER) return 0; if (strcmp(name, "Capture Source") == 0) { diff --git a/src/pcm/pcm_direct.c b/src/pcm/pcm_direct.c index 8d1f05c7..43eb6a48 100644 --- a/src/pcm/pcm_direct.c +++ b/src/pcm/pcm_direct.c @@ -875,7 +875,7 @@ int snd_pcm_direct_initialize_slave(snd_pcm_direct_t *dmix, snd_pcm_t *spcm, str } if (buffer_is_not_initialized && params->periods > 0) { - int periods = params->periods; + unsigned int periods = params->periods; ret = INTERNAL(snd_pcm_hw_params_set_periods_near)(spcm, hw_params, ¶ms->periods, 0); if (ret < 0) { SNDERR("unable to set requested periods"); diff --git a/src/pcm/pcm_direct.h b/src/pcm/pcm_direct.h index 9c015805..44559827 100644 --- a/src/pcm/pcm_direct.h +++ b/src/pcm/pcm_direct.h @@ -42,7 +42,7 @@ struct slave_params { int buffer_time; snd_pcm_sframes_t period_size; snd_pcm_sframes_t buffer_size; - int periods; + unsigned int periods; }; typedef struct { diff --git a/src/seq/seq.c b/src/seq/seq.c index c1441190..2ae83a7a 100644 --- a/src/seq/seq.c +++ b/src/seq/seq.c @@ -4435,7 +4435,7 @@ int snd_seq_remove_events(snd_seq_t *seq, snd_seq_remove_events_t *rmp) ep = seq->obuf; while (ep - seq->obuf < (ssize_t)seq->obufused) { - ev = ep; + ev = (snd_seq_event_t *)ep; len = snd_seq_event_length(ev); if (remove_match(rmp, ev)) {