Fixed gcc -Wextra warnings.

Hello dreda,

this pull request implements or improves the existing implementation of gcc -Wall warning fixes. Those warnings are about unused parameters and comparision between signed and unsigned types.