Fix unused variable and signed/unsigned warnings (GH-15537) (GH-15551)

(cherry picked from commit 0138c4ceab1e10d42d0aa962d2ae079b46da7671)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
3 files changed