Mercurial > audlegacy-plugins
comparison src/adplug/core/adlibemu.c @ 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 | 3da1b8942b8b |
children |
comparison
equal
deleted
inserted
replaced
2863:dd8b44fbfd6f | 2864:0d0a52f82be4 |
---|---|
142 { | 142 { |
143 long i; | 143 long i; |
144 | 144 |
145 ftol(ctc->t+modulator,&i); | 145 ftol(ctc->t+modulator,&i); |
146 | 146 |
147 if (*(long *)&ctc->amp <= 0x37800000) | 147 if ((long)ctc->amp <= 0x37800000) |
148 { | 148 { |
149 ctc->amp = 0; | 149 ctc->amp = 0; |
150 ctc->cellfunc = docell4; | 150 ctc->cellfunc = docell4; |
151 } | 151 } |
152 ctc->amp *= ctc->releasemul; | 152 ctc->amp *= ctc->releasemul; |
158 { | 158 { |
159 long i; | 159 long i; |
160 | 160 |
161 ftol(ctc->t+modulator,&i); | 161 ftol(ctc->t+modulator,&i); |
162 | 162 |
163 if ((*(long *)&ctc->amp) <= (*(long *)&ctc->sustain)) | 163 if ((long)ctc->amp <= (long)ctc->sustain) |
164 { | 164 { |
165 if (ctc->flags&32) | 165 if (ctc->flags&32) |
166 { | 166 { |
167 ctc->amp = ctc->sustain; | 167 ctc->amp = ctc->sustain; |
168 ctc->cellfunc = docell3; | 168 ctc->cellfunc = docell3; |
181 long i; | 181 long i; |
182 | 182 |
183 ftol(ctc->t+modulator,&i); | 183 ftol(ctc->t+modulator,&i); |
184 | 184 |
185 ctc->amp = ((ctc->a3*ctc->amp + ctc->a2)*ctc->amp + ctc->a1)*ctc->amp + ctc->a0; | 185 ctc->amp = ((ctc->a3*ctc->amp + ctc->a2)*ctc->amp + ctc->a1)*ctc->amp + ctc->a0; |
186 if ((*(long *)&ctc->amp) > 0x3f800000) | 186 if ((long)ctc->amp > 0x3f800000) |
187 { | 187 { |
188 ctc->amp = 1; | 188 ctc->amp = 1; |
189 ctc->cellfunc = docell1; | 189 ctc->cellfunc = docell1; |
190 } | 190 } |
191 | 191 |