diff options
author | kan <kan@FreeBSD.org> | 2004-07-28 06:21:53 +0000 |
---|---|---|
committer | kan <kan@FreeBSD.org> | 2004-07-28 06:21:53 +0000 |
commit | 4caefcbb3efd3493a8f32539679faf818ae0e1f1 (patch) | |
tree | fa20bec983805e312b0374afcf51d79ab4e27e9d /sys | |
parent | 6cabb1fb0d2ee2931258c88746b2c7b7224e9632 (diff) | |
download | FreeBSD-src-4caefcbb3efd3493a8f32539679faf818ae0e1f1.zip FreeBSD-src-4caefcbb3efd3493a8f32539679faf818ae0e1f1.tar.gz |
Avoid casts as lvalues.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/ddb/db_main.c | 6 | ||||
-rw-r--r-- | sys/dev/aac/aac.c | 7 | ||||
-rw-r--r-- | sys/dev/aac/aac_disk.c | 2 | ||||
-rw-r--r-- | sys/dev/firewire/firewire.c | 2 | ||||
-rw-r--r-- | sys/dev/scd/scd.c | 11 | ||||
-rw-r--r-- | sys/dev/si/si.c | 22 |
6 files changed, 33 insertions, 17 deletions
diff --git a/sys/ddb/db_main.c b/sys/ddb/db_main.c index 32dd347..0a2cd56 100644 --- a/sys/ddb/db_main.c +++ b/sys/ddb/db_main.c @@ -170,9 +170,11 @@ db_init(void) if (ksym_end > ksym_start && ksym_start != 0) { symtab = ksym_start; - tabsz = *((Elf_Size*)symtab)++; + tabsz = *((Elf_Size*)symtab); + tabsz += sizeof(Elf_Size); strtab = symtab + tabsz; - strsz = *((Elf_Size*)strtab)++; + strsz = *((Elf_Size*)strtab); + strsz += sizeof(Elf_Size); if (strtab + strsz <= ksym_end) { db_add_symbol_table((char *)symtab, (char *)(symtab + tabsz), "elf", (char *)strtab); diff --git a/sys/dev/aac/aac.c b/sys/dev/aac/aac.c index 03978ab..c3a750f 100644 --- a/sys/dev/aac/aac.c +++ b/sys/dev/aac/aac.c @@ -955,7 +955,7 @@ aac_bio_command(struct aac_softc *sc, struct aac_command **cmp) br->Flags = 0; fib->Header.Size += sizeof(struct aac_blockread64); cm->cm_flags |= AAC_CMD_DATAOUT; - (struct aac_sg_table64 *)cm->cm_sgtable = &br->SgMap64; + cm->cm_sgtable = (struct aac_sg_table *)&br->SgMap64; } else { struct aac_blockwrite64 *bw; bw = (struct aac_blockwrite64 *)&fib->data[0]; @@ -967,7 +967,7 @@ aac_bio_command(struct aac_softc *sc, struct aac_command **cmp) bw->Flags = 0; fib->Header.Size += sizeof(struct aac_blockwrite64); cm->cm_flags |= AAC_CMD_DATAIN; - (struct aac_sg_table64 *)cm->cm_sgtable = &bw->SgMap64; + cm->cm_sgtable = (struct aac_sg_table *)&bw->SgMap64; } } @@ -1503,7 +1503,8 @@ aac_init(struct aac_softc *sc) aac_common_map, sc, 0); if (sc->aac_common_busaddr < 8192) { - (uint8_t *)sc->aac_common += 8192; + sc->aac_common = (struct aac_common *) + ((uint8_t *)sc->aac_common + 8192); sc->aac_common_busaddr += 8192; } bzero(sc->aac_common, sizeof(*sc->aac_common)); diff --git a/sys/dev/aac/aac_disk.c b/sys/dev/aac/aac_disk.c index a52b7bb..0be6dcf 100644 --- a/sys/dev/aac/aac_disk.c +++ b/sys/dev/aac/aac_disk.c @@ -282,7 +282,7 @@ aac_disk_dump(void *arg, void *virtual, vm_offset_t physical, off_t offset, size length -= len; offset += len; - (vm_offset_t)virtual += len; + virtual = (uint8_t *)virtual + len; } return (0); diff --git a/sys/dev/firewire/firewire.c b/sys/dev/firewire/firewire.c index 9bd5dd6..f2b7164 100644 --- a/sys/dev/firewire/firewire.c +++ b/sys/dev/firewire/firewire.c @@ -1760,7 +1760,7 @@ fw_rcv_copy(struct fw_rcv_buf *rb) /* Copy header */ p = (u_char *)&rb->xfer->recv.hdr; bcopy(rb->vec->iov_base, p, tinfo->hdr_len); - (u_char *)rb->vec->iov_base += tinfo->hdr_len; + rb->vec->iov_base = (u_char *)rb->vec->iov_base + tinfo->hdr_len; rb->vec->iov_len -= tinfo->hdr_len; /* Copy payload */ diff --git a/sys/dev/scd/scd.c b/sys/dev/scd/scd.c index 93332e2..e474a8a 100644 --- a/sys/dev/scd/scd.c +++ b/sys/dev/scd/scd.c @@ -1058,22 +1058,21 @@ get_tl(struct sony_toc *toc, int size) if (tl->track != 0xb0) return (tl); - (char *)tl += 9; if (tl->track != 0xb1) return (tl); - (char *)tl += 9; + tl = (struct sony_tracklist *)((char *)tl + 9); if (tl->track != 0xb2) return (tl); - (char *)tl += 9; + tl = (struct sony_tracklist *)((char *)tl + 9); if (tl->track != 0xb3) return (tl); - (char *)tl += 9; + tl = (struct sony_tracklist *)((char *)tl + 9); if (tl->track != 0xb4) return (tl); - (char *)tl += 9; + tl = (struct sony_tracklist *)((char *)tl + 9); if (tl->track != 0xc0) return (tl); - (char *)tl += 9; + tl = (struct sony_tracklist *)((char *)tl + 9); return (tl); } diff --git a/sys/dev/si/si.c b/sys/dev/si/si.c index aea1172..ad81ab0 100644 --- a/sys/dev/si/si.c +++ b/sys/dev/si/si.c @@ -215,23 +215,37 @@ static char *si_type[] = { static void __inline si_bcopy(const void *src, void *dst, size_t len) { + u_char *d; + const u_char *s; + + d = dst; + s = src; while (len--) - *(((u_char *)dst)++) = *(((const u_char *)src)++); + *d++ = *s++; } static void __inline si_vbcopy(const volatile void *src, void *dst, size_t len) { + u_char *d; + const volatile u_char *s; + + d = dst; + s = src; while (len--) - *(((u_char *)dst)++) = *(((const volatile u_char *)src)++); + *d++ = *s++; } static void __inline si_bcopyv(const void *src, volatile void *dst, size_t len) { + volatile u_char *d; + const u_char *s; + + d = dst; + s = src; while (len--) - *(((volatile u_char *)dst)++) = *(((const u_char *)src)++); + *d++ = *s++; } - /* * Attach the device. Initialize the card. */ |