unix.sh went through dos2unix, works again under Cygwin.

Also fixed all the gcc warnings Cygwin's GCC v4.8.3-3 gave (mostly int
vs unsigned int compares and "%u" used with *int).