[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r1057088 - in /subversion/trunk/subversion: libsvn_fs_base/bdb/env.c libsvn_ra_svn/cyrus_auth.c libsvn_subr/io.c libsvn_subr/sqlite.c

From: Daniel Shahaf <d.s_at_daniel.shahaf.name>
Date: Wed, 12 Jan 2011 16:12:36 +0200

Philip Martin wrote on Wed, Jan 12, 2011 at 11:01:12 +0000:
> danielsh_at_apache.org writes:
>
> > Author: danielsh
> > Date: Mon Jan 10 06:03:30 2011
> > New Revision: 1057088
> >
> > URL: http://svn.apache.org/viewvc?rev=1057088&view=rev
> > Log:
> > Initialize svn_atomic_t's to zero, per svn_atomic__init_once().
>
> That is redundant, strict speaking, because static variables are
> initialised to zero if not explicitly initialised to something else.
>

I didn't remember that.

I don't mind to revert the change if people are comfortable with our
coding style relying on remembering which kinds of variables C does or
doesn't initialize to zero when they're not explicitly initialized...
(i.e., defensive coding)

> > Modified: subversion/trunk/subversion/libsvn_ra_svn/cyrus_auth.c
> > URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_svn/cyrus_auth.c?rev=1057088&r1=1057087&r2=1057088&view=diff
> > ==============================================================================
> > --- subversion/trunk/subversion/libsvn_ra_svn/cyrus_auth.c (original)
> > +++ subversion/trunk/subversion/libsvn_ra_svn/cyrus_auth.c Mon Jan 10 06:03:30 2011
> > @@ -54,8 +54,9 @@
> > * in atexit processing, at which point we are already running in
> > * single threaded mode.
> > */
> > -volatile svn_atomic_t svn_ra_svn__sasl_status;
> > +volatile svn_atomic_t svn_ra_svn__sasl_status = 0;
>
> That is a static variable, explicitly marking it static might be more
> useful than explicitly marking it 0.
>

Actually, it's called from svnserve's cyrus_init().

Feel free to go ahead and make any change you like --- I made
a horizontal change and I don't claim to be expertly familiar with each
of the variables I touched.

> >
> > +/* Initialized by svn_ra_svn__sasl_common_init(). */
> > static volatile svn_atomic_t sasl_ctx_count;
>
> That comment is wrong, sasl_ctx_count is static and so is initialised to
> 0.
>

Well, s/Initialized/Set to non-zero/ then? You know what I meant,
right? :)

>
> --
> Philip
Received on 2011-01-12 15:16:29 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.