[sheepdog] [PATCH RFC] employ gnu99 style of GCC
Hitoshi Mitake
mitake.hitoshi at gmail.com
Mon Apr 29 16:25:19 CEST 2013
At Mon, 29 Apr 2013 22:26:30 +0900,
Hitoshi Mitake wrote:
>
> At Mon, 29 Apr 2013 20:48:47 +0800,
> Liu Yuan wrote:
> >
> > On 04/29/2013 08:38 PM, Hitoshi Mitake wrote:
> > > Of course I don't say variable declarations is the most important
> > > problem for source code readability. Its role is very little. But I
> > > strongly believe that variables with narrow scope can contribute to
> > > the readability. e.g. If we write a variable used as an index in an
> > > initializatoin part of for statement like this: for (int i = 0; ...),
> > > we can forget about the variable when we are focusing on the outside
> > > of the loop.
> > >
> >
> > for (int i = 0; ...) might looks a nice candy but seems your RFC romove
> > 'RB_ROOT', which is very handy macro. I take this as a price to pay.
>
> Removing the RB_ROOT was overkill. This is my mistake. It can be
> implemented like this under gnu99:
> #define RB_ROOT { NULL }
>
Oops, sorry. The above macro doesn't work well with the line like this:
cache->lru_tree = RB_ROOT;
# 594 of object_cache.c
I think these sort of initialization should be done with a macro like
INIT_LIST_HEAD(). Is it okay to implement INIT_RB_ROOT()?
Thanks,
Hitoshi
More information about the sheepdog
mailing list