fixed various warnings about converting size_t to int

these warnings started showing up building in 64 bit on windows