fix compile warnings

Two commits:

1. fix C++ compiler warnings
2. add .rebar dir (created by rebar) to .gitignore