Skip to content
This repository has been archived by the owner on May 4, 2018. It is now read-only.

Commit

Permalink
const-ify stream argument to uv_is_readable() and uv_is_writable()
Browse files Browse the repository at this point in the history
  • Loading branch information
bnoordhuis committed Apr 18, 2012
1 parent edb39b2 commit 132fe60
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions include/uv.h
Expand Up @@ -541,8 +541,8 @@ struct uv_write_s {
/*
* Used to determine whether a stream is readable or writable.
*/
UV_EXTERN int uv_is_readable(uv_stream_t* handle);
UV_EXTERN int uv_is_writable(uv_stream_t* handle);
UV_EXTERN int uv_is_readable(const uv_stream_t* handle);
UV_EXTERN int uv_is_writable(const uv_stream_t* handle);


/*
Expand Down
4 changes: 2 additions & 2 deletions src/unix/stream.c
Expand Up @@ -1006,12 +1006,12 @@ int uv_read_stop(uv_stream_t* stream) {
}


int uv_is_readable(uv_stream_t* stream) {
int uv_is_readable(const uv_stream_t* stream) {
return stream->flags & UV_READABLE;
}


int uv_is_writable(uv_stream_t* stream) {
int uv_is_writable(const uv_stream_t* stream) {
return stream->flags & UV_WRITABLE;
}

Expand Down
4 changes: 2 additions & 2 deletions src/win/stream.c
Expand Up @@ -191,11 +191,11 @@ size_t uv_count_bufs(uv_buf_t bufs[], int count) {
}


int uv_is_readable(uv_stream_t* handle) {
int uv_is_readable(const uv_stream_t* handle) {
return !(handle->flags & UV_HANDLE_EOF);
}


int uv_is_writable(uv_stream_t* handle) {
int uv_is_writable(const uv_stream_t* handle) {
return !(handle->flags & UV_HANDLE_SHUTTING);
}

0 comments on commit 132fe60

Please sign in to comment.