Patchwork [4,of,5] cext: fix a warning about differing const qualifiers on Windows

login
register
mail settings
Submitter Matt Harbison
Date Aug. 10, 2018, 5:01 a.m.
Message ID <051a9598e4dbec47aa69.1533877278@Envy>
Download mbox | patch
Permalink /patch/33629/
State Accepted
Headers show

Comments

Matt Harbison - Aug. 10, 2018, 5:01 a.m.
# HG changeset patch
# User Matt Harbison <matt_harbison@yahoo.com>
# Date 1533875287 14400
#      Fri Aug 10 00:28:07 2018 -0400
# Node ID 051a9598e4dbec47aa69c9ba10cd0f488828e9c1
# Parent  eb3d685ec313b5d5bca7824e5e3e577509a486de
cext: fix a warning about differing const qualifiers on Windows

The prototype takes a 'void *', but self->offsets is a 'const char **'.

    mercurial/cext/revlog.c(2011) : warning C4090: 'function' : different
            'const' qualifiers
Yuya Nishihara - Aug. 12, 2018, 4:40 a.m.
On Fri, 10 Aug 2018 01:01:18 -0400, Matt Harbison wrote:
> # HG changeset patch
> # User Matt Harbison <matt_harbison@yahoo.com>
> # Date 1533875287 14400
> #      Fri Aug 10 00:28:07 2018 -0400
> # Node ID 051a9598e4dbec47aa69c9ba10cd0f488828e9c1
> # Parent  eb3d685ec313b5d5bca7824e5e3e577509a486de
> cext: fix a warning about differing const qualifiers on Windows

Queued 2-4, thanks.

Patch

diff --git a/mercurial/cext/revlog.c b/mercurial/cext/revlog.c
--- a/mercurial/cext/revlog.c
+++ b/mercurial/cext/revlog.c
@@ -2008,7 +2008,7 @@  static void _index_clearcaches(indexObje
 		self->cache = NULL;
 	}
 	if (self->offsets) {
-		PyMem_Free(self->offsets);
+		PyMem_Free((void *)self->offsets);
 		self->offsets = NULL;
 	}
 	if (self->nt != NULL) {