mirror of
https://github.com/neovim/neovim.git
synced 2025-09-29 22:48:34 +00:00
Reimplement the event queue in event.c using klist.h
- Add a new macro to klist.h: kl_empty() The whole point of abstract data structures is to avoid reimplementing common actions. The emptiness test seems to be such an action. - Add a new function attribute to func_attr.h: FUNC_ATTR_UNUSED Some of the many functions created by the macros in klist.h may end up not being used. Unused functions cause compilation errors as we compile with -Werror. To mark those functions as possibly unused we can use the FUNC_ATTR_UNUSED now. - Pass `Event` by value `Event` is such a small struct that I don't think we should allocate heap space and pass it by reference. Let's use the stack and memory cache in our favor passing it by value.
This commit is contained in:

committed by
Thiago de Arruda

parent
fac85c1724
commit
967fb1aca6
@@ -34,6 +34,7 @@
|
||||
#define FUNC_ATTR_CONST __attribute__((const))
|
||||
#define FUNC_ATTR_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
|
||||
#define FUNC_ATTR_ALWAYS_INLINE __attribute__((always_inline))
|
||||
#define FUNC_ATTR_UNUSED __attribute__((unused))
|
||||
|
||||
#ifdef __clang__
|
||||
// clang only
|
||||
@@ -90,6 +91,10 @@
|
||||
#define FUNC_ATTR_ALWAYS_INLINE
|
||||
#endif
|
||||
|
||||
#ifndef FUNC_ATTR_UNUSED
|
||||
#define FUNC_ATTR_UNUSED
|
||||
#endif
|
||||
|
||||
#ifndef FUNC_ATTR_NONNULL_ALL
|
||||
#define FUNC_ATTR_NONNULL_ALL
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user