Universal escaping in KConfigINI: Summary and patch
Andreas Hartmetz
ahartmetz at gmail.com
Fri May 25 18:50:31 BST 2007
On Friday 25 May 2007 12:05:14 Oswald Buddenhagen wrote:
> On Fri, May 25, 2007 at 11:28:23AM +0200, Andreas Hartmetz wrote:
> > On Friday 25 May 2007 09:02:26 Oswald Buddenhagen wrote:
> > > buuut ... having the default last is *still* the right thing to do. ;)
> >
> > OK, braindump: IMO "default:" is usually last not because "default:"
> > has to be last, but because it usually handles the error case, which
> > isn't as important to the understanding of the code as the normal
> > case. In this particular case, "default:" handles the normal case so
> > it's first. What-ever.
>
> my braindump goes like this: default as in "everything else". having
> it first is a bit like top-quoting ...
>
> > > > we cannot discuss minor stuff forever
> > >
> > > oh, c'mon ... are you in a hurry? :-D
> >
> > There was this thing... I think it was called release plan :o
> > Yeah, who reads release plans anyway? xD
>
> what is a release plan, anyway? >8-)
>
> > > your patches are made with -b, right?
> >
> > Uh, I had to look up what -b even means ("ignore whitespace changes").
> > My patches are made with "svn diff".
>
> maybe you have it in the .svnrc. i'm asking because you have some
> weirdly indented braces which simply makes no sense unless they are at
> the old positions.
>
I do have a custom svn command that includes -b, which I have removed now.
Oopsie. That was probably copy-pasted from some howto on the internets.
> > > > + escape:
> > > > + *r++ = '\\';
> > >
> > > i unindent goto labels only half an indent step. maybe you find it more
> > > appealing, too. ;)
> >
> > I don't like half-indentions.
>
> too bad. :}
>
> > Goto labels just don't fit in well in C/C++ and I see no good way to
> > change that.
>
> correct. i find the half-indents to be as close to looking good as it
> gets.
>
> > > > + *r++ = nibbleLookup[((unsigned char)s[i]) >> 4];
> > > > + *r = nibbleLookup[((unsigned char)s[i]) & 0x0f];
> > >
> > > you overdid the casting, but readability-wise it is better your way.
> > > it might get even better if you line up the equal sign and change to 15
> > > again. :)
> >
> > Except for very mathematical code, I tend to think that lining up
> > statements makes them look silly.
>
> so do i. i just think it fits in this case. whatever.
>
> > And for bit manipulations I *think* in bits, so I write in bits/hex.
>
> you wouldn't claim that you have to think even a centisecond to
> recognize a 2^n-1 with n<=8, would you? :-P
> and for very small numbers this doesn't matter anyway ... but maybe i'm
> already at the next level. ;)
More information about the kde-core-devel
mailing list