Fix compilation warnings reported by gcc -Wsign-compare

* configure.ac (gl_WARN_ADD): Add -Wsign-compare.
* defs.h (struct tcb): Change 'currpers' type to unsigned.
(struct xlat): Change 'val' type to unsigned
(signame): Add 'const' qualifier to its argument.
(xlookup, printxval): Add 'const' qualifier to the 2nd argument and
change its type to unsigned.
(printpathn): Change the 3rd argument type to unsigned.
(ioctl_lookup): Change 1st argument type to unsigned.
* count.c (call_summary_pers, call_summary): Change 'i' type to unsigned.
* file.c (print_xattr_list): Fix comparisons between signed and unsigned
long values.
* ioctl.c (compare): Fix cast.
(ioctl_lookup): Change 1st argument type to to unsigned.
(ioctl_next_match): Change 'code' type to unsigned.
* mem.c (sys_move_pages): Change 'i' type to unsigned.
* mtd.c (mtd_ioctl): Change 'i' and 'j' types to unsigned.
Print 'i' using %u format string.
* process.c (sys_prctl): Change 'i' type to unsigned.
(printargv): Change 'n' type to unsigned.
(sys_ptrace): Change 'addr' type to unsigned.
* scsi.c (print_sg_io_buffer): Add 'const' qualifier to 'len' argument
and change its type to unsigned.  Change 'i' and 'allocated' types
to unsigned.
* signal.c (signame): Add 'const' qualifier to its argument.
Fix comparisons between signed and unsigned values.
(sprintsigmask_n, printsiginfo): Fix comparisons between signed and
unsigned values.
* sock.c (sock_ioctl): Change 'i' and 'nifra' types to unsigned.
* strace.c (expand_tcbtab, alloctcb): Change 'i' type to unsigned.
(detach): Change 'sig' type to unsigned.
(startup_attach): Change 'tcbi' type to unsigned.
(startup_child): Change 'm', 'n', and 'len' types to unsigned.
(init): Use new variable to iterate 'tcbtab'.
(pid2tcb): Change 'i' type to unsigned.
(cleanup): Change 'i' and 'sig' types to unsigned.
* syscall.c (update_personality): Change 'personality' argument type
to unsigned.
(struct qual_options): Change 'bitflag' type to unsigned.
(reallocate_qual): Add 'const' qualifier to its argument and change its
type to unsigned.
(qualify_one): Change 'n' and 'bitflag' arguments types to unsigned.
Add 'const' qualifier to 'n', 'not', and 'pers' arguments.
Change 'p' type to signed int.
(qual_syscall): Change 'bitflag' argument type to unsigned.
Add 'const' qualifier to 'bitflag' and 'not' arguments.
Change 'p' type to signed int.
(qual_signal): Change 'bitflag' argument type to unsigned.
Add 'const' qualifier to 'bitflag' and 'not' arguments.
Change 'i' type to unsigned.
(qual_desc): Change 'bitflag' argument type to unsigned.
Add 'const' qualifier to 'bitflag' and 'not' arguments.
(qualify): Change 'i' type to unsigned.
(get_scno): Change 'currpers' type to unsigned.
Fix a comparison between signed and unsigned values.
* system.c (sys_sysctl): Change 'cnt' and 'max_cnt' types to unsigned.
Fix comparisons between signed and unsigned values.
* util.c (xlookup, printxval): Add 'const' qualifier to 'val' argument
and change its type to unsigned.
(printuid): Fix a comparison between signed and unsigned values.
(printpathn): Change 'n' argument type to unsigned.
(printstr): Change 'size' type to unsigned.
Fix a comparison between signed and unsigned values.
(setbpt): Change 'i' type to unsigned.
* net.c (printsock): Silence a compilation warning.
* reboot.c (sys_reboot): Likewise.
diff --git a/signal.c b/signal.c
index f6eeed0..74e0fd9 100644
--- a/signal.c
+++ b/signal.c
@@ -144,18 +144,22 @@
  */
 
 const char *
-signame(int sig)
+signame(const int sig)
 {
-	static char buf[sizeof("SIGRT_%d") + sizeof(int)*3];
+	static char buf[sizeof("SIGRT_%u") + sizeof(int)*3];
 
-	if (sig >= 0 && sig < nsignals)
-		return signalent[sig];
+	if (sig >= 0) {
+		const unsigned int s = sig;
+
+		if (s < nsignals)
+			return signalent[s];
 #ifdef SIGRTMIN
-	if (sig >= __SIGRTMIN && sig <= __SIGRTMAX) {
-		sprintf(buf, "SIGRT_%d", (int)(sig - __SIGRTMIN));
-		return buf;
-	}
+		if (s >= __SIGRTMIN && s <= __SIGRTMAX) {
+			sprintf(buf, "SIGRT_%u", s - __SIGRTMIN);
+			return buf;
+		}
 #endif
+	}
 	sprintf(buf, "%d", sig);
 	return buf;
 }
@@ -217,7 +221,7 @@
 	for (i = 0; (i = next_set_bit(mask, i, size * 32)) >= 0; ) {
 		++i;
 		*s++ = sep;
-		if (i < nsignals) {
+		if ((unsigned) i < nsignals) {
 			s = stpcpy(s, signalent[i] + 3);
 		}
 #ifdef SIGRTMIN
@@ -428,7 +432,7 @@
 #endif
 	{
 		if (sip->si_errno) {
-			if (sip->si_errno < 0 || sip->si_errno >= nerrnos)
+			if (sip->si_errno < 0 || (unsigned) sip->si_errno >= nerrnos)
 				tprintf(", si_errno=%d", sip->si_errno);
 			else
 				tprintf(", si_errno=%s",