fixed about 100 warnings

fixing about 100 warnings about signed/unsigned comparison