Fix gcc compiler warnings from -Wall, including:

unused variables or methods (-Wunused)
uninitialized variables (-Wuninitialized)
signed/unsigned comparisons (-Wsign-compare)
order of initiliazers (-Wreorder)
Merge pull request #882 from ajschult/warnings

Fix gcc compiler warnings from -Wall