Fix gcc warnings

Merged Thomas E. Dickey requested to merge dickey/libxt:fix-gcc-warnings into master

These are compiler-warning fixes, some with minor logic changes.

Merge request reports