Upgrade CFLAGS to -Wall -Werror, fixup as needed.  Mostly: Ditch int loop vars, remove unused variables, and ensure we return something in non-void methods.