Re: [PATCH v2 06/27] update_refs(): Fix constness

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 03/31/2014 11:40 PM, Junio C Hamano wrote:
> Michael Haggerty <mhagger@xxxxxxxxxxxx> writes:
> 
>> Since full const correctness is beyond the ability of C's type system,
>> just put the const where it doesn't do any harm.  A (struct ref_update
>> **) can be passed to a (struct ref_update * const *) argument, but not
>> to a (const struct ref_update **) argument.
> 
> Sounds good, but next time please try not to break lines inside a
> single typename, which is somewhat unreadable ;-)
> 
> I'd suggest rewording "s/Fix/tighten/".  Because a patch that
> changes constness can loosen constness to make things more correct,
> "git shortlog" output that says if it is tightening or loosening
> would be more informative than the one that says that it is "fixing".

It is not a strict tightening, because I add a "const" in one place but
remove it from another:

    const struct ref_update **

becomes

    struct ref_update * const *

in the update_refs() signature.  In fact, the old declaration was too
strict for some changes later in the patch series, which is why I needed
to loosen (one aspect) of it.

Michael

-- 
Michael Haggerty
mhagger@xxxxxxxxxxxx
http://softwareswirl.blogspot.com/
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]