mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
events: Add missing function attributes to some APIs
This commit is contained in:
parent
6bf322c6ff
commit
a10b327073
@ -49,6 +49,7 @@ void rstream_init(Stream *stream, size_t bufsize)
|
|||||||
///
|
///
|
||||||
/// @param stream The `Stream` instance
|
/// @param stream The `Stream` instance
|
||||||
void rstream_start(Stream *stream, stream_read_cb cb)
|
void rstream_start(Stream *stream, stream_read_cb cb)
|
||||||
|
FUNC_ATTR_NONNULL_ARG(1)
|
||||||
{
|
{
|
||||||
stream->read_cb = cb;
|
stream->read_cb = cb;
|
||||||
if (stream->uvstream) {
|
if (stream->uvstream) {
|
||||||
@ -62,6 +63,7 @@ void rstream_start(Stream *stream, stream_read_cb cb)
|
|||||||
///
|
///
|
||||||
/// @param stream The `Stream` instance
|
/// @param stream The `Stream` instance
|
||||||
void rstream_stop(Stream *stream)
|
void rstream_stop(Stream *stream)
|
||||||
|
FUNC_ATTR_NONNULL_ALL
|
||||||
{
|
{
|
||||||
if (stream->uvstream) {
|
if (stream->uvstream) {
|
||||||
uv_read_stop(stream->uvstream);
|
uv_read_stop(stream->uvstream);
|
||||||
|
@ -113,6 +113,7 @@ int socket_watcher_start(SocketWatcher *watcher, int backlog, socket_cb cb)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int socket_watcher_accept(SocketWatcher *watcher, Stream *stream, void *data)
|
int socket_watcher_accept(SocketWatcher *watcher, Stream *stream, void *data)
|
||||||
|
FUNC_ATTR_NONNULL_ARG(1) FUNC_ATTR_NONNULL_ARG(2)
|
||||||
{
|
{
|
||||||
uv_stream_t *client;
|
uv_stream_t *client;
|
||||||
|
|
||||||
|
@ -32,6 +32,7 @@ int stream_set_blocking(int fd, bool blocking)
|
|||||||
|
|
||||||
void stream_init(Loop *loop, Stream *stream, int fd, uv_stream_t *uvstream,
|
void stream_init(Loop *loop, Stream *stream, int fd, uv_stream_t *uvstream,
|
||||||
void *data)
|
void *data)
|
||||||
|
FUNC_ATTR_NONNULL_ARG(2)
|
||||||
{
|
{
|
||||||
stream->uvstream = uvstream;
|
stream->uvstream = uvstream;
|
||||||
|
|
||||||
@ -72,6 +73,7 @@ void stream_init(Loop *loop, Stream *stream, int fd, uv_stream_t *uvstream,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void stream_close(Stream *stream, stream_close_cb on_stream_close)
|
void stream_close(Stream *stream, stream_close_cb on_stream_close)
|
||||||
|
FUNC_ATTR_NONNULL_ARG(1)
|
||||||
{
|
{
|
||||||
assert(!stream->closed);
|
assert(!stream->closed);
|
||||||
|
|
||||||
@ -88,6 +90,7 @@ void stream_close(Stream *stream, stream_close_cb on_stream_close)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void stream_close_handle(Stream *stream)
|
void stream_close_handle(Stream *stream)
|
||||||
|
FUNC_ATTR_NONNULL_ALL
|
||||||
{
|
{
|
||||||
if (stream->uvstream) {
|
if (stream->uvstream) {
|
||||||
uv_close((uv_handle_t *)stream->uvstream, close_cb);
|
uv_close((uv_handle_t *)stream->uvstream, close_cb);
|
||||||
|
@ -118,6 +118,7 @@ WBuffer *wstream_new_buffer(char *data,
|
|||||||
size_t size,
|
size_t size,
|
||||||
size_t refcount,
|
size_t refcount,
|
||||||
wbuffer_data_finalizer cb)
|
wbuffer_data_finalizer cb)
|
||||||
|
FUNC_ATTR_NONNULL_ARG(1)
|
||||||
{
|
{
|
||||||
WBuffer *rv = xmalloc(sizeof(WBuffer));
|
WBuffer *rv = xmalloc(sizeof(WBuffer));
|
||||||
rv->size = size;
|
rv->size = size;
|
||||||
@ -151,6 +152,7 @@ static void write_cb(uv_write_t *req, int status)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void wstream_release_wbuffer(WBuffer *buffer)
|
void wstream_release_wbuffer(WBuffer *buffer)
|
||||||
|
FUNC_ATTR_NONNULL_ALL
|
||||||
{
|
{
|
||||||
if (!--buffer->refcount) {
|
if (!--buffer->refcount) {
|
||||||
if (buffer->cb) {
|
if (buffer->cb) {
|
||||||
|
Loading…
Reference in New Issue
Block a user