changeset 2864:0d0a52f82be4

Dereferencing type-punned pointers is bad, hmmkay?
author Tony Vroon <chainsaw@gentoo.org>
date Wed, 06 Aug 2008 11:17:21 +0100
parents dd8b44fbfd6f
children 0ba28b84bdef
files src/adplug/core/adlibemu.c
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/adplug/core/adlibemu.c	Mon Aug 04 06:49:41 2008 +0300
+++ b/src/adplug/core/adlibemu.c	Wed Aug 06 11:17:21 2008 +0100
@@ -144,7 +144,7 @@
 
     ftol(ctc->t+modulator,&i);
 
-    if (*(long *)&ctc->amp <= 0x37800000)
+    if ((long)ctc->amp <= 0x37800000)
     {
 	ctc->amp = 0;
 	ctc->cellfunc = docell4;
@@ -160,7 +160,7 @@
 
     ftol(ctc->t+modulator,&i);
 
-    if ((*(long *)&ctc->amp) <= (*(long *)&ctc->sustain))
+    if ((long)ctc->amp <= (long)ctc->sustain)
     {
 	if (ctc->flags&32)
 	{
@@ -183,7 +183,7 @@
     ftol(ctc->t+modulator,&i);
 
     ctc->amp = ((ctc->a3*ctc->amp + ctc->a2)*ctc->amp + ctc->a1)*ctc->amp + ctc->a0;
-    if ((*(long *)&ctc->amp) > 0x3f800000)
+    if ((long)ctc->amp > 0x3f800000)
     {
 	ctc->amp = 1;
 	ctc->cellfunc = docell1;