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

Re: [PATCH] automatic properties

From: Philip Martin <philip_at_codematters.co.uk>
Date: 2003-10-02 14:50:32 CEST

Martin Furter <mf@rola.ch> writes:

> Index: subversion/libsvn_client/commit.c
> ===================================================================
> --- subversion/libsvn_client/commit.c (revision 7267)
> +++ subversion/libsvn_client/commit.c (working copy)

> - SVN_ERR (editor->change_file_prop (file_baton, SVN_PROP_EXECUTABLE,
> - svn_string_create ("", pool),
> - pool));
> -
> + apr_hash_this (hi, (const void **)&propname, NULL,
> + (void **)&propvalue.data);

Don't use casts like this, look at other places that use apr_hash_this
and follow the same method.

> + propvalue.len = strlen (propvalue.data);
> + SVN_ERR (editor->change_file_prop (file_baton, propname,
> + &propvalue, pool));
> + }
> + }
> +
> if (ctx->notify_func)
> (*ctx->notify_func) (ctx->notify_baton,
> path,
> Index: subversion/libsvn_client/add.c
> ===================================================================
> --- subversion/libsvn_client/add.c (revision 7267)
> +++ subversion/libsvn_client/add.c (working copy)

> + if (properties)
> + {
> + /* loop through the hashtable and add the properties */
> + for (hi = apr_hash_first (pool, properties);
> + hi != NULL; hi = apr_hash_next (hi))
> + {
> + char *propname;
> + svn_string_t propvalue;
> +
> + apr_hash_this (hi, (const void **)&propname, NULL,
> + (void **)&propvalue.data);

Casts again. In this case you are effectively casting away const on
the value returned in propname.

> + propvalue.len = strlen (propvalue.data);
> + SVN_ERR (svn_wc_prop_set (propname, &propvalue, path, adm_access,
> + pool));
> + }
> + }
> + /* Report the addition to the caller. */
> + if (ctx->notify_func != NULL)
> + (*ctx->notify_func) (ctx->notify_baton, path, svn_wc_notify_add,
> + svn_node_file,
> + mimetype,
> + svn_wc_notify_state_unknown,
> + svn_wc_notify_state_unknown,
> + SVN_INVALID_REVNUM);
> + return SVN_NO_ERROR;
> +}
> +
> +static svn_error_t *
> add_dir_recursive (const char *dirname,
> svn_wc_adm_access_t *adm_access,
> svn_client_ctx_t *ctx,

-- 
Philip Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Oct 2 14:51:18 2003

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.