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

Re: svn commit: r1076645 - /subversion/trunk/subversion/libsvn_wc/wc_db.c

From: Branko ─îibej <brane_at_apache.org>
Date: Thu, 03 Mar 2011 17:42:28 +0100

On 03.03.2011 17:33, Philip Martin wrote:
> Greg Stein <gstein_at_gmail.com> writes:
>> On Thu, Mar 3, 2011 at 10:35, Hyrum K Wright <hyrum_at_hyrumwright.org> wrote:
>>> On Thu, Mar 3, 2011 at 9:03 AM, <philip_at_apache.org> wrote:
>>>> Author: philip
>>>> Date: Thu Mar 3 15:03:42 2011
>>>> New Revision: 1076645
>>>> URL: http://svn.apache.org/viewvc?rev=1076645&view=rev
>>>> Log:
>>>> Wrap pointer in a baton to avoid a complier warning or cast.
>>> I think a single cast is better than the obfuscation of wrapping a
>>> single value in a baton. Please reconsider this change.
>> Agreed. I'd much rather see (void *)changelist, than all of this stuff.
> A cast that changes the type, (void *)changelist, or one that just
> removes the qualifier, (char *)changelist?

One that just removes the qualifier, because the subsequent cast to
void* is implicit. Inside the implementation, you can recast directly
back to const char*, since adding a const qualifier is well-defined.

> Casts lead to questions.

Yes, and in some cases, comments answer those questions better than
uncommented single-member structs that also raise questions. "Cast away
const" is not such an obscure thing that it cannot be described in a
single-line comment.

-- Brane
Received on 2011-03-03 17:43:07 CET

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.