summaryrefslogtreecommitdiffstats
path: root/sys/boot
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>2002-12-15 02:15:19 +0000
committerobrien <obrien@FreeBSD.org>2002-12-15 02:15:19 +0000
commit1a902e59d0765c068a2911ef9429d396a32b982a (patch)
tree7030aafdfa0a330880f2cc7bd8309dfd50cc0a11 /sys/boot
parentd1851c5aa8f69bb78591a02d70cb00ce27c211bf (diff)
downloadFreeBSD-src-1a902e59d0765c068a2911ef9429d396a32b982a.zip
FreeBSD-src-1a902e59d0765c068a2911ef9429d396a32b982a.tar.gz
Remove unneeded casts. Add others to make WARNS=5 happy.
Diffstat (limited to 'sys/boot')
-rw-r--r--sys/boot/i386/boot2/boot2.c12
-rw-r--r--sys/boot/i386/gptboot/gptboot.c12
2 files changed, 12 insertions, 12 deletions
diff --git a/sys/boot/i386/boot2/boot2.c b/sys/boot/i386/boot2/boot2.c
index 5d9066b..d09ac66 100644
--- a/sys/boot/i386/boot2/boot2.c
+++ b/sys/boot/i386/boot2/boot2.c
@@ -135,7 +135,7 @@ static inline int
strcmp(const char *s1, const char *s2)
{
for (; *s1 == *s2 && *s1; s1++, s2++);
- return (u_char)*s1 - (u_char)*s2;
+ return *s1 - *s2;
}
#include "ufsread.c"
@@ -143,7 +143,7 @@ strcmp(const char *s1, const char *s2)
static int
xfsread(ino_t inode, void *buf, size_t nbyte)
{
- if (fsread(inode, buf, nbyte) != nbyte) {
+ if ((size_t)fsread(inode, buf, nbyte) != nbyte) {
printf("Invalid %s\n", "format");
return -1;
}
@@ -259,7 +259,7 @@ main(void)
putchar('\n');
autoboot = 0;
if (parse(cmd))
- putchar('\a');
+ putchar('\a');
else
load(kname);
}
@@ -311,7 +311,7 @@ load(const char *fname)
return;
p += hdr.ex.a_data + roundup2(hdr.ex.a_bss, PAGE_SIZE);
bootinfo.bi_symtab = VTOP(p);
- memcpy(p, (char *)&hdr.ex.a_syms, sizeof(hdr.ex.a_syms));
+ memcpy(p, &hdr.ex.a_syms, sizeof(hdr.ex.a_syms));
p += sizeof(hdr.ex.a_syms);
if (hdr.ex.a_syms) {
if (xfsread(ino, p, hdr.ex.a_syms))
@@ -348,7 +348,7 @@ load(const char *fname)
if (xfsread(ino, &es, sizeof(es)))
return;
for (i = 0; i < 2; i++) {
- memcpy(p, (char *)&es[i].sh_size, sizeof(es[i].sh_size));
+ memcpy(p, &es[i].sh_size, sizeof(es[i].sh_size));
p += sizeof(es[i].sh_size);
fs_off = es[i].sh_offset;
if (xfsread(ino, p, es[i].sh_size))
@@ -437,7 +437,7 @@ parse(char *arg)
dsk_meta = 0;
}
if ((i = p - arg - !*(p - 1))) {
- if (i >= sizeof(kname))
+ if ((size_t)i >= sizeof(kname))
return -1;
memcpy(kname, arg, i + 1);
}
diff --git a/sys/boot/i386/gptboot/gptboot.c b/sys/boot/i386/gptboot/gptboot.c
index 5d9066b..d09ac66 100644
--- a/sys/boot/i386/gptboot/gptboot.c
+++ b/sys/boot/i386/gptboot/gptboot.c
@@ -135,7 +135,7 @@ static inline int
strcmp(const char *s1, const char *s2)
{
for (; *s1 == *s2 && *s1; s1++, s2++);
- return (u_char)*s1 - (u_char)*s2;
+ return *s1 - *s2;
}
#include "ufsread.c"
@@ -143,7 +143,7 @@ strcmp(const char *s1, const char *s2)
static int
xfsread(ino_t inode, void *buf, size_t nbyte)
{
- if (fsread(inode, buf, nbyte) != nbyte) {
+ if ((size_t)fsread(inode, buf, nbyte) != nbyte) {
printf("Invalid %s\n", "format");
return -1;
}
@@ -259,7 +259,7 @@ main(void)
putchar('\n');
autoboot = 0;
if (parse(cmd))
- putchar('\a');
+ putchar('\a');
else
load(kname);
}
@@ -311,7 +311,7 @@ load(const char *fname)
return;
p += hdr.ex.a_data + roundup2(hdr.ex.a_bss, PAGE_SIZE);
bootinfo.bi_symtab = VTOP(p);
- memcpy(p, (char *)&hdr.ex.a_syms, sizeof(hdr.ex.a_syms));
+ memcpy(p, &hdr.ex.a_syms, sizeof(hdr.ex.a_syms));
p += sizeof(hdr.ex.a_syms);
if (hdr.ex.a_syms) {
if (xfsread(ino, p, hdr.ex.a_syms))
@@ -348,7 +348,7 @@ load(const char *fname)
if (xfsread(ino, &es, sizeof(es)))
return;
for (i = 0; i < 2; i++) {
- memcpy(p, (char *)&es[i].sh_size, sizeof(es[i].sh_size));
+ memcpy(p, &es[i].sh_size, sizeof(es[i].sh_size));
p += sizeof(es[i].sh_size);
fs_off = es[i].sh_offset;
if (xfsread(ino, p, es[i].sh_size))
@@ -437,7 +437,7 @@ parse(char *arg)
dsk_meta = 0;
}
if ((i = p - arg - !*(p - 1))) {
- if (i >= sizeof(kname))
+ if ((size_t)i >= sizeof(kname))
return -1;
memcpy(kname, arg, i + 1);
}
OpenPOWER on IntegriCloud