Wed Jan 1 11:48:36 2020 UTC ()
Avoid mixing signed/unsigned arguments to the ? operator.


(martin)
diff -r1.28 -r1.29 src/usr.bin/mkubootimage/mkubootimage.c

cvs diff -r1.28 -r1.29 src/usr.bin/mkubootimage/mkubootimage.c (expand / switch to context diff)
--- src/usr.bin/mkubootimage/mkubootimage.c 2020/01/01 10:35:10 1.28
+++ src/usr.bin/mkubootimage/mkubootimage.c 2020/01/01 11:48:36 1.29
@@ -1,4 +1,4 @@
-/* $NetBSD: mkubootimage.c,v 1.28 2020/01/01 10:35:10 skrll Exp $ */
+/* $NetBSD: mkubootimage.c,v 1.29 2020/01/01 11:48:36 martin Exp $ */
 
 /*-
  * Copyright (c) 2010 Jared D. McNeill <jmcneill@invisible.ca>
@@ -30,7 +30,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: mkubootimage.c,v 1.28 2020/01/01 10:35:10 skrll Exp $");
+__RCSID("$NetBSD: mkubootimage.c,v 1.29 2020/01/01 11:48:36 martin Exp $");
 
 #include <sys/mman.h>
 #include <sys/stat.h>
@@ -335,7 +335,7 @@
 		crc = crc32v(iov, 3);
 	} else {
 		dsize = update_image ?
-		    st.st_size - sizeof(*hdr) : st.st_size;
+		    (uint32_t)st.st_size - sizeof(*hdr) : (uint32_t)st.st_size;
 		crc = crc32(p, st.st_size);
 	}
 	munmap(p, st.st_size);
@@ -389,7 +389,7 @@
 #endif
 
 	const uint64_t dsize = update_image ?
-	   st.st_size - sizeof(*hdr) : st.st_size;
+	   (uint64_t)st.st_size - sizeof(*hdr) : (uint64_t)st.st_size;
 
 	memset(hdr, 0, sizeof(*hdr));
 	hdr->code0 = htole32(ARM64_CODE0);