--- runtime/Clib/cports.c.orig 2017-04-18 01:33:52.000000000 -0600 +++ runtime/Clib/cports.c 2017-04-18 07:58:03.442793433 -0600 @@ -158,7 +158,7 @@ static int posix_close( FILE *f ) { } static ssize_t posix_read( FILE *f, void *buf, size_t count ) { - int n = fread( buf, 1, count, f ); + size_t n = fread( buf, 1, count, f ); if( n != 0 ) return n; @@ -174,9 +174,9 @@ static ssize_t posix_read( FILE *f, void /* BSD compatibility kit */ /*---------------------------------------------------------------------*/ #if( BGL_HAVE_SENDFILE && ( BGL_SENDFILE_BRAND == BGL_SENDFILE_BSD ) ) -static int bsd_sendfile(int out_fd, int in_fd, off_t *offset, size_t count) { +static ssize_t bsd_sendfile(int out_fd, int in_fd, off_t *offset, size_t count) { off_t sz = count; - int n = sendfile( in_fd, out_fd, offset ? *offset : 0, &sz, 0, 0 ); + ssize_t n = sendfile( in_fd, out_fd, offset ? *offset : 0, &sz, 0, 0 ); return n ? n : sz; } @@ -2252,7 +2252,7 @@ bgl_file_to_string( char *path ) { string_to_bstring( path ) ); } else { obj_t res = make_string_sans_fill( sin.st_size ); - int n = read( fd, BSTRING_TO_STRING( res ), sin.st_size ); + ssize_t n = read( fd, BSTRING_TO_STRING( res ), sin.st_size ); close( fd ); @@ -2540,7 +2540,7 @@ bgl_sendchars( obj_t ip, obj_t op, long } #if( BGL_HAVE_SENDFILE ) } else { - if( sz == -1 ) sz = in.st_size; + if( sz == -1 ) sz = (long) in.st_size; if( sz != 0 ) { #if( BGL_GC_HAVE_BLOCKING ) @@ -2650,7 +2650,7 @@ bgl_sendfile( obj_t name, obj_t op, long C_SYSTEM_FAILURE( BGL_IO_PORT_ERROR, "send-file", strerror( errno ), name ); } - sz = sin.st_size; + sz = (long) sin.st_size; } #if( !BGL_HAVE_SENDFILE )