OSDN Git Service
(root)
/
android-x86
/
external-alsa-lib.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5e91207
)
Fix type-punning in test/pcm.c
author
Takashi Iwai
<tiwai@suse.de>
Thu, 10 Jul 2008 16:44:15 +0000
(18:44 +0200)
committer
Takashi Iwai
<tiwai@suse.de>
Thu, 10 Jul 2008 16:44:15 +0000
(18:44 +0200)
The cast won't work well with strict aliasing.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
test/pcm.c
patch
|
blob
|
history
diff --git
a/test/pcm.c
b/test/pcm.c
index
cd29259
..
437d990
100644
(file)
--- 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 */