fix sign compare warning
fix #2018