[lvm-devel] const correctness, first cut

Jim Meyering jim at meyering.net
Tue Aug 7 09:11:12 UTC 2007


Alasdair G Kergon <agk at redhat.com> wrote:
> On Mon, Aug 06, 2007 at 05:18:22PM +0200, Jim Meyering wrote:
>> I find it easier to read code that uses "const" whenever possible.
>
> All looks sane, thanks.

Thanks for the review.
I committed that, along with const-adding changes to btree.[ch].

The sole cast I added there (in _lookup) is unavoidable, given
a const-correct interface.  It's analogous to the strstr case,
where the signature forces you to return char*, yet the pointer
you actually return is offset from the "const char *" parameter.




More information about the lvm-devel mailing list