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

Re: svn commit: r16244 - in trunk: . subversion/clients/cmdline subversion/include subversion/libsvn_client subversion/libsvn_wc subversion/svnversion subversion/tests/clients/cmdline subversion/tests/clients/cmdline/svntest tools/examples

From: Philip Martin <philip_at_codematters.co.uk>
Date: 2005-09-25 12:41:52 CEST

brane@tigris.org writes:

> Author: brane
> Date: Sat Sep 24 21:22:00 2005
> New Revision: 16244

> --- trunk/subversion/libsvn_wc/adm_files.c (original)
> +++ trunk/subversion/libsvn_wc/adm_files.c Sat Sep 24 21:22:00 2005
> @@ -24,9 +24,11 @@
>
> #include <stdarg.h>
> #include <assert.h>
> +#include <apr_atomic.h>
> #include <apr_pools.h>
> #include <apr_file_io.h>
> #include <apr_strings.h>
> +
> #include "svn_types.h"
> #include "svn_error.h"
> #include "svn_io.h"
> @@ -43,9 +45,69 @@
>
> /*** File names in the adm area. ***/
>
> +/* The default name of the WC admin directory. This name is always
> + checked by svn_wc_is_adm_dir. */
> +#define DEFAULT_ADM_DIR_NAME ".svn"
> +
> +/* The name that is actually used for the WC admin directory. The
> + commonest case where this won't be the default is in Windows
> + ASP.NET development environments, which choke on ".svn". */
> +static void *volatile adm_dir_name = DEFAULT_ADM_DIR_NAME;

../svn/subversion/libsvn_wc/adm_files.c:55: warning: initialization discards qualifiers from pointer target type

Perhaps 'static const void *volatile ...'

> +
> +
> +svn_boolean_t
> +svn_wc_is_adm_dir (const char *name, apr_pool_t *pool)
> +{
> + (void)pool; /* Silence compiler warnings about unused parameter */
> + return (0 == strcmp (name, adm_dir_name)
> + || 0 == strcmp (name, DEFAULT_ADM_DIR_NAME));
> +}
> +
> +
> +svn_error_t *
> +svn_wc_set_adm_dir (const char *name, apr_pool_t *pool)
> +{
> + /* FIXME:
> + This is the canonical list of administrative directory.
> + An identical list is used in
> + libsvn_subr/opt.c:svn_opt_args_to_target_array2(),
> + but that function can't use this list, because that use would
> + create a circular dependency between libsvn_wc and libsvn_subr
> + Make sure changes to the lists are always synchronized! */
> + static const char *valid_dir_names[] = {
> + DEFAULT_ADM_DIR_NAME,
> + "_svn",
> + NULL
> + };
> +
> + const char **dir_name;
> + for (dir_name = valid_dir_names; *dir_name; ++dir_name)
> + if (0 == strcmp (name, *dir_name))
> + {
> + void *new_adm_dir_name = (void*) *dir_name;
> + void *old_adm_dir_name = adm_dir_name;

Perhaps 'const void *' and lose the cast?

> + if (old_adm_dir_name != apr_atomic_casptr (&adm_dir_name,
> + new_adm_dir_name,
> + old_adm_dir_name))
> + {
> + /* Another thread won the race to change the name. */
> + return svn_error_create
> + (APR_EAGAIN, NULL,
> + _("Could not set the administrative directory name"));
> + }

-- 
Philip Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sun Sep 25 12:42:40 2005

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.