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

Re: svn commit: r17273 - in branches/svndiff1/subversion: libsvn_delta mod_dav_svn

From: Philip Martin <philip_at_codematters.co.uk>
Date: 2005-11-10 02:29:43 CET

Daniel Berlin <dberlin@dberlin.org> writes:

>> > Author: dberlin
>> > Date: Wed Nov 9 11:51:14 2005
>> > New Revision: 17273
>>
>> > +static int sort_encoding_pref(const void *accept_rec1, const void
>> *accept_rec2)
>> > +{
>> > + float diff = ((accept_rec *) accept_rec1)->quality -
>> > + ((accept_rec *) accept_rec2)->quality;
>>
>> I cast to (const accept_rec *) to avoid dropping const.
>>
> You know that this can't do anything interesting in C, right, because of
> the rules of whether const matters or not? Sad, but true.

To which rules are you referring? Something to do with modifiable
lvalues perhaps? I know it makes no difference in this particular
case, but casting away const always raises an alarm and gives the
reader (well me anyway) something extra to think about.

> However, it "looks" better, so i'll do it.

That's why I'd do it.

-- 
Philip Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Nov 10 02:30:14 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.