codec.pyx.in: Cast arguments to `xfree'.
authorMark Wooding <mdw@distorted.org.uk>
Thu, 27 Jul 2017 09:50:39 +0000 (10:50 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Wed, 16 Aug 2017 03:31:32 +0000 (04:31 +0100)
I malloced them, so I have to free them; but the underlying type is
`const char *'.  Add the necessary casts.  This is actually a legitimate
use, rather than covering a Pyrex deficiency.

These are the last compiler warnings.

codec.pyx.in

index 37e0293..2d54d0c 100644 (file)
@@ -40,18 +40,18 @@ cdef class %CLASS%Encode:
     me.ctx.indent = NULL
   def __init__(me, indent = '\n', maxline = 72):
     if me.ctx.indent:
-      xfree(me.ctx.indent)
+      xfree(<void *>me.ctx.indent)
     me.ctx.indent = xstrdup(indent)
     me.ctx.maxline = maxline
   def __dealloc__(me):
     if me.ctx.indent:
-      xfree(me.ctx.indent)
+      xfree(<void *>me.ctx.indent)
   property indent:
     def __get__(me):
       return me.ctx.indent
     def __set__(me, indent):
       if me.ctx.indent:
-        xfree(me.ctx.indent)
+        xfree(<void *>me.ctx.indent)
       me.ctx.indent = xstrdup(indent)
   property maxline:
     def __get__(me):