mirror of
https://github.com/neovim/neovim.git
synced 2025-09-09 04:48: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 *)`;
|
/// Intended function signature: `void *rbfree(RBType *)`;
|
||||||
#define RINGBUF_INIT(TypeName, funcprefix, RBType, rbfree) \
|
#define RINGBUF_INIT(TypeName, funcprefix, RBType, rbfree) \
|
||||||
\
|
|
||||||
\
|
|
||||||
static inline TypeName##RingBuffer funcprefix##_rb_new(const size_t size) \
|
static inline TypeName##RingBuffer funcprefix##_rb_new(const size_t size) \
|
||||||
REAL_FATTR_WARN_UNUSED_RESULT; \
|
REAL_FATTR_WARN_UNUSED_RESULT; \
|
||||||
static inline TypeName##RingBuffer funcprefix##_rb_new(const size_t size) \
|
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, \
|
.buf_end = buf + size - 1, \
|
||||||
}; \
|
}; \
|
||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
static inline void funcprefix##_rb_free(TypeName##RingBuffer *const rb) \
|
static inline void funcprefix##_rb_free(TypeName##RingBuffer *const rb) \
|
||||||
REAL_FATTR_UNUSED; \
|
REAL_FATTR_UNUSED; \
|
||||||
static inline void funcprefix##_rb_free(TypeName##RingBuffer *const rb) \
|
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); \
|
xfree(rb->buf); \
|
||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
static inline void funcprefix##_rb_dealloc(TypeName##RingBuffer *const rb) \
|
static inline void funcprefix##_rb_dealloc(TypeName##RingBuffer *const rb) \
|
||||||
REAL_FATTR_UNUSED; \
|
REAL_FATTR_UNUSED; \
|
||||||
static inline void funcprefix##_rb_dealloc(TypeName##RingBuffer *const rb) \
|
static inline void funcprefix##_rb_dealloc(TypeName##RingBuffer *const rb) \
|
||||||
{ \
|
{ \
|
||||||
xfree(rb->buf); \
|
xfree(rb->buf); \
|
||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
static inline void funcprefix##_rb_push(TypeName##RingBuffer *const rb, \
|
static inline void funcprefix##_rb_push(TypeName##RingBuffer *const rb, \
|
||||||
RBType item) \
|
RBType item) \
|
||||||
REAL_FATTR_NONNULL_ARG(1); \
|
REAL_FATTR_NONNULL_ARG(1); \
|
||||||
@@ -136,7 +134,7 @@ static inline void funcprefix##_rb_push(TypeName##RingBuffer *const rb, \
|
|||||||
*rb->next = item; \
|
*rb->next = item; \
|
||||||
rb->next = _RINGBUF_NEXT(rb, rb->next); \
|
rb->next = _RINGBUF_NEXT(rb, rb->next); \
|
||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
static inline ptrdiff_t funcprefix##_rb_find_idx( \
|
static inline ptrdiff_t funcprefix##_rb_find_idx( \
|
||||||
const TypeName##RingBuffer *const rb, const RBType *const item_p) \
|
const TypeName##RingBuffer *const rb, const RBType *const item_p) \
|
||||||
REAL_FATTR_NONNULL_ALL REAL_FATTR_PURE REAL_FATTR_UNUSED; \
|
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; \
|
return item_p - rb->buf + rb->buf_end - rb->first + 1; \
|
||||||
} \
|
} \
|
||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
static inline size_t funcprefix##_rb_size( \
|
static inline size_t funcprefix##_rb_size( \
|
||||||
const TypeName##RingBuffer *const rb) \
|
const TypeName##RingBuffer *const rb) \
|
||||||
REAL_FATTR_NONNULL_ALL REAL_FATTR_PURE; \
|
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; \
|
return (size_t) (rb->buf_end - rb->buf) + 1; \
|
||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
static inline size_t funcprefix##_rb_length( \
|
static inline size_t funcprefix##_rb_length( \
|
||||||
const TypeName##RingBuffer *const rb) \
|
const TypeName##RingBuffer *const rb) \
|
||||||
REAL_FATTR_NONNULL_ALL REAL_FATTR_PURE; \
|
REAL_FATTR_NONNULL_ALL REAL_FATTR_PURE; \
|
||||||
@@ -171,7 +169,7 @@ static inline size_t funcprefix##_rb_length( \
|
|||||||
{ \
|
{ \
|
||||||
return _RINGBUF_LENGTH(rb); \
|
return _RINGBUF_LENGTH(rb); \
|
||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
static inline RBType *funcprefix##_rb_idx_p( \
|
static inline RBType *funcprefix##_rb_idx_p( \
|
||||||
const TypeName##RingBuffer *const rb, const size_t idx) \
|
const TypeName##RingBuffer *const rb, const size_t idx) \
|
||||||
REAL_FATTR_NONNULL_ALL REAL_FATTR_PURE; \
|
REAL_FATTR_NONNULL_ALL REAL_FATTR_PURE; \
|
||||||
@@ -186,7 +184,7 @@ static inline RBType *funcprefix##_rb_idx_p( \
|
|||||||
return rb->first + idx; \
|
return rb->first + idx; \
|
||||||
} \
|
} \
|
||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
static inline RBType funcprefix##_rb_idx(const TypeName##RingBuffer *const rb, \
|
static inline RBType funcprefix##_rb_idx(const TypeName##RingBuffer *const rb, \
|
||||||
const size_t idx) \
|
const size_t idx) \
|
||||||
REAL_FATTR_NONNULL_ALL REAL_FATTR_PURE REAL_FATTR_UNUSED; \
|
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); \
|
return *funcprefix##_rb_idx_p(rb, idx); \
|
||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
static inline void funcprefix##_rb_insert(TypeName##RingBuffer *const rb, \
|
static inline void funcprefix##_rb_insert(TypeName##RingBuffer *const rb, \
|
||||||
const size_t idx, \
|
const size_t idx, \
|
||||||
RBType item) \
|
RBType item) \
|
||||||
@@ -237,7 +235,7 @@ static inline void funcprefix##_rb_insert(TypeName##RingBuffer *const rb, \
|
|||||||
} \
|
} \
|
||||||
rb->next = _RINGBUF_NEXT(rb, rb->next); \
|
rb->next = _RINGBUF_NEXT(rb, rb->next); \
|
||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
static inline void funcprefix##_rb_remove(TypeName##RingBuffer *const rb, \
|
static inline void funcprefix##_rb_remove(TypeName##RingBuffer *const rb, \
|
||||||
const size_t idx) \
|
const size_t idx) \
|
||||||
REAL_FATTR_NONNULL_ARG(1) REAL_FATTR_UNUSED; \
|
REAL_FATTR_NONNULL_ARG(1) REAL_FATTR_UNUSED; \
|
||||||
|
Reference in New Issue
Block a user