mirror of
https://github.com/neovim/neovim.git
synced 2025-09-08 04:18:18 +00:00
*: Fix errors from new linter checks
This commit is contained in:
@@ -85,8 +85,6 @@ typedef struct { \
|
||||
///
|
||||
/// Intended function signature: `void *rbfree(RBType *)`;
|
||||
#define RINGBUF_INIT(TypeName, funcprefix, RBType, rbfree) \
|
||||
\
|
||||
\
|
||||
static inline TypeName##RingBuffer funcprefix##_rb_new(const size_t size) \
|
||||
REAL_FATTR_WARN_UNUSED_RESULT; \
|
||||
static inline TypeName##RingBuffer funcprefix##_rb_new(const size_t size) \
|
||||
@@ -100,7 +98,7 @@ static inline TypeName##RingBuffer funcprefix##_rb_new(const size_t size) \
|
||||
.buf_end = buf + size - 1, \
|
||||
}; \
|
||||
} \
|
||||
\
|
||||
\
|
||||
static inline void funcprefix##_rb_free(TypeName##RingBuffer *const rb) \
|
||||
REAL_FATTR_UNUSED; \
|
||||
static inline void funcprefix##_rb_free(TypeName##RingBuffer *const rb) \
|
||||
@@ -113,14 +111,14 @@ static inline void funcprefix##_rb_free(TypeName##RingBuffer *const rb) \
|
||||
} \
|
||||
xfree(rb->buf); \
|
||||
} \
|
||||
\
|
||||
\
|
||||
static inline void funcprefix##_rb_dealloc(TypeName##RingBuffer *const rb) \
|
||||
REAL_FATTR_UNUSED; \
|
||||
static inline void funcprefix##_rb_dealloc(TypeName##RingBuffer *const rb) \
|
||||
{ \
|
||||
xfree(rb->buf); \
|
||||
} \
|
||||
\
|
||||
\
|
||||
static inline void funcprefix##_rb_push(TypeName##RingBuffer *const rb, \
|
||||
RBType item) \
|
||||
REAL_FATTR_NONNULL_ARG(1); \
|
||||
@@ -136,7 +134,7 @@ static inline void funcprefix##_rb_push(TypeName##RingBuffer *const rb, \
|
||||
*rb->next = item; \
|
||||
rb->next = _RINGBUF_NEXT(rb, rb->next); \
|
||||
} \
|
||||
\
|
||||
\
|
||||
static inline ptrdiff_t funcprefix##_rb_find_idx( \
|
||||
const TypeName##RingBuffer *const rb, const RBType *const item_p) \
|
||||
REAL_FATTR_NONNULL_ALL REAL_FATTR_PURE REAL_FATTR_UNUSED; \
|
||||
@@ -153,7 +151,7 @@ static inline ptrdiff_t funcprefix##_rb_find_idx( \
|
||||
return item_p - rb->buf + rb->buf_end - rb->first + 1; \
|
||||
} \
|
||||
} \
|
||||
\
|
||||
\
|
||||
static inline size_t funcprefix##_rb_size( \
|
||||
const TypeName##RingBuffer *const rb) \
|
||||
REAL_FATTR_NONNULL_ALL REAL_FATTR_PURE; \
|
||||
@@ -162,7 +160,7 @@ static inline size_t funcprefix##_rb_size( \
|
||||
{ \
|
||||
return (size_t) (rb->buf_end - rb->buf) + 1; \
|
||||
} \
|
||||
\
|
||||
\
|
||||
static inline size_t funcprefix##_rb_length( \
|
||||
const TypeName##RingBuffer *const rb) \
|
||||
REAL_FATTR_NONNULL_ALL REAL_FATTR_PURE; \
|
||||
@@ -171,7 +169,7 @@ static inline size_t funcprefix##_rb_length( \
|
||||
{ \
|
||||
return _RINGBUF_LENGTH(rb); \
|
||||
} \
|
||||
\
|
||||
\
|
||||
static inline RBType *funcprefix##_rb_idx_p( \
|
||||
const TypeName##RingBuffer *const rb, const size_t idx) \
|
||||
REAL_FATTR_NONNULL_ALL REAL_FATTR_PURE; \
|
||||
@@ -186,7 +184,7 @@ static inline RBType *funcprefix##_rb_idx_p( \
|
||||
return rb->first + idx; \
|
||||
} \
|
||||
} \
|
||||
\
|
||||
\
|
||||
static inline RBType funcprefix##_rb_idx(const TypeName##RingBuffer *const rb, \
|
||||
const size_t idx) \
|
||||
REAL_FATTR_NONNULL_ALL REAL_FATTR_PURE REAL_FATTR_UNUSED; \
|
||||
@@ -195,7 +193,7 @@ static inline RBType funcprefix##_rb_idx(const TypeName##RingBuffer *const rb, \
|
||||
{ \
|
||||
return *funcprefix##_rb_idx_p(rb, idx); \
|
||||
} \
|
||||
\
|
||||
\
|
||||
static inline void funcprefix##_rb_insert(TypeName##RingBuffer *const rb, \
|
||||
const size_t idx, \
|
||||
RBType item) \
|
||||
@@ -237,7 +235,7 @@ static inline void funcprefix##_rb_insert(TypeName##RingBuffer *const rb, \
|
||||
} \
|
||||
rb->next = _RINGBUF_NEXT(rb, rb->next); \
|
||||
} \
|
||||
\
|
||||
\
|
||||
static inline void funcprefix##_rb_remove(TypeName##RingBuffer *const rb, \
|
||||
const size_t idx) \
|
||||
REAL_FATTR_NONNULL_ARG(1) REAL_FATTR_UNUSED; \
|
||||
|
Reference in New Issue
Block a user