diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2010-05-10 22:14:44 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2010-05-10 22:14:44 +0000 |
commit | 2b601f55313e89133dd0f5ff0322650efdceab3a (patch) | |
tree | 49d08248595b3128c5699f0655136c2fe2991cf9 | |
parent | 9dd5c1372b7579105ce27400e9d5d29118014af3 (diff) |
Don't postincrement a casted pointer; split into multiple statements instead.
Makes gcc4 happy.
ok miod@
-rw-r--r-- | sys/arch/mips64/mips64/db_machdep.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/sys/arch/mips64/mips64/db_machdep.c b/sys/arch/mips64/mips64/db_machdep.c index efc37a98fc1..279046dcc8d 100644 --- a/sys/arch/mips64/mips64/db_machdep.c +++ b/sys/arch/mips64/mips64/db_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: db_machdep.c,v 1.27 2010/01/21 17:50:44 miod Exp $ */ +/* $OpenBSD: db_machdep.c,v 1.28 2010/05/10 22:14:43 kettenis Exp $ */ /* * Copyright (c) 1998-2003 Opsycon AB (www.opsycon.se) @@ -156,13 +156,15 @@ db_read_bytes(addr, size, data) char *data; { while (size >= sizeof(uint32_t)) { - *((uint32_t *)data)++ = kdbpeek(addr); + *(uint32_t *)data = kdbpeek(addr); + data += sizeof(uint32_t); addr += sizeof(uint32_t); size -= sizeof(uint32_t); } if (size >= sizeof(uint16_t)) { - *((uint16_t *)data)++ = kdbpeekw(addr); + *(uint16_t *)data = kdbpeekw(addr); + data += sizeof(uint16_t); addr += sizeof(uint16_t); size -= sizeof(uint16_t); } @@ -181,13 +183,15 @@ db_write_bytes(addr, size, data) size_t len = size; while (len >= sizeof(uint32_t)) { - kdbpoke(ptr, *((uint32_t *)data)++); + kdbpoke(ptr, *(uint32_t *)data); + data += sizeof(uint32_t); ptr += sizeof(uint32_t); len -= sizeof(uint32_t); } if (len >= sizeof(uint16_t)) { - kdbpokew(ptr, *((uint16_t *)data)++); + kdbpokew(ptr, *(uint16_t *)data); + data += sizeof(uint16_t); ptr += sizeof(uint16_t); len -= sizeof(uint16_t); } |