Add missing static specifiers

Maxim Dounin mdounin at mdounin.ru
Thu Mar 2 13:36:45 UTC 2017


Hello!

On Thu, Mar 02, 2017 at 07:15:25AM +0000, Eran Kornblau wrote:

[...]

> > > diff -r 8b7fd958c59f -r 050f8b3c3c67 src/event/ngx_event.c
> > > --- a/src/event/ngx_event.c	Mon Feb 27 22:36:15 2017 +0300
> > > +++ b/src/event/ngx_event.c	Tue Feb 28 16:06:25 2017 -0500
> > > @@ -59,19 +59,19 @@
> > >  
> > >  #if (NGX_STAT_STUB)
> > >  
> > > -ngx_atomic_t   ngx_stat_accepted0;
> > > +static ngx_atomic_t   ngx_stat_accepted0;
> > >  ngx_atomic_t  *ngx_stat_accepted = &ngx_stat_accepted0;
> > > -ngx_atomic_t   ngx_stat_handled0;
> > > +static ngx_atomic_t   ngx_stat_handled0;
> > >  ngx_atomic_t  *ngx_stat_handled = &ngx_stat_handled0;
> > > -ngx_atomic_t   ngx_stat_requests0;
> > > +static ngx_atomic_t   ngx_stat_requests0;
> > >  ngx_atomic_t  *ngx_stat_requests = &ngx_stat_requests0;
> > > -ngx_atomic_t   ngx_stat_active0;
> > > +static ngx_atomic_t   ngx_stat_active0;
> > >  ngx_atomic_t  *ngx_stat_active = &ngx_stat_active0;
> > > -ngx_atomic_t   ngx_stat_reading0;
> > > +static ngx_atomic_t   ngx_stat_reading0;
> > >  ngx_atomic_t  *ngx_stat_reading = &ngx_stat_reading0;
> > > -ngx_atomic_t   ngx_stat_writing0;
> > > +static ngx_atomic_t   ngx_stat_writing0;
> > >  ngx_atomic_t  *ngx_stat_writing = &ngx_stat_writing0;
> > > -ngx_atomic_t   ngx_stat_waiting0;
> > > +static ngx_atomic_t   ngx_stat_waiting0;
> > >  ngx_atomic_t  *ngx_stat_waiting = &ngx_stat_waiting0;
> > 
> > This certainly needs additional changes to match style.  Variable names in a single block are expected to be lined up.
> > 
> Fixed, separated the ints and pointers into two blocks (that made more sense to me than aligning them on a single block)

Doesn't looks like a good solution to me.  Rather, I would indent 
pointer names to the appropriate position, much like it is already 
done slightly above in the same file:

static ngx_atomic_t   connection_counter = 1;
ngx_atomic_t         *ngx_connection_counter = &connection_counter;

-- 
Maxim Dounin
http://nginx.org/


More information about the nginx-devel mailing list