* [Qemu-devel] [PATCH RESEND(REBASED)] Fix trivial "endianness bugs"
@ 2011-03-13 14:44 Stefan Weil
2011-04-01 20:27 ` Aurelien Jarno
2011-04-03 19:46 ` Aurelien Jarno
0 siblings, 2 replies; 5+ messages in thread
From: Stefan Weil @ 2011-03-13 14:44 UTC (permalink / raw)
To: Anthony Liguori; +Cc: qemu-devel
Replace endianess -> endianness.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
---
audio/sdlaudio.c | 20 ++++++++++----------
block/vdi.c | 4 ++--
target-microblaze/translate.c | 2 +-
target-mips/cpu.h | 2 +-
usb-bsd.c | 2 +-
5 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/audio/sdlaudio.c b/audio/sdlaudio.c
index b74dcfa..04fb9f4 100644
--- a/audio/sdlaudio.c
+++ b/audio/sdlaudio.c
@@ -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;
diff --git a/block/vdi.c b/block/vdi.c
index 116b25b..083266e 100644
--- a/block/vdi.c
+++ b/block/vdi.c
@@ -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;
diff --git a/target-microblaze/translate.c b/target-microblaze/translate.c
index fdb2b40..b54b169 100644
--- a/target-microblaze/translate.c
+++ b/target-microblaze/translate.c
@@ -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) {
diff --git a/target-mips/cpu.h b/target-mips/cpu.h
index 2419aa9..0b98d10 100644
--- a/target-mips/cpu.h
+++ b/target-mips/cpu.h
@@ -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
diff --git a/usb-bsd.c b/usb-bsd.c
index abcb60c..e561e1f 100644
--- a/usb-bsd.c
+++ b/usb-bsd.c
@@ -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;
--
1.7.2.3
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH RESEND(REBASED)] Fix trivial "endianness bugs"
2011-03-13 14:44 [Qemu-devel] [PATCH RESEND(REBASED)] Fix trivial "endianness bugs" Stefan Weil
@ 2011-04-01 20:27 ` Aurelien Jarno
2011-04-01 20:51 ` Stefan Weil
2011-04-01 22:52 ` Peter Maydell
2011-04-03 19:46 ` Aurelien Jarno
1 sibling, 2 replies; 5+ messages in thread
From: Aurelien Jarno @ 2011-04-01 20:27 UTC (permalink / raw)
To: Stefan Weil; +Cc: Anthony Liguori, qemu-devel
On Sun, Mar 13, 2011 at 03:44:02PM +0100, Stefan Weil wrote:
> Replace endianess -> endianness.
Given it concerns code and not comments, I am reluctant for this kind of
patches unless we have a very good reason.
Do you have some pointers about "endianness" being the correct wording?
It seems both are accepted, even if in the last years people seems to
use more often "endianness" than "endianess".
Maybe a native speaker can help us here.
> Signed-off-by: Stefan Weil <weil@mail.berlios.de>
> ---
> audio/sdlaudio.c | 20 ++++++++++----------
> block/vdi.c | 4 ++--
> target-microblaze/translate.c | 2 +-
> target-mips/cpu.h | 2 +-
> usb-bsd.c | 2 +-
> 5 files changed, 15 insertions(+), 15 deletions(-)
>
> diff --git a/audio/sdlaudio.c b/audio/sdlaudio.c
> index b74dcfa..04fb9f4 100644
> --- a/audio/sdlaudio.c
> +++ b/audio/sdlaudio.c
> @@ -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;
> diff --git a/block/vdi.c b/block/vdi.c
> index 116b25b..083266e 100644
> --- a/block/vdi.c
> +++ b/block/vdi.c
> @@ -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;
>
> diff --git a/target-microblaze/translate.c b/target-microblaze/translate.c
> index fdb2b40..b54b169 100644
> --- a/target-microblaze/translate.c
> +++ b/target-microblaze/translate.c
> @@ -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) {
> diff --git a/target-mips/cpu.h b/target-mips/cpu.h
> index 2419aa9..0b98d10 100644
> --- a/target-mips/cpu.h
> +++ b/target-mips/cpu.h
> @@ -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
> diff --git a/usb-bsd.c b/usb-bsd.c
> index abcb60c..e561e1f 100644
> --- a/usb-bsd.c
> +++ b/usb-bsd.c
> @@ -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;
> --
> 1.7.2.3
>
>
>
--
Aurelien Jarno GPG: 1024D/F1BCDB73
aurelien@aurel32.net http://www.aurel32.net
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH RESEND(REBASED)] Fix trivial "endianness bugs"
2011-04-01 20:27 ` Aurelien Jarno
@ 2011-04-01 20:51 ` Stefan Weil
2011-04-01 22:52 ` Peter Maydell
1 sibling, 0 replies; 5+ messages in thread
From: Stefan Weil @ 2011-04-01 20:51 UTC (permalink / raw)
To: Aurelien Jarno; +Cc: Anthony Liguori, qemu-devel
Am 01.04.2011 22:27, schrieb Aurelien Jarno:
> On Sun, Mar 13, 2011 at 03:44:02PM +0100, Stefan Weil wrote:
>> Replace endianess -> endianness.
>
> Given it concerns code and not comments, I am reluctant for this kind of
> patches unless we have a very good reason.
>
> Do you have some pointers about "endianness" being the correct wording?
> It seems both are accepted, even if in the last years people seems to
> use more often "endianness" than "endianess".
>
> Maybe a native speaker can help us here.
>
Hello Aurelien,
I'm not a native speaker, but I like having well written examples
which help me avoiding mistakes (some of the wrong spellings
were written by me) and improving my knowledge of English.
Therefore I also modified code.
It was a formal replace operation using perl -pi -e,
so this should be rather safe.
Here are some links (other than google which also refers to
endianness):
http://de.wikipedia.org/wiki/Endianess (Falschschreibung = wrong spelling)
http://fr.wikipedia.org/wiki/Endianess (redirected to Endianness)
http://en.wikipedia.org/wiki/Endianess (redirected to Endianness)
This article uses both variants (which obviously is a bug).
Oxford dictionary (like others) does not know any endianness,
but refers to indianness which is a similar composition of
a word ending with "n" followed by "ness".
Regards,
Stefan
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH RESEND(REBASED)] Fix trivial "endianness bugs"
2011-04-01 20:27 ` Aurelien Jarno
2011-04-01 20:51 ` Stefan Weil
@ 2011-04-01 22:52 ` Peter Maydell
1 sibling, 0 replies; 5+ messages in thread
From: Peter Maydell @ 2011-04-01 22:52 UTC (permalink / raw)
To: Aurelien Jarno; +Cc: Anthony Liguori, qemu-devel
On 1 April 2011 21:27, Aurelien Jarno <aurelien@aurel32.net> wrote:
> On Sun, Mar 13, 2011 at 03:44:02PM +0100, Stefan Weil wrote:
>> Replace endianess -> endianness.
>
> Given it concerns code and not comments, I am reluctant for this kind of
> patches unless we have a very good reason.
>
> Do you have some pointers about "endianness" being the correct wording?
> It seems both are accepted, even if in the last years people seems to
> use more often "endianness" than "endianess".
>
> Maybe a native speaker can help us here.
I'm a native speaker, and my reaction was "yes, this is an obvious
typo-correcting patch and we should take it". Note that the only
code changes are in audio/sdlaudio.c (the others are just comments)
and it fixes obvious oddities like:
- obt_as.endianness = endianess;
where the thing on the left is the audio/audio.h structure which
uses the correct spelling and the thing on the right is the misspelt
variable. Even if both were acceptable spellings this file ought to
be consistent with audio.h...
The code changes are straightforward and localised to that file, so
they're pretty safe as cleanups go.
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
-- PMM
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH RESEND(REBASED)] Fix trivial "endianness bugs"
2011-03-13 14:44 [Qemu-devel] [PATCH RESEND(REBASED)] Fix trivial "endianness bugs" Stefan Weil
2011-04-01 20:27 ` Aurelien Jarno
@ 2011-04-03 19:46 ` Aurelien Jarno
1 sibling, 0 replies; 5+ messages in thread
From: Aurelien Jarno @ 2011-04-03 19:46 UTC (permalink / raw)
To: Stefan Weil; +Cc: Anthony Liguori, qemu-devel
On Sun, Mar 13, 2011 at 03:44:02PM +0100, Stefan Weil wrote:
> Replace endianess -> endianness.
>
> Signed-off-by: Stefan Weil <weil@mail.berlios.de>
> ---
> audio/sdlaudio.c | 20 ++++++++++----------
> block/vdi.c | 4 ++--
> target-microblaze/translate.c | 2 +-
> target-mips/cpu.h | 2 +-
> usb-bsd.c | 2 +-
> 5 files changed, 15 insertions(+), 15 deletions(-)
Thanks, applied.
> diff --git a/audio/sdlaudio.c b/audio/sdlaudio.c
> index b74dcfa..04fb9f4 100644
> --- a/audio/sdlaudio.c
> +++ b/audio/sdlaudio.c
> @@ -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;
> diff --git a/block/vdi.c b/block/vdi.c
> index 116b25b..083266e 100644
> --- a/block/vdi.c
> +++ b/block/vdi.c
> @@ -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;
>
> diff --git a/target-microblaze/translate.c b/target-microblaze/translate.c
> index fdb2b40..b54b169 100644
> --- a/target-microblaze/translate.c
> +++ b/target-microblaze/translate.c
> @@ -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) {
> diff --git a/target-mips/cpu.h b/target-mips/cpu.h
> index 2419aa9..0b98d10 100644
> --- a/target-mips/cpu.h
> +++ b/target-mips/cpu.h
> @@ -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
> diff --git a/usb-bsd.c b/usb-bsd.c
> index abcb60c..e561e1f 100644
> --- a/usb-bsd.c
> +++ b/usb-bsd.c
> @@ -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;
> --
> 1.7.2.3
>
>
--
Aurelien Jarno GPG: 1024D/F1BCDB73
aurelien@aurel32.net http://www.aurel32.net
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-04-03 19:46 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-13 14:44 [Qemu-devel] [PATCH RESEND(REBASED)] Fix trivial "endianness bugs" Stefan Weil
2011-04-01 20:27 ` Aurelien Jarno
2011-04-01 20:51 ` Stefan Weil
2011-04-01 22:52 ` Peter Maydell
2011-04-03 19:46 ` Aurelien Jarno
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).