From: Takashi Iwai Date: Thu, 10 Jul 2008 16:44:15 +0000 (+0200) Subject: Fix type-punning in test/pcm.c X-Git-Tag: v1.0.17~2 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=af2c3fbe7d28c2c4555aac75933263eb6e2d2e8a;p=alsa-lib.git Fix type-punning in test/pcm.c The cast won't work well with strict aliasing. Signed-off-by: Takashi Iwai --- diff --git a/test/pcm.c b/test/pcm.c index cd29259f..437d9907 100644 --- a/test/pcm.c +++ b/test/pcm.c @@ -38,7 +38,10 @@ static void generate_sine(const snd_pcm_channel_area_t *areas, unsigned char *samples[channels], *tmp; int steps[channels]; unsigned int chn, byte; - int ires; + union { + int i; + unsigned char c[4]; + } ires; unsigned int maxval = (1 << (snd_pcm_format_width(format) - 1)) - 1; int bps = snd_pcm_format_width(format) / 8; /* bytes per sample */