qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 2/2] qemu-img: fix some spelling errors


From: 858585 jemmy
Subject: Re: [Qemu-devel] [PATCH 2/2] qemu-img: fix some spelling errors
Date: Tue, 25 Apr 2017 10:10:37 +0800

On Mon, Apr 24, 2017 at 11:53 PM, Eric Blake <address@hidden> wrote:
> On 04/24/2017 10:47 AM, Eric Blake wrote:
>> On 04/24/2017 10:37 AM, Philippe Mathieu-Daudé wrote:
>>
>>>>>  /*
>>>>> - * Returns true iff the first sector pointed to by 'buf' contains at
>>>>> least
>>>>> - * a non-NUL byte.
>>>>> + * Returns true if the first sector pointed to by 'buf' contains at
>>>>> least
>>>>> + * a non-NULL byte.
>>>>
>>>> NACK to both changes.  'iff' is an English word that is shorthand for
>>>> "if and only if".  "NUL" means the one-byte character, while "NULL"
>>>> means the 8-byte (or 4-byte, on 32-bit platform) pointer value.
>>>
>>> I agree with Lidong shorthands are not obvious from non-native speaker.
>>>
>>> What about this?
>>>
>>>  * Returns true if (and only if) the first sector pointed to by 'buf'
>>> contains
>>
>> That might be okay.
>>
>>>  * at least a non-null character.
>>
>> But that still doesn't make sense.  The character name is NUL, and
>> non-NULL refers to something that is a pointer, not a character.
>
> What's more, the NUL character can actually occupy more than one byte
> (think UTF-16, where it is the two-byte 0 value).  Referring to NUL byte
> rather than NUL character (or even the ' byte') makes it obvious
> that this function is NOT encoding-sensitive, and doesn't start
> mis-behaving just because the data picks a multi-byte character encoding.

How about this?

 * Returns true  if (and only if) the first sector pointed to by 'buf'
contains at least
 * a non-zero byte.

Thanks.

>
> --
> Eric Blake, Principal Software Engineer
> Red Hat, Inc.           +1-919-301-3266
> Virtualization:  qemu.org | libvirt.org
>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]