Branch: Tag:

2014-12-06

2014-12-06 20:59:14 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Stdio.Buffer: Use ptrdiff_t instead of ssize_t.

ptrdiff_t is C89, while ssize_t is POSIX. As we support some
non-POSIX architectures, use the more portable type.

32:   #undef MP_INT   #include <gmp.h>    - #ifndef HAVE_SSIZE_T - #define ssize_t SIZE_T - #endif /* HAVE_SSIZE_T */ -  +    #define DEFAULT_CMOD_STORAGE static   DECLARATIONS   
379:    }    }    -  static struct pike_string *io_read_string( Buffer *io, ssize_t len ) ATTRIBUTE((noclone,noinline)); -  +  static struct pike_string *io_read_string( Buffer *io, ptrdiff_t len ) +  ATTRIBUTE((noclone,noinline));    static size_t io_rewind( Buffer *io, INT_TYPE n );       static void io_do_rewind_on_error( struct rewind_to *e )
581:    return len;    }    -  static struct pike_string *io_read_string( Buffer *io, ssize_t len ) +  static struct pike_string *io_read_string( Buffer *io, ptrdiff_t len )    {    struct pike_string *s;   
700:    unsigned char*d;    struct pike_string *s;    int pad = 0; -  ssize_t bytes; +  ptrdiff_t bytes;    size_t exp;       if( mpz_sgn( i ) < 0 )