mirror of
https://github.com/neovim/neovim.git
synced 2025-10-05 09:26:30 +00:00
eval: Move part of dictwatcher* functions to eval/typval
This commit is contained in:
@@ -59,6 +59,7 @@ typedef struct {
|
||||
typedef struct dict_watcher {
|
||||
Callback callback;
|
||||
char *key_pattern;
|
||||
size_t key_pattern_len;
|
||||
QUEUE node;
|
||||
bool busy; // prevent recursion if the dict is changed in the callback
|
||||
} DictWatcher;
|
||||
@@ -322,19 +323,6 @@ static inline bool tv_dict_is_watched(const dict_T *const d)
|
||||
return d && !QUEUE_EMPTY(&d->watchers);
|
||||
}
|
||||
|
||||
static inline DictWatcher *tv_dict_watcher_node_data(QUEUE *q)
|
||||
REAL_FATTR_NONNULL_ALL REAL_FATTR_NONNULL_RET REAL_FATTR_PURE
|
||||
REAL_FATTR_WARN_UNUSED_RESULT;
|
||||
|
||||
/// Compute the `DictWatcher` address from a QUEUE node.
|
||||
///
|
||||
/// This only exists for .asan-blacklist (ASAN doesn't handle QUEUE_DATA pointer
|
||||
/// arithmetic).
|
||||
static inline DictWatcher *tv_dict_watcher_node_data(QUEUE *q)
|
||||
{
|
||||
return QUEUE_DATA(q, DictWatcher, node);
|
||||
}
|
||||
|
||||
/// Initialize VimL object
|
||||
///
|
||||
/// Initializes to unlocked VAR_UNKNOWN object.
|
||||
@@ -407,6 +395,19 @@ static inline bool tv_get_float_chk(const typval_T *const tv,
|
||||
return false;
|
||||
}
|
||||
|
||||
static inline DictWatcher *tv_dict_watcher_node_data(QUEUE *q)
|
||||
REAL_FATTR_NONNULL_ALL REAL_FATTR_NONNULL_RET REAL_FATTR_PURE
|
||||
REAL_FATTR_WARN_UNUSED_RESULT REAL_FATTR_ALWAYS_INLINE;
|
||||
|
||||
/// Compute the `DictWatcher` address from a QUEUE node.
|
||||
///
|
||||
/// This only exists for .asan-blacklist (ASAN doesn't handle QUEUE_DATA pointer
|
||||
/// arithmetic).
|
||||
static inline DictWatcher *tv_dict_watcher_node_data(QUEUE *q)
|
||||
{
|
||||
return QUEUE_DATA(q, DictWatcher, node);
|
||||
}
|
||||
|
||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||
# include "eval/typval.h.generated.h"
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user