--- runtime/Clib/cports.c.orig 2018-01-26 02:50:11.000000000 -0700 +++ runtime/Clib/cports.c 2018-01-26 21:21:28.826703643 -0700 @@ -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; } @@ -2262,7 +2262,7 @@ bgl_file_to_string( char *path ) { return 0L; } 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 ); @@ -2551,7 +2551,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 ) @@ -2661,7 +2661,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 )