Remove old comments regarding CHAR->char change.
In CSoundFile::SetPatternName, check input argument lpszName for NULL.
Don't initialize variables twice
If wave_size is zero, explicitly set p variable to NULL (don't rely on malloc behaviour)
Don't access h after MID_cleanup
Don't use smplflags unless SMPI section has been loaded.
Match calloc types to variables
Improve ABC detection code.

Don't assume binary if get a new line early on.
If no h->track exists, don't use certain code

- don't read patterns
- don't try adding a partbreak
Reformat file.
If read is truncated, read zeros for the remaining part of the buffer.
Avoid possibility of divide by zero.
Remove use of derr, as it is unused.
Use uint32_t for 32bit number

- avoid size changing on different architectures (64bit vs 32bit etc)
Abort if file size is zero
Initialize insflags, inspack with 0s
Initialize all of c array to zero

- Don't need to set values later
Run cleanup if MID loading does not complete.
Remove unused assignments.