Commit 69b349765c95b76a446011ee71de57c07c1371e8
1 parent
96b8f136
Fix miscellaneous minor things, by Andre Przywara.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3826 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
6 changed files
with
12 additions
and
8 deletions
aes.c
| @@ -30,7 +30,10 @@ | @@ -30,7 +30,10 @@ | ||
| 30 | #include "qemu-common.h" | 30 | #include "qemu-common.h" |
| 31 | #include "aes.h" | 31 | #include "aes.h" |
| 32 | 32 | ||
| 33 | +#ifndef NDEBUG | ||
| 33 | #define NDEBUG | 34 | #define NDEBUG |
| 35 | +#endif | ||
| 36 | + | ||
| 34 | #include <assert.h> | 37 | #include <assert.h> |
| 35 | 38 | ||
| 36 | typedef uint32_t u32; | 39 | typedef uint32_t u32; |
hw/adlib.c
hw/ide.c
| @@ -430,8 +430,7 @@ static void padstr(char *str, const char *src, int len) | @@ -430,8 +430,7 @@ static void padstr(char *str, const char *src, int len) | ||
| 430 | v = *src++; | 430 | v = *src++; |
| 431 | else | 431 | else |
| 432 | v = ' '; | 432 | v = ' '; |
| 433 | - *(char *)((long)str ^ 1) = v; | ||
| 434 | - str++; | 433 | + str[i^1] = v; |
| 435 | } | 434 | } |
| 436 | } | 435 | } |
| 437 | 436 |
hw/pcnet.c
| @@ -350,8 +350,8 @@ static inline void pcnet_tmd_load(PCNetState *s, struct pcnet_TMD *tmd, | @@ -350,8 +350,8 @@ static inline void pcnet_tmd_load(PCNetState *s, struct pcnet_TMD *tmd, | ||
| 350 | } else { | 350 | } else { |
| 351 | s->phys_mem_read(s->dma_opaque, addr, (void *)tmd, sizeof(*tmd), 0); | 351 | s->phys_mem_read(s->dma_opaque, addr, (void *)tmd, sizeof(*tmd), 0); |
| 352 | le32_to_cpus(&tmd->tbadr); | 352 | le32_to_cpus(&tmd->tbadr); |
| 353 | - le16_to_cpus(&tmd->length); | ||
| 354 | - le16_to_cpus(&tmd->status); | 353 | + le16_to_cpus((uint16_t *)&tmd->length); |
| 354 | + le16_to_cpus((uint16_t *)&tmd->status); | ||
| 355 | le32_to_cpus(&tmd->misc); | 355 | le32_to_cpus(&tmd->misc); |
| 356 | le32_to_cpus(&tmd->res); | 356 | le32_to_cpus(&tmd->res); |
| 357 | if (BCR_SWSTYLE(s) == 3) { | 357 | if (BCR_SWSTYLE(s) == 3) { |
| @@ -416,8 +416,8 @@ static inline void pcnet_rmd_load(PCNetState *s, struct pcnet_RMD *rmd, | @@ -416,8 +416,8 @@ static inline void pcnet_rmd_load(PCNetState *s, struct pcnet_RMD *rmd, | ||
| 416 | } else { | 416 | } else { |
| 417 | s->phys_mem_read(s->dma_opaque, addr, (void *)rmd, sizeof(*rmd), 0); | 417 | s->phys_mem_read(s->dma_opaque, addr, (void *)rmd, sizeof(*rmd), 0); |
| 418 | le32_to_cpus(&rmd->rbadr); | 418 | le32_to_cpus(&rmd->rbadr); |
| 419 | - le16_to_cpus(&rmd->buf_length); | ||
| 420 | - le16_to_cpus(&rmd->status); | 419 | + le16_to_cpus((uint16_t *)&rmd->buf_length); |
| 420 | + le16_to_cpus((uint16_t *)&rmd->status); | ||
| 421 | le32_to_cpus(&rmd->msg_length); | 421 | le32_to_cpus(&rmd->msg_length); |
| 422 | le32_to_cpus(&rmd->res); | 422 | le32_to_cpus(&rmd->res); |
| 423 | if (BCR_SWSTYLE(s) == 3) { | 423 | if (BCR_SWSTYLE(s) == 3) { |
monitor.c
| @@ -1824,7 +1824,7 @@ static int64_t expr_unary(void) | @@ -1824,7 +1824,7 @@ static int64_t expr_unary(void) | ||
| 1824 | case '$': | 1824 | case '$': |
| 1825 | { | 1825 | { |
| 1826 | char buf[128], *q; | 1826 | char buf[128], *q; |
| 1827 | - target_long reg; | 1827 | + target_long reg=0; |
| 1828 | 1828 | ||
| 1829 | pch++; | 1829 | pch++; |
| 1830 | q = buf; | 1830 | q = buf; |
vl.c
| @@ -4423,7 +4423,8 @@ static NetSocketState *net_socket_fd_init(VLANState *vlan, int fd, | @@ -4423,7 +4423,8 @@ static NetSocketState *net_socket_fd_init(VLANState *vlan, int fd, | ||
| 4423 | { | 4423 | { |
| 4424 | int so_type=-1, optlen=sizeof(so_type); | 4424 | int so_type=-1, optlen=sizeof(so_type); |
| 4425 | 4425 | ||
| 4426 | - if(getsockopt(fd, SOL_SOCKET, SO_TYPE, (char *)&so_type, &optlen)< 0) { | 4426 | + if(getsockopt(fd, SOL_SOCKET, SO_TYPE, (char *)&so_type, |
| 4427 | + (socklen_t *)&optlen)< 0) { | ||
| 4427 | fprintf(stderr, "qemu: error: getsockopt(SO_TYPE) for fd=%d failed\n", fd); | 4428 | fprintf(stderr, "qemu: error: getsockopt(SO_TYPE) for fd=%d failed\n", fd); |
| 4428 | return NULL; | 4429 | return NULL; |
| 4429 | } | 4430 | } |