Warning/issue update from clang.

  I've updated some functions to avoid unused-variable warnings,
 and to drop qualifiers on function return-values.

  Ideally no functional changes, and things continue to compile
 under gcc with `-Wall -Werror -Wextra -pedantic` - barring warnings
 coming from (n)curses.