roll back the file which is mis-formatted by astyle
Add casts to avoid warnings about comparison between signed and unsigned
Merge pull request #1448 from sijchen/for_format

roll back the file which is mis-formatted by astyle
Merge pull request #1450 from mstorsjo/avoid-warnings

Add casts to avoid warnings about comparison between signed and unsigned