Re: [PATCH hail] const-correctness tweaks

Jeff Garzik <[email protected]> Thu, 07 Oct 2010 02:00:43 -0400
Newsgroups org.kernel.vger.hail-devel
Message-ID <[email protected]>
On 10/06/2010 08:07 AM, Jim Meyering wrote:
>
> Make write_cb callback's buffer parameter const, like all write-like
> functions.
> Give a few "char *" parameters the "const" attribute.
>
> Signed-off-by: Jim Meyering<[email protected]>
> ---
>
> It looks like most of hail's interfaces are const-correct,
> but one stood out because it provokes a warning when I tried to
> pass a const-correct write_cb function to hstor_get from iwhd:
>
>      proxy.c:382: warning: passing argument 4 of 'hstor_get' from \
>        incompatible pointer type
>      /usr/include/hstor.h:173: note: expected \
>        'size_t (*)(void *, size_t, size_t,  void *)' but argument is of type \
>        'size_t (*)(const void *, size_t,  size_t,  void *)'
>
> In case you feel comfortable fixing this, here's a patch:
>
>
>   include/hstor.h |    4 ++--
>   lib/hstor.c     |    5 +++--
>   lib/hutil.c     |    2 +-
>   3 files changed, 6 insertions(+), 5 deletions(-)

This requires updating test/large-object.c in tabled, too.  Would you 
mind sending along that companion patch?