Re: [dwm] more consistent codestyle patch

From: Szabolcs Nagy <nszabolcs_AT_gmail.com>
Date: Tue, 13 May 2008 18:08:59 +0200

On 5/13/08, Diego Biurrun <diego_AT_biurrun.de> wrote:
> > XGrabButton(dpy, AnyButton, AnyModifier, c->win, False,
> > - BUTTONMASK, GrabModeAsync, GrabModeSync, None, None);
> > + BUTTONMASK, GrabModeAsync, GrabModeSync, None, None);
>
> Well, before it was indented to align with the XGrabButton call. This

used spaces to achieve this which is wrong

> was consistently done in at least a few places and makes the code more
> readable.

no (it was consistently tab only indenting in most places)

> > 4) no extra indentation if the conditional expression of a statement
> wraps:
> > if(XGrabPointer(dpy, root, False, MOUSEMASK, GrabModeAsync,
> GrabModeAsync,
> > - None, cursor[CurResize], CurrentTime) != GrabSuccess)
> > + None, cursor[CurResize], CurrentTime) != GrabSuccess)
>
> Same here, it was aligned to make it clear what expression the next line

that was accidental since it was tab indented (and thus there is no
way to guarantee that the second line starts right under '(')

if you look through the code then you see every other if wrap used this style
(maybe it's uglier but then much more code should have been modified
to make it consistent)

> Putting this at the same indentation depth as the if indicates that it
> is a new block after the if. Contrary to what your indentation
> indicates, this is not the case.

no, it indicates that it belongs to the if statement (as in every
other places in the code where this situation occures)

1 tab indentation would mean that the second line is part of the code
block after the if, so the only possible style i can agree with is
either 0 tab or 2 tabs (3 is too much and space indentation is not
consistent with other parts of the code)

> I think you have misunderstood the rules the code was following.

that can be true
Received on Tue May 13 2008 - 18:09:02 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:39:03 UTC