qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] readline: avoid memcpy() of overlapping regions


From: Andreas Färber
Subject: Re: [Qemu-devel] [PATCH] readline: avoid memcpy() of overlapping regions
Date: Fri, 25 Jan 2013 19:30:36 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130105 Thunderbird/17.0.2

Am 25.01.2013 19:07, schrieb Blue Swirl:
> On Thu, Jan 24, 2013 at 5:17 PM, Andreas Färber <address@hidden> wrote:
>> Am 17.01.2013 21:13, schrieb Blue Swirl:
>>> On Mon, Jan 14, 2013 at 9:09 AM, Stefan Hajnoczi <address@hidden> wrote:
>>>> Tell me what you consider the "correct" tab width for readers and I'll
>>>> find a piece of QEMU code that was authored for a different tab width
>>>> :).
>>>
>>> 8.
>>
>> So FWIW one exception is target-cris/helper.c, which seems to use 4. :)
> 
> I don't think so:
>       miss = cris_mmu_translate(&res, env, address & TARGET_PAGE_MASK,
>                                 rw, mmu_idx, 0);
> The first line has one tab (with tab equal to 8 spaces, column 8) and
> the second, four tabs plus two spaces to reach column 34 (4 * 8 + 2)
> so 'rw' is nicely aligned to just after '(' in the first line. If we
> instead assumed a tab size of 4, the first line would have indent of 4
> spaces but the second 4 * 4 + 2 = 10 which would mess the indentation.

There's other lines where it's not nicely aligned at 8 chars and unlike
other files it did not use 4 spaces for one indent and then one tab for
the next. Anyway, patch to fix this is out for Edgar to apply or not to.

http://patchwork.ozlabs.org/patch/215814/

>> My personal opinion is that tabs don't have any fixed width and, when
>> used properly, that works fairly well (i.e., indent the block with tabs
>> and do any parenthesis alignment etc. with blanks from block level).
> 
> If the indentation did not make any assumptions about the tab
> settings, that could actually work. But using the above example, the
> second line should use only one tab and 26 spaces, then both lines
> would be aligned with any tab settings. Does anyone use tabs like
> this?

I did so in earlier times, using Visual Studio, Eclipse or Xcode
configured to show me the whitespace chars. Any automatic reformatting
breaks it though...
But I'm not suggesting QEMU to adopt it. I just disagree on any "tab is
meant to be N chars wide" hypothesis of the day. :)

Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg



reply via email to

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