Add const and unsigned when it make sense and use size_t. Also use -Wall