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

Re: PATCH: Remove unnecessary type casts

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: 2004-03-08 03:29:47 CET

Philip Martin wrote:
> Julian Foad <julianfoad@btopenworld.com> writes:
>
>>The data field must be logically constant, else
>>svn_fs__set_dbt would be wrong in accepting a pointer-to-const, and
>>the callers of svn_fs__str_to_dbt would be wrong in supplying constant
>>data.
>>
>>Does that make sense?
>
> I find it odd that the interface doesn't appear to have a "from_dbt"
> function that returns a const pointer.

Er ... if you say so. I'm just looking at it from a syntactic and C-language-semantic point of view. The header (dbt.h) doesn't appear to have been materially altered since Subversion became self-hosting, so perhaps no-one will have recent experience of these functions.

I have now checked all uses within subversion/libsvn_fs/bdb/ of the structure field ("void *data"), and they are all treating it as constant. I have also compiled Subversion with a modified db.h which has "const void *" as the type of that field, and that compiles OK.

I am now satisfied with it, and have committed it as r8924.

- Julian

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Mar 8 03:29:03 2004

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.