diff options
-rw-r--r-- | src/nvim/os/rstream.c | 4 | ||||
-rw-r--r-- | src/nvim/os/rstream.h | 4 | ||||
-rw-r--r-- | src/nvim/os/wstream.c | 12 | ||||
-rw-r--r-- | src/nvim/os/wstream.h | 4 |
4 files changed, 12 insertions, 12 deletions
diff --git a/src/nvim/os/rstream.c b/src/nvim/os/rstream.c index 1dc30be582..b1e4cc7a57 100644 --- a/src/nvim/os/rstream.c +++ b/src/nvim/os/rstream.c @@ -33,7 +33,7 @@ static void close_cb(uv_handle_t *handle); static void emit_read_event(RStream *rstream, bool eof); RStream * rstream_new(rstream_cb cb, - uint32_t buffer_size, + size_t buffer_size, void *data, bool async) { @@ -133,7 +133,7 @@ void rstream_stop(RStream *rstream) } } -size_t rstream_read(RStream *rstream, char *buf, uint32_t count) +size_t rstream_read(RStream *rstream, char *buf, size_t count) { size_t read_count = rstream->wpos - rstream->rpos; diff --git a/src/nvim/os/rstream.h b/src/nvim/os/rstream.h index 7a565099b7..5afa864f04 100644 --- a/src/nvim/os/rstream.h +++ b/src/nvim/os/rstream.h @@ -21,7 +21,7 @@ /// this to false /// @return The newly-allocated `RStream` instance RStream * rstream_new(rstream_cb cb, - uint32_t buffer_size, + size_t buffer_size, void *data, bool async); @@ -65,7 +65,7 @@ void rstream_stop(RStream *rstream); /// @param buffer The buffer which will receive the data /// @param count Number of bytes that `buffer` can accept /// @return The number of bytes copied into `buffer` -size_t rstream_read(RStream *rstream, char *buffer, uint32_t count); +size_t rstream_read(RStream *rstream, char *buffer, size_t count); /// Returns the number of bytes available for reading from `rstream` /// diff --git a/src/nvim/os/wstream.c b/src/nvim/os/wstream.c index 382c95e31d..22524e2430 100644 --- a/src/nvim/os/wstream.c +++ b/src/nvim/os/wstream.c @@ -12,11 +12,11 @@ struct wstream { uv_stream_t *stream; // Memory currently used by pending buffers - uint32_t curmem; + size_t curmem; // Maximum memory used by this instance - uint32_t maxmem; + size_t maxmem; // Number of pending requests - uint32_t pending_reqs; + size_t pending_reqs; bool freed; }; @@ -25,14 +25,14 @@ typedef struct { // Buffer containing data to be written char *buffer; // Size of the buffer - uint32_t length; + size_t length; // If it's our responsibility to free the buffer bool free; } WriteData; static void write_cb(uv_write_t *req, int status); -WStream * wstream_new(uint32_t maxmem) +WStream * wstream_new(size_t maxmem) { WStream *rv = xmalloc(sizeof(WStream)); rv->maxmem = maxmem; @@ -59,7 +59,7 @@ void wstream_set_stream(WStream *wstream, uv_stream_t *stream) wstream->stream = stream; } -bool wstream_write(WStream *wstream, char *buffer, uint32_t length, bool free) +bool wstream_write(WStream *wstream, char *buffer, size_t length, bool free) { WriteData *data; uv_buf_t uvbuf; diff --git a/src/nvim/os/wstream.h b/src/nvim/os/wstream.h index a12d26fd5e..2cef16e6cd 100644 --- a/src/nvim/os/wstream.h +++ b/src/nvim/os/wstream.h @@ -12,7 +12,7 @@ /// /// @param maxmem Maximum amount memory used by this `WStream` instance. /// @return The newly-allocated `WStream` instance -WStream * wstream_new(uint32_t maxmem); +WStream * wstream_new(size_t maxmem); /// Frees all memory allocated for a WStream instance /// @@ -34,7 +34,7 @@ void wstream_set_stream(WStream *wstream, uv_stream_t *stream); /// @param length Number of bytes that should be written from `buffer` /// @param free If true, `buffer` will be freed after the write is complete /// @return true if the data was successfully queued, false otherwise. -bool wstream_write(WStream *wstream, char *buffer, uint32_t length, bool free); +bool wstream_write(WStream *wstream, char *buffer, size_t length, bool free); #endif // NVIM_OS_WSTREAM_H |