I'm using your Adlib emulator on a game project and I have a question about the code. (Sorry if this isn't code you wrote, I dunno if it's shared by the two adlib emulators in adplug).
"if (*(long *)&ctc->amp <= 0x37800000)"
Seeing as amp is a float, wtf is that code checking against? It works, but I fear it may be unportable.
Awesoken at
Re: Adlib emulator
Another way to write that is: "if (ctc->amp <= (1.0/65536.0))". It's a little speed trick that forces the compiler to do the comparison as integer instead of floating point. I don't think there would be a portability issue unless "long" does not represent 32 bits on your system. It's also possible that some systems might run the obfuscated form slower.
yuriks at
That's the Ken I know/heard of. =] Thanks for the answer.