Fix trivial "endianness bugs"
Subsystems (2)
PATCH 1/1 Fix trivial "endianness bugs"
Replace endianess -> endianness.
--- audio/sdlaudio.c | 20 ++++++++++---------- block/vdi.c | 4 ++-- hw/xilinx_ethlite.c | 2 +- target-mips/cpu.h | 2 +- usb-bsd.c | 2 +- 5 files changed, 15 insertions(+), 15 deletions(-)
audio/sdlaudio.c +10 -10
@@ -139,36 +139,36 @@ static int aud_to_sdlfmt (audfmt_e fmt) } } -static int sdl_to_audfmt (int sdlfmt,audfmt_e *fmt,int *endianess) +static int sdl_to_audfmt (int sdlfmt,audfmt_e *fmt,int *endianness) {switch (sdlfmt) {case AUDIO_S8 : - *endianess =0 ; + *endianness =0 ; *fmt =AUD_FMT_S8 ;break ;case AUDIO_U8 : - *endianess =0 ; + *endianness =0 ; *fmt =AUD_FMT_U8 ;break ;case AUDIO_S16LSB : - *endianess =0 ; + *endianness =0 ; *fmt =AUD_FMT_S16 ;break ;case AUDIO_U16LSB : - *endianess =0 ; + *endianness =0 ; *fmt =AUD_FMT_U16 ;break ;case AUDIO_S16MSB : - *endianess =1 ; + *endianness =1 ; *fmt =AUD_FMT_S16 ;break ;case AUDIO_U16MSB : - *endianess =1 ; + *endianness =1 ; *fmt =AUD_FMT_U16 ;break ;
@@ -338,7 +338,7 @@ static int sdl_init_out (HWVoiceOut *hw, struct audsettings *as)SDLVoiceOut *sdl = (SDLVoiceOut *) hw;SDLAudioState *s = &glob_sdl;SDL_AudioSpec req, obt; -int endianess; +int endianness;int err;audfmt_e effective_fmt;struct audsettings obt_as;
@@ -354,7 +354,7 @@ static int sdl_init_out (HWVoiceOut *hw, struct audsettings *as)return -1 ; } - err =sdl_to_audfmt (obt.format, &effective_fmt, &endianess); + err =sdl_to_audfmt (obt.format, &effective_fmt, &endianness);if (err) {sdl_close (s);return -1 ;
@@ -363,7 +363,7 @@ static int sdl_init_out (HWVoiceOut *hw, struct audsettings *as) obt_as.freq = obt.freq; obt_as.nchannels = obt.channels; obt_as.fmt = effective_fmt; - obt_as.endianness = endianess; + obt_as.endianness = endianness;audio_pcm_init_info (&hw->info, &obt_as); hw->samples = obt.samples;
block/vdi.c +2 -2
@@ -113,7 +113,7 @@ void uuid_unparse(const uuid_t uu, char *out);*/ #define VDI_TEXT "<<< QEMU VM Virtual Disk Image >>>\n" -/* Unallocated blocks use this index (no need to convert endianess). */ +/* Unallocated blocks use this index (no need to convert endianness). */ #define VDI_UNALLOCATED UINT32_MAX#if !defined(CONFIG_UUID )
@@ -194,7 +194,7 @@ typedef struct {uint32_t block_sectors;/* First sector of block map. */ uint32_t bmap_sector; -/* VDI header (converted to host endianess). */ +/* VDI header (converted to host endianness). */ VdiHeader header; } BDRVVdiState;
hw/xilinx_ethlite.c +1 -1
@@ -186,7 +186,7 @@ static ssize_t eth_rx(VLANClientState *nc, const uint8_t *buf, size_t size)D (qemu_log ("%s %d rxbase=%x\n" , __func__, size, rxbase));memcpy (&s->regs[rxbase +R_RX_BUF0 ], buf, size); -/* Bring it into host endianess. */ +/* Bring it into host endianness. */ for (i =0 ; i < ((size +3 ) /4 ); i++) {uint32_t d = s->regs[rxbase +R_RX_BUF0 + i]; s->regs[rxbase +R_RX_BUF0 + i] =be32_to_cpu (d);
target-mips/cpu.h +1 -1
@@ -63,7 +63,7 @@ union fpr_t {uint32_t w[2 ];/* binary single fixed-point */ };/* define FP_ENDIAN_IDX to access the same location -* in the fpr_t union regardless of the host endianess +* in the fpr_t union regardless of the host endianness */ #if defined(HOST_WORDS_BIGENDIAN )# define FP_ENDIAN_IDX 1
usb-bsd.c +1 -1
@@ -457,7 +457,7 @@ static int usb_host_scan(void *opaque, USBScanFunc *func)printf ("usb_host_scan: couldn't get device information for %s - %s\n" , devbuf,strerror (errno)); -// XXX: might need to fixup endianess of word values before copying over +// XXX: might need to fixup endianness of word values before copying over vendor_id = dev_info.udi_vendorNo; product_id = dev_info.udi_productNo;
Signature · 1 line
1.7.2.3
Am 07.01.2011 21:29, schrieb Stefan Weil:
Quoted 151 lines
Replace endianess -> endianness.
Signed-off-by Stefan Weil <[email protected]>---
audio/sdlaudio.c| 20 ++++++++++----------block/vdi.c| 4 ++--hw/xilinx_ethlite.c| 2 +-target-mips/cpu.h| 2 +-usb-bsd.c| 2 +-5 files changed, 15 insertions(+), 15 deletions(-)audio/sdlaudio.c +1
-1@@ -139,36 +139,36 @@ static int aud_to_sdlfmt (audfmt_e fmt) } } -static int sdl_to_audfmt (int sdlfmt,audfmt_e *fmt,int *endianess) +static int sdl_to_audfmt (int sdlfmt,audfmt_e *fmt,int *endianness) {switch (sdlfmt) {case
AUDIO_S8:
- *endianess = 0;
+ *endianness = 0;
*fmt =AUD_FMT_S8;
break;case
AUDIO_U8:
- *endianess = 0;
+ *endianness = 0;
*fmt =AUD_FMT_U8;
break;case
AUDIO_S16LSB:
- *endianess = 0;
+ *endianness = 0;
*fmt =AUD_FMT_S16;
break;case
AUDIO_U16LSB:
- *endianess = 0;
+ *endianness = 0;
*fmt =AUD_FMT_U16;
break;case
AUDIO_S16MSB:
- *endianess = 1;
+ *endianness = 1;
*fmt =AUD_FMT_S16;
break;case
AUDIO_U16MSB:
- *endianess = 1;
+ *endianness = 1;
*fmt =AUD_FMT_U16;
break;audio/sdlaudio.c +1
-1@@ -338,7 +338,7 @@ static int sdl_init_out (HWVoiceOut *hw, struct audsettings *as) SDLVoiceOut *sdl = (SDLVoiceOut *) hw;SDLAudioState *s = &glob_sdl;SDL_AudioSpec req, obt; -int endianess; +int endianness;int err;audfmt_e effective_fmt;struct audsettings
obt_as;audio/sdlaudio.c +1
-1@@ -354,7 +354,7 @@ static int sdl_init_out (HWVoiceOut *hw, struct audsettings *as)return -1 ; } - err =sdl_to_audfmt (obt.format, &effective_fmt, &endianess); + err =sdl_to_audfmt (obt.format, &effective_fmt, &endianness);if (err) {sdl_close (s);return -1;
audio/sdlaudio.c +1
-1@@ -363,7 +363,7 @@ static int sdl_init_out (HWVoiceOut *hw, struct audsettings *as) obt_as.freq = obt.freq; obt_as.nchannels = obt.channels; obt_as.fmt = effective_fmt; - obt_as.endianness = endianess; + obt_as.endianness = endianness;audio_pcm_init_info (&hw->info, &obt_as);
hw->samples= obt.samples;block/vdi.c +2
-2@@ -113,7 +113,7 @@ void uuid_unparse(const uuid_t uu, char *out);*/ #define VDI_TEXT "<<< QEMU VM Virtual Disk Image >>>\n" -/* Unallocated blocks use this index (no need to convert endianess). */ +/* Unallocated blocks use this index (no need to convert endianness). */ #define VDI_UNALLOCATED UINT32_MAX#if !defined(CONFIG_UUID )@@ -194,7 +194,7 @@ typedef struct {uint32_t block_sectors;/* First sector of block map. */ uint32_t bmap_sector; -/* VDI header (converted to host endianess). */ +/* VDI header (converted to host endianness). */ VdiHeader header; } BDRVVdiState;hw/xilinx_ethlite.c +1
-1@@ -186,7 +186,7 @@ static ssize_t eth_rx(VLANClientState *nc, const uint8_t *buf, size_t size) D(qemu_log("%s %d rxbase=%x\n", __func__, size, rxbase));memcpy (&s->regs[rxbase +R_RX_BUF0 ], buf, size); -/* Bring it into host endianess. */ +/* Bring it into host endianness. */ for (i =0 ; i < ((size +3 ) /4 ); i++) {uint32_t d = s->regs[rxbase +R_RX_BUF0 + i];s->regs[rxbase +
R_RX_BUF0+ i] =be32_to_cpu(d);target-mips/cpu.h +0
-0@@ -63,7 +63,7 @@ union fpr_t {
uint32_tw[2]; /* binary single fixed-point */ };
/* defineFP_ENDIAN_IDXto access the same location
- * in thefpr_tunion regardless of the host endianess
+ * in thefpr_tunion regardless of the host endianness */
#ifdefined(HOST_WORDS_BIGENDIAN)# define FP_ENDIAN_IDX 1usb-bsd.c +1
-1@@ -457,7 +457,7 @@ static int usb_host_scan(void *opaque, USBScanFunc *func)printf ("usb_host_scan: couldn't get device information for %s - %s\n" , devbuf,strerror (errno)); -// XXX: might need to fixup endianess of word values before copying over +// XXX: might need to fixup endianness of word values before copying over
Quoted 2 lines
vendor_id= dev_info.udi_vendorNo;product_id= dev_info.udi_productNo;
I'm afraid that my patch got lost because it changes files which are maintained by different people.
Is it possible to apply trivial patches like this one as one patch, or is it necessary to split it into several trivial patches (which increases entropy)?
The patch needs an update, because endianess increased since it was posted, so I'll send a new version.
Regards,
Stefan Weil
PATCH 1/1 Fix trivial "endianness bugs"
Replace endianess -> endianness.
--- audio/sdlaudio.c | 20 ++++++++++---------- block/vdi.c | 4 ++-- hw/xilinx_ethlite.c | 2 +- target-microblaze/translate.c | 2 +- target-mips/cpu.h | 2 +- usb-bsd.c | 2 +- 6 files changed, 16 insertions(+), 16 deletions(-)
audio/sdlaudio.c +10 -10
@@ -139,36 +139,36 @@ static int aud_to_sdlfmt (audfmt_e fmt) } } -static int sdl_to_audfmt (int sdlfmt,audfmt_e *fmt,int *endianess) +static int sdl_to_audfmt (int sdlfmt,audfmt_e *fmt,int *endianness) {switch (sdlfmt) {case AUDIO_S8 : - *endianess =0 ; + *endianness =0 ; *fmt =AUD_FMT_S8 ;break ;case AUDIO_U8 : - *endianess =0 ; + *endianness =0 ; *fmt =AUD_FMT_U8 ;break ;case AUDIO_S16LSB : - *endianess =0 ; + *endianness =0 ; *fmt =AUD_FMT_S16 ;break ;case AUDIO_U16LSB : - *endianess =0 ; + *endianness =0 ; *fmt =AUD_FMT_U16 ;break ;case AUDIO_S16MSB : - *endianess =1 ; + *endianness =1 ; *fmt =AUD_FMT_S16 ;break ;case AUDIO_U16MSB : - *endianess =1 ; + *endianness =1 ; *fmt =AUD_FMT_U16 ;break ;
@@ -338,7 +338,7 @@ static int sdl_init_out (HWVoiceOut *hw, struct audsettings *as)SDLVoiceOut *sdl = (SDLVoiceOut *) hw;SDLAudioState *s = &glob_sdl;SDL_AudioSpec req, obt; -int endianess; +int endianness;int err;audfmt_e effective_fmt;struct audsettings obt_as;
@@ -354,7 +354,7 @@ static int sdl_init_out (HWVoiceOut *hw, struct audsettings *as)return -1 ; } - err =sdl_to_audfmt (obt.format, &effective_fmt, &endianess); + err =sdl_to_audfmt (obt.format, &effective_fmt, &endianness);if (err) {sdl_close (s);return -1 ;
@@ -363,7 +363,7 @@ static int sdl_init_out (HWVoiceOut *hw, struct audsettings *as) obt_as.freq = obt.freq; obt_as.nchannels = obt.channels; obt_as.fmt = effective_fmt; - obt_as.endianness = endianess; + obt_as.endianness = endianness;audio_pcm_init_info (&hw->info, &obt_as); hw->samples = obt.samples;
block/vdi.c +2 -2
@@ -113,7 +113,7 @@ void uuid_unparse(const uuid_t uu, char *out);*/ #define VDI_TEXT "<<< QEMU VM Virtual Disk Image >>>\n" -/* Unallocated blocks use this index (no need to convert endianess). */ +/* Unallocated blocks use this index (no need to convert endianness). */ #define VDI_UNALLOCATED UINT32_MAX#if !defined(CONFIG_UUID )
@@ -194,7 +194,7 @@ typedef struct {uint32_t block_sectors;/* First sector of block map. */ uint32_t bmap_sector; -/* VDI header (converted to host endianess). */ +/* VDI header (converted to host endianness). */ VdiHeader header; } BDRVVdiState;
hw/xilinx_ethlite.c +1 -1
@@ -186,7 +186,7 @@ static ssize_t eth_rx(VLANClientState *nc, const uint8_t *buf, size_t size)D (qemu_log ("%s %d rxbase=%x\n" , __func__, size, rxbase));memcpy (&s->regs[rxbase +R_RX_BUF0 ], buf, size); -/* Bring it into host endianess. */ +/* Bring it into host endianness. */ for (i =0 ; i < ((size +3 ) /4 ); i++) {uint32_t d = s->regs[rxbase +R_RX_BUF0 + i]; s->regs[rxbase +R_RX_BUF0 + i] =be32_to_cpu (d);
target-microblaze/translate.c +1 -1
@@ -923,7 +923,7 @@ static void dec_load(DisasContext *dc)/* * When doing reverse accesses we need to do two things. * -* 1. Reverse the address wrt endianess. +* 1. Reverse the address wrt endianness. * 2. Byteswap the data lanes on the way back into the CPU core. */ if (rev && size !=4 ) {
target-mips/cpu.h +1 -1
@@ -63,7 +63,7 @@ union fpr_t {uint32_t w[2 ];/* binary single fixed-point */ };/* define FP_ENDIAN_IDX to access the same location -* in the fpr_t union regardless of the host endianess +* in the fpr_t union regardless of the host endianness */ #if defined(HOST_WORDS_BIGENDIAN )# define FP_ENDIAN_IDX 1
usb-bsd.c +1 -1
@@ -464,7 +464,7 @@ static int usb_host_scan(void *opaque, USBScanFunc *func)printf ("usb_host_scan: couldn't get device information for %s - %s\n" , devbuf,strerror (errno)); -// XXX: might need to fixup endianess of word values before copying over +// XXX: might need to fixup endianness of word values before copying over vendor_id = dev_info.udi_vendorNo; product_id = dev_info.udi_productNo;
Signature · 1 line
1.7.2.3
Am 24.01.2011 19:04, schrieb Stefan Weil:
Quoted 154 lines
Replace endianess -> endianness.
Signed-off-by Stefan Weil<[email protected]>--- audio/sdlaudio.c | 20 ++++++++++---------- block/vdi.c | 4 ++-- hw/xilinx_ethlite.c | 2 +- target-microblaze/translate.c | 2 +- target-mips/cpu.h | 2 +- usb-bsd.c | 2 +- 6 files changed, 16 insertions(+), 16 deletions(-)audio/sdlaudio.c +10
-10@@ -139,36 +139,36 @@ static int aud_to_sdlfmt (audfmt_e fmt) } } -static int sdl_to_audfmt (int sdlfmt,audfmt_e *fmt,int *endianess) +static int sdl_to_audfmt (int sdlfmt,audfmt_e *fmt,int *endianness) {switch (sdlfmt) {case AUDIO_S8 : - *endianess =0 ; + *endianness =0 ; *fmt =AUD_FMT_S8 ;break ;case AUDIO_U8 : - *endianess =0 ; + *endianness =0 ; *fmt =AUD_FMT_U8 ;break ;case AUDIO_S16LSB : - *endianess =0 ; + *endianness =0 ; *fmt =AUD_FMT_S16 ;break ;case AUDIO_U16LSB : - *endianess =0 ; + *endianness =0 ; *fmt =AUD_FMT_U16 ;break ;case AUDIO_S16MSB : - *endianess =1 ; + *endianness =1 ; *fmt =AUD_FMT_S16 ;break ;case AUDIO_U16MSB : - *endianess =1 ; + *endianness =1 ; *fmt =AUD_FMT_U16 ;break ;@@ -338,7 +338,7 @@ static int sdl_init_out (HWVoiceOut *hw, struct audsettings *as)SDLVoiceOut *sdl = (SDLVoiceOut *) hw;SDLAudioState *s =&glob_sdl;SDL_AudioSpec req, obt; -int endianess; +int endianness;int err;audfmt_e effective_fmt;struct audsettings obt_as;@@ -354,7 +354,7 @@ static int sdl_init_out (HWVoiceOut *hw, struct audsettings *as)return -1 ; } - err =sdl_to_audfmt (obt.format,&effective_fmt,&endianess); + err =sdl_to_audfmt (obt.format,&effective_fmt,&endianness);if (err) {sdl_close (s);return -1 ;@@ -363,7 +363,7 @@ static int sdl_init_out (HWVoiceOut *hw, struct audsettings *as) obt_as.freq = obt.freq; obt_as.nchannels = obt.channels; obt_as.fmt = effective_fmt; - obt_as.endianness = endianess; + obt_as.endianness = endianness;audio_pcm_init_info (&hw->info,&obt_as); hw->samples = obt.samples;block/vdi.c +2
-2@@ -113,7 +113,7 @@ void uuid_unparse(const uuid_t uu, char *out);*/ #define VDI_TEXT "<<< QEMU VM Virtual Disk Image>>>\n" -/* Unallocated blocks use this index (no need to convert endianess). */ +/* Unallocated blocks use this index (no need to convert endianness). */ #define VDI_UNALLOCATED UINT32_MAX#if !defined(CONFIG_UUID )@@ -194,7 +194,7 @@ typedef struct {uint32_t block_sectors;/* First sector of block map. */ uint32_t bmap_sector; -/* VDI header (converted to host endianess). */ +/* VDI header (converted to host endianness). */ VdiHeader header; } BDRVVdiState;hw/xilinx_ethlite.c +1
-1@@ -186,7 +186,7 @@ static ssize_t eth_rx(VLANClientState *nc, const uint8_t *buf, size_t size)D (qemu_log ("%s %d rxbase=%x\n" , __func__, size, rxbase));memcpy (&s->regs[rxbase +R_RX_BUF0 ], buf, size); -/* Bring it into host endianess. */ +/* Bring it into host endianness. */ for (i =0 ; i< ((size +3 ) /4 ); i++) {uint32_t d = s->regs[rxbase +R_RX_BUF0 + i]; s->regs[rxbase +R_RX_BUF0 + i] =be32_to_cpu (d);target-microblaze/translate.c +1
-1@@ -923,7 +923,7 @@ static void dec_load(DisasContext *dc)/* * When doing reverse accesses we need to do two things. * -* 1. Reverse the address wrt endianess. +* 1. Reverse the address wrt endianness. * 2. Byteswap the data lanes on the way back into the CPU core. */ if (rev&& size !=4 ) {target-mips/cpu.h +1
-1@@ -63,7 +63,7 @@ union fpr_t {uint32_t w[2 ];/* binary single fixed-point */ };/* define FP_ENDIAN_IDX to access the same location -* in the fpr_t union regardless of the host endianess +* in the fpr_t union regardless of the host endianness */ #if defined(HOST_WORDS_BIGENDIAN )# define FP_ENDIAN_IDX 1usb-bsd.c +0
-0
usb-bsd.c static int usb_host_scan(void *opaque, USBScanFunc *func) · line 470
Quoted 8 lines
usb-bsd.c +1
-1@@ -464,7 +464,7 @@ static int usb_host_scan(void *opaque, USBScanFunc *func)printf ("usb_host_scan: couldn't get device information for %s - %s\n" , devbuf,strerror (errno)); -// XXX: might need to fixup endianess of word values before copying over +// XXX: might need to fixup endianness of word values before copying over vendor_id = dev_info.udi_vendorNo; product_id = dev_info.udi_productNo;
Ping? There were neither comments nor a commit to qemu master.
Regards,
Stefan Weil