Fdct fix

This test is incorrect on 16-bit architectures (it assumes int is 32 bit). Substituted long int where appropriate (guaranteed to be 32 bit).

Also made ANSI compliant, fit into 80 columns and corrected the validity check.