fix various 'comparison of integers of different signs' compiling errors under macosx
Merge pull request #226 from bbiao/master

fix various 'comparison of integers of different signs' compiling errors...