From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeff Garzik Subject: Re: [PATCH hail] const-correctness tweaks Date: Thu, 07 Oct 2010 02:00:43 -0400 Message-ID: <4CAD620B.80705@garzik.org> References: <87mxqro78a.fsf@meyering.net> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=VShZk3JBJnfyw/KElEHSvdzLSpGDlxuXOUFV+CGjEb8=; b=TxSdMC4hdVj3ubqAJgiHk5/V4mTK2V7y+q7dmElTd0mOVszgbX6LHR+eZcBF6SN7oD bYulTSk6EOBzZmAiBjbeiHkH7ggWmcyOCXg9a00fEGQW42Wjy0V01B7crHeRoTUurCL4 Y8eq3Z+lRK0RiVBb5R8FvD33Yhrv+vCs/lXTk= In-Reply-To: <87mxqro78a.fsf@meyering.net> Sender: hail-devel-owner@vger.kernel.org List-ID: Content-Type: text/plain; charset="us-ascii"; format="flowed" To: Jim Meyering Cc: Project Hail 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 > --- > > 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?