Module Name:    src
Committed By:   roy
Date:           Mon Apr 11 21:37:19 UTC 2011

Modified Files:
        src/lib/libterminfo: compile.c term.c

Log Message:
Clean up some compile warnings


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/lib/libterminfo/compile.c
cvs rdiff -u -r1.11 -r1.12 src/lib/libterminfo/term.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libterminfo/compile.c
diff -u src/lib/libterminfo/compile.c:1.4 src/lib/libterminfo/compile.c:1.5
--- src/lib/libterminfo/compile.c:1.4	Tue Mar  2 14:11:11 2010
+++ src/lib/libterminfo/compile.c	Mon Apr 11 21:37:19 2011
@@ -1,7 +1,7 @@
-/* $NetBSD: compile.c,v 1.4 2010/03/02 14:11:11 roy Exp $ */
+/* $NetBSD: compile.c,v 1.5 2011/04/11 21:37:19 roy Exp $ */
 
 /*
- * Copyright (c) 2009, 2010 The NetBSD Foundation, Inc.
+ * Copyright (c) 2009, 2010, 2011 The NetBSD Foundation, Inc.
  *
  * This code is derived from software contributed to The NetBSD Foundation
  * by Roy Marples.
@@ -32,7 +32,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: compile.c,v 1.4 2010/03/02 14:11:11 roy Exp $");
+__RCSID("$NetBSD: compile.c,v 1.5 2011/04/11 21:37:19 roy Exp $");
 
 #if !HAVE_NBTOOL_CONFIG_H || HAVE_SYS_ENDIAN_H
 #include <sys/endian.h>
@@ -344,7 +344,7 @@
 				if (ch == '?')
 					ch = '\177';
 				else if ((ch &= 037) == 0)
-					ch = 128;
+					ch = (char)128;
 			}
 			*p++ = ch;
 			last = ch;
@@ -452,7 +452,8 @@
 {
 	char *token, *p, *e, *name, *desc, *alias;
 	signed char flag;
-	long num;
+	long cnum;
+	short num;
 	ssize_t ind;
 	size_t len;
 	TBUF buf;
@@ -564,17 +565,18 @@
 			    _ti_find_cap(&tic->nums, 'n', ind) != NULL)
 				continue;
 
-			num = strtol(p, &e, 0);
+			cnum = strtol(p, &e, 0);
 			if (*e != '\0') {
 				dowarn(flags, "%s: %s: not a number",
 				    tic->name, token);
 				continue;
 			}
-			if (!VALID_NUMERIC(num)) {
+			if (!VALID_NUMERIC(cnum)) {
 				dowarn(flags, "%s: %s: number out of range",
 				    tic->name, token);
 				continue;
 			}
+			num = (short)cnum;
 			if (ind == -1)
 				_ti_store_extra(tic, 1, token, 'n', -1,
 				    num, NULL, 0, flags);
@@ -608,7 +610,7 @@
 				le16enc(tic->nums.buf + tic->nums.bufpos, ind);
 				tic->nums.bufpos += sizeof(uint16_t);
 				le16enc(tic->nums.buf + tic->nums.bufpos,
-					CANCELLED_NUMERIC);
+					(uint16_t)CANCELLED_NUMERIC);
 				tic->nums.bufpos += sizeof(uint16_t);
 				tic->nums.entries++;
 				continue;

Index: src/lib/libterminfo/term.c
diff -u src/lib/libterminfo/term.c:1.11 src/lib/libterminfo/term.c:1.12
--- src/lib/libterminfo/term.c:1.11	Fri Feb 26 00:09:00 2010
+++ src/lib/libterminfo/term.c	Mon Apr 11 21:37:19 2011
@@ -1,7 +1,7 @@
-/* $NetBSD: term.c,v 1.11 2010/02/26 00:09:00 roy Exp $ */
+/* $NetBSD: term.c,v 1.12 2011/04/11 21:37:19 roy Exp $ */
 
 /*
- * Copyright (c) 2009, 2010 The NetBSD Foundation, Inc.
+ * Copyright (c) 2009, 2010, 2011 The NetBSD Foundation, Inc.
  *
  * This code is derived from software contributed to The NetBSD Foundation
  * by Roy Marples.
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: term.c,v 1.11 2010/02/26 00:09:00 roy Exp $");
+__RCSID("$NetBSD: term.c,v 1.12 2011/04/11 21:37:19 roy Exp $");
 
 #include <sys/stat.h>
 
@@ -354,7 +354,8 @@
 		if (tic != NULL && ticcmp(tic, name) == 0) {
 			len = _ti_flatten(&f, tic);
 			if (len != -1) {
-				r = _ti_readterm(term, (char *)f, len, flags);
+				r = _ti_readterm(term, (char *)f, (size_t)len,
+				    flags);
 				free(f);
 			}
 		}

Reply via email to