Ticket #247: size_t_not_int.diff

File size_t_not_int.diff, 2.6 KB (added by debian@…, 3 years ago)

Patch

  • ext/_yaml.pxd

    pyyaml FTBFS on the s390x buildd.  It seems this is due to using int
    where the libyaml API uses size_t.  I tested the attached patch in
    zelenka.d.o's sid chroot, and at least the python2 build/test worked (it
    failed with the same error as the buildd pre-patching).
    Patch by Julien Cristau <jcristau@debian.org>
    Add to the pyyaml package by Scott Kitterman <scott@kitterman.com>
    http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=676536
    
    old new  
    8686        YAML_MAPPING_END_EVENT 
    8787 
    8888    ctypedef int yaml_read_handler_t(void *data, char *buffer, 
    89             int size, int *size_read) except 0 
     89            size_t size, size_t *size_read) except 0 
    9090 
    9191    ctypedef int yaml_write_handler_t(void *data, char *buffer, 
    92             int size) except 0 
     92            size_t size) except 0 
    9393 
    9494    ctypedef struct yaml_mark_t: 
    95         int index 
    96         int line 
    97         int column 
     95        size_t index 
     96        size_t line 
     97        size_t column 
    9898    ctypedef struct yaml_version_directive_t: 
    9999        int major 
    100100        int minor 
     
    113113        char *suffix 
    114114    ctypedef struct _yaml_token_scalar_data_t: 
    115115        char *value 
    116         int length 
     116        size_t length 
    117117        yaml_scalar_style_t style 
    118118    ctypedef struct _yaml_token_version_directive_data_t: 
    119119        int major 
     
    152152        char *anchor 
    153153        char *tag 
    154154        char *value 
    155         int length 
     155        size_t length 
    156156        int plain_implicit 
    157157        int quoted_implicit 
    158158        yaml_scalar_style_t style 
  • ext/_yaml.pyx

    old new  
    905905                raise error 
    906906        return 1 
    907907 
    908 cdef int input_handler(void *data, char *buffer, int size, int *read) except 0: 
     908cdef int input_handler(void *data, char *buffer, size_t size, size_t *read) except 0: 
    909909    cdef CParser parser 
    910910    parser = <CParser>data 
    911911    if parser.stream_cache is None: 
     
    15151515            self.ascend_resolver() 
    15161516        return 1 
    15171517 
    1518 cdef int output_handler(void *data, char *buffer, int size) except 0: 
     1518cdef int output_handler(void *data, char *buffer, size_t size) except 0: 
    15191519    cdef CEmitter emitter 
    15201520    emitter = <CEmitter>data 
    15211521    if emitter.dump_unicode == 0: