# HG changeset patch # User Tony Vroon # Date 1218017841 -3600 # Node ID 0d0a52f82be4b6f437305f3392e5e2fdb3f06c3e # Parent dd8b44fbfd6fa1a21f77373e7dcc8a973de151e1 Dereferencing type-punned pointers is bad, hmmkay? diff -r dd8b44fbfd6f -r 0d0a52f82be4 src/adplug/core/adlibemu.c --- 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;