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

Re: Is this bit of code obsolete?

From: Greg Stein <gstein_at_lyra.org>
Date: 2002-04-26 02:38:57 CEST

On Thu, Apr 25, 2002 at 11:13:06PM +0100, Philip Martin wrote:
> I am getting a compiler warning about this code in libsvn_ra_dav/commit.c
>
> /*
> ** singleton_delete_prop:
> **
> ** The address of this integer is used as a "singleton" value to mark
> ** properties which must be deleted. Properties which are changed/added
> ** will use their new values.
> */
> static const int singleton_delete_prop = 0;
> #define DELETE_THIS_PROP (&singleton_delete_prop)
>
> Since neither singleton_delete_prop nor DELETE_THIS_PROP are used in
> the file I propose to delete it. Am I missing something subtle?

It isn't obsolete. It should have been used as the marker in the property
hash to denote props which need to be deleted. When Joe implemented the
props-to-delete while I was away last July, he didn't see that was my
intent, and used an array of props instead.

So... the answer is to drop the array and just store the to-delete props
into the hash using this singleton. When you scan the hash, you just test
whether the pointer equals DELETE_THIS_PROP, thus signifying the prop should
be deleted (rather than mod'd).

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Apr 26 02:38:53 2002

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.