[ALSA] Fix 'discards qualifiers' compile warnings in pcm.h
authorTakashi Iwai <tiwai@suse.de>
Mon, 10 Sep 2007 22:33:48 +0000 (00:33 +0200)
committerJaroslav Kysela <perex@perex.cz>
Tue, 16 Oct 2007 14:49:27 +0000 (16:49 +0200)
Fixed cast messes in pcm.h.
    include/sound/pcm.h: In function ‘hw_param_interval_c’:
    include/sound/pcm.h:800: warning: passing argument 1 of ‘hw_param_interval’ discards qualifiers from pointer target type
Simply redefine the inline functions again for const pointers.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
include/sound/pcm.h

index 27f8ef4..76b34b5 100644 (file)
@@ -791,13 +791,13 @@ static inline struct snd_interval *hw_param_interval(struct snd_pcm_hw_params *p
 static inline const struct snd_mask *hw_param_mask_c(const struct snd_pcm_hw_params *params,
                                             snd_pcm_hw_param_t var)
 {
-       return (const struct snd_mask *)hw_param_mask((struct snd_pcm_hw_params*) params, var);
+       return &params->masks[var - SNDRV_PCM_HW_PARAM_FIRST_MASK];
 }
 
 static inline const struct snd_interval *hw_param_interval_c(const struct snd_pcm_hw_params *params,
                                                     snd_pcm_hw_param_t var)
 {
-       return (const struct snd_interval *)hw_param_interval((struct snd_pcm_hw_params*) params, var);
+       return &params->intervals[var - SNDRV_PCM_HW_PARAM_FIRST_INTERVAL];
 }
 
 #define params_access(p) snd_mask_min(hw_param_mask((p), SNDRV_PCM_HW_PARAM_ACCESS))