On 03.03.2011 17:33, Philip Martin wrote: > Greg Stein <gst...@gmail.com> writes: > >> On Thu, Mar 3, 2011 at 10:35, Hyrum K Wright <hy...@hyrumwright.org> wrote: >>> On Thu, Mar 3, 2011 at 9:03 AM, <phi...@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