Do not define _SCL_SECURE_NO_WARNINGS or _CRT_SECURE_NO_WARNINGS if already defined (such as on the command line), plus related cleanups.
Eliminate gcc -Wconversion warnings.