From e5c10549aae59d317eaa6a19262e15221807100a Mon Sep 17 00:00:00 2001 From: Peter Levine Date: Thu, 1 Jun 2023 03:58:31 -0400 Subject: [PATCH] Fix building with clang-16 --- _ruamel_yaml.pxd | 18 +++++++++--------- _ruamel_yaml.pyx | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) --- a/_ruamel_yaml.pxd +++ b/_ruamel_yaml.pxd @@ -2,15 +2,15 @@ cdef extern from "_ruamel_yaml.h": void malloc(int l) - void memcpy(char *d, char *s, int l) + void memcpy(unsigned char *d, char *s, int l) int strlen(char *s) int PyString_CheckExact(object o) int PyUnicode_CheckExact(object o) char *PyString_AS_STRING(object o) int PyString_GET_SIZE(object o) - object PyString_FromStringAndSize(char *v, int l) + object PyString_FromStringAndSize(unsigned char *v, size_t l) object PyUnicode_FromString(char *u) - object PyUnicode_DecodeUTF8(char *u, int s, char *e) + object PyUnicode_DecodeUTF8(unsigned char *u, size_t s, char *e) object PyUnicode_AsUTF8String(object o) int PY_MAJOR_VERSION @@ -85,11 +85,11 @@ cdef extern from "_ruamel_yaml.h": YAML_MAPPING_START_EVENT YAML_MAPPING_END_EVENT - ctypedef int yaml_read_handler_t(void *data, char *buffer, - int size, int *size_read) except 0 + ctypedef int yaml_read_handler_t(void *data, unsigned char *buffer, + size_t size, size_t *size_read) except 0 - ctypedef int yaml_write_handler_t(void *data, char *buffer, - int size) except 0 + ctypedef int yaml_write_handler_t(void *data, unsigned char *buffer, + size_t size) except 0 ctypedef struct yaml_mark_t: int index @@ -112,7 +112,7 @@ cdef extern from "_ruamel_yaml.h": char *handle char *suffix ctypedef struct _yaml_token_scalar_data_t: - char *value + unsigned char *value int length yaml_scalar_style_t style ctypedef struct _yaml_token_version_directive_data_t: @@ -151,7 +151,7 @@ cdef extern from "_ruamel_yaml.h": ctypedef struct _yaml_event_scalar_data_t: char *anchor char *tag - char *value + unsigned char *value int length int plain_implicit int quoted_implicit --- a/_ruamel_yaml.pyx +++ b/_ruamel_yaml.pyx @@ -904,7 +904,7 @@ cdef class CParser: raise error return 1 -cdef int input_handler(void *data, char *buffer, int size, int *read) except 0: +cdef int input_handler(void *data, unsigned char *buffer, size_t size, size_t *read) except 0: cdef CParser parser parser = data if parser.stream_cache is None: @@ -1514,7 +1514,7 @@ cdef class CEmitter: self.ascend_resolver() return 1 -cdef int output_handler(void *data, char *buffer, int size) except 0: +cdef int output_handler(void *data, unsigned char *buffer, size_t size) except 0: cdef CEmitter emitter emitter = data if emitter.dump_unicode == 0: