summaryrefslogtreecommitdiffstats
path: root/byterun/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'byterun/io.c')
-rw-r--r--byterun/io.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/byterun/io.c b/byterun/io.c
index 070bb1d96..63bbfc058 100644
--- a/byterun/io.c
+++ b/byterun/io.c
@@ -199,7 +199,7 @@ CAMLexport void caml_putword(struct channel *channel, uint32 w)
putch(channel, w);
}
-CAMLexport int caml_putblock(struct channel *channel, char *p, long int len)
+CAMLexport int caml_putblock(struct channel *channel, char *p, intnat len)
{
int n, free, towrite, written;
@@ -224,7 +224,8 @@ CAMLexport int caml_putblock(struct channel *channel, char *p, long int len)
}
}
-CAMLexport void caml_really_putblock(struct channel *channel, char *p, long len)
+CAMLexport void caml_really_putblock(struct channel *channel,
+ char *p, intnat len)
{
int written;
while (len > 0) {
@@ -288,7 +289,7 @@ CAMLexport uint32 caml_getword(struct channel *channel)
return res;
}
-CAMLexport int caml_getblock(struct channel *channel, char *p, long int len)
+CAMLexport int caml_getblock(struct channel *channel, char *p, intnat len)
{
int n, avail, nread;
@@ -314,7 +315,7 @@ CAMLexport int caml_getblock(struct channel *channel, char *p, long int len)
}
}
-CAMLexport int caml_really_getblock(struct channel *chan, char *p, long int n)
+CAMLexport int caml_really_getblock(struct channel *chan, char *p, intnat n)
{
int r;
while (n > 0) {
@@ -343,7 +344,7 @@ CAMLexport file_offset caml_pos_in(struct channel *channel)
return channel->offset - (file_offset)(channel->max - channel->curr);
}
-CAMLexport long caml_input_scan_line(struct channel *channel)
+CAMLexport intnat caml_input_scan_line(struct channel *channel)
{
char * p;
int n;
@@ -580,8 +581,8 @@ CAMLprim value caml_ml_output(value vchannel, value buff, value start,
{
CAMLparam4 (vchannel, buff, start, length);
struct channel * channel = Channel(vchannel);
- long pos = Long_val(start);
- long len = Long_val(length);
+ intnat pos = Long_val(start);
+ intnat len = Long_val(length);
Lock(channel);
while (len > 0) {
@@ -637,7 +638,7 @@ CAMLprim value caml_ml_input_char(value vchannel)
CAMLprim value caml_ml_input_int(value vchannel)
{
struct channel * channel = Channel(vchannel);
- long i;
+ intnat i;
Lock(channel);
i = caml_getword(channel);
@@ -653,7 +654,7 @@ CAMLprim value caml_ml_input(value vchannel, value buff, value vstart,
{
CAMLparam4 (vchannel, buff, vstart, vlength);
struct channel * channel = Channel(vchannel);
- long start, len;
+ intnat start, len;
int n, avail, nread;
Lock(channel);
@@ -716,7 +717,7 @@ CAMLprim value caml_ml_pos_in_64(value vchannel)
CAMLprim value caml_ml_input_scan_line(value vchannel)
{
struct channel * channel = Channel(vchannel);
- long res;
+ intnat res;
Lock(channel);
res = caml_input_scan_line(channel);