Module Name:    src
Committed By:   christos
Date:           Thu Feb  5 16:05:20 UTC 2015

Modified Files:
        src/lib/libc/gen: sysctl.c
        src/lib/libc/stdio: gettemp.c

Log Message:
add a couple of casts.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/lib/libc/gen/sysctl.c
cvs rdiff -u -r1.19 -r1.20 src/lib/libc/stdio/gettemp.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/libc/gen/sysctl.c
diff -u src/lib/libc/gen/sysctl.c:1.34 src/lib/libc/gen/sysctl.c:1.35
--- src/lib/libc/gen/sysctl.c:1.34	Fri May 16 08:22:32 2014
+++ src/lib/libc/gen/sysctl.c	Thu Feb  5 11:05:20 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: sysctl.c,v 1.34 2014/05/16 12:22:32 martin Exp $	*/
+/*	$NetBSD: sysctl.c,v 1.35 2015/02/05 16:05:20 christos Exp $	*/
 
 /*-
  * Copyright (c) 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)sysctl.c	8.2 (Berkeley) 1/4/94";
 #else
-__RCSID("$NetBSD: sysctl.c,v 1.34 2014/05/16 12:22:32 martin Exp $");
+__RCSID("$NetBSD: sysctl.c,v 1.35 2015/02/05 16:05:20 christos Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -313,7 +313,7 @@ user_sysctl(const int *name, unsigned in
 			if (d2 != NULL)
 				memcpy(d2, d1, d);
 			sz += d;
-			d2 = (struct sysctldesc *)((char *)d2 + d);
+			d2 = (struct sysctldesc *)(void *)((char *)d2 + d);
 			if (node != NULL)
 				break;
 		}

Index: src/lib/libc/stdio/gettemp.c
diff -u src/lib/libc/stdio/gettemp.c:1.19 src/lib/libc/stdio/gettemp.c:1.20
--- src/lib/libc/stdio/gettemp.c:1.19	Thu Jun 19 01:31:15 2014
+++ src/lib/libc/stdio/gettemp.c	Thu Feb  5 11:05:20 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: gettemp.c,v 1.19 2014/06/19 05:31:15 msaitoh Exp $	*/
+/*	$NetBSD: gettemp.c,v 1.20 2015/02/05 16:05:20 christos Exp $	*/
 
 /*
  * Copyright (c) 1987, 1993
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)mktemp.c	8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: gettemp.c,v 1.19 2014/06/19 05:31:15 msaitoh Exp $");
+__RCSID("$NetBSD: gettemp.c,v 1.20 2015/02/05 16:05:20 christos Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -85,13 +85,13 @@ GETTEMP(char *path, int *doopen, int dom
 
 	/* Fill space with random characters */
 	while (trv >= path && *trv == 'X') {
-		r = arc4random_uniform(sizeof(padchar) - 1);
+		r = arc4random_uniform((unsigned int)(sizeof(padchar) - 1));
 		*trv-- = padchar[r];
 	}
 	start = trv + 1;
 
 	/* save first combination of random characters */
-	memcpy(carrybuf, start, suffp - start);
+	memcpy(carrybuf, start, (size_t)(suffp - start));
 
 	/*
 	 * check the target directory.

Reply via email to