From 9502566d3b2c1aa5e7497b16d881ee145f546306 Mon Sep 17 00:00:00 2001 From: Reuben Thomas Date: Tue, 16 Jan 2018 10:37:48 +0000 Subject: [PATCH] Recode.pyx: minor improvements MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit size_t is supported natively these days, so don’t make a dangerous guess as to its value (in particular, should never hard-wire things determined in config.h!). Use libcpp’s bool instead of hand-defining a bool enum. Use True for C true (will be automatically coerced). --- tests/Recode.pyx | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/tests/Recode.pyx b/tests/Recode.pyx index 5eb9d13..eff60f8 100644 --- a/tests/Recode.pyx +++ b/tests/Recode.pyx @@ -18,17 +18,12 @@ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. -cdef enum bool: - false = 0 - true = 1 +from libcpp cimport bool cdef extern from "stdio.h": struct FILE: pass -cdef extern from "config.h": - ctypedef long size_t - cdef extern from "common.h": ## Forwarded. @@ -646,7 +641,7 @@ cdef class Request: cdef bool saved outer = self.request.outer saved = outer.iconv_pivot.ignore - outer.iconv_pivot.ignore = true + outer.iconv_pivot.ignore = True ok = recode_format_table( self.request, language, charset) outer.iconv_pivot.ignore = saved -- 2.40.0