diff options
author | AdnoC <adam.r.cutler@gmail.com> | 2017-05-29 11:31:06 -0400 |
---|---|---|
committer | AdnoC <adam.r.cutler@gmail.com> | 2017-05-31 13:31:01 -0400 |
commit | 0c3dea5c4d86a8ef61363034877bde04a0e99463 (patch) | |
tree | 20ecb8fbdbbad86bf4e239a78994ea1b99eca5d5 /src/nvim/shada.c | |
parent | 336412e1db84c3cd8f0287b95820f903e084dd3d (diff) | |
download | rneovim-0c3dea5c4d86a8ef61363034877bde04a0e99463.tar.gz rneovim-0c3dea5c4d86a8ef61363034877bde04a0e99463.tar.bz2 rneovim-0c3dea5c4d86a8ef61363034877bde04a0e99463.zip |
style/lint
Diffstat (limited to 'src/nvim/shada.c')
-rw-r--r-- | src/nvim/shada.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/nvim/shada.c b/src/nvim/shada.c index a29d34d037..8dccb24ebe 100644 --- a/src/nvim/shada.c +++ b/src/nvim/shada.c @@ -285,9 +285,9 @@ typedef struct { char name; MotionType type; char **contents; + bool is_unnamed; size_t contents_size; size_t width; - bool is_unnamed; dict_T *additional_data; } reg; struct global_var { @@ -2329,12 +2329,14 @@ static inline void add_search_pattern(PossiblyFreedShadaEntry *const ret_pse, } } -/// Initializes registers for writing to the ShaDa file +/// Initialize registers for writing to the ShaDa file /// /// @param[in] wms The WriteMergerState used when writing. -/// @param[in] max_reg_lines The maximum number of register lines. -static void shada_initialize_registers(WriteMergerState *const wms, - int max_reg_lines) { +/// @param[in] max_reg_lines The maximum number of register lines. +static inline void shada_initialize_registers(WriteMergerState *const wms, + int max_reg_lines) + FUNC_ATTR_NONNULL_ALL FUNC_ATTR_ALWAYS_INLINE +{ const void *reg_iter = NULL; const bool limit_reg_lines = max_reg_lines >= 0; do { @@ -2345,7 +2347,7 @@ static void shada_initialize_registers(WriteMergerState *const wms, if (name == NUL) { break; } - if (limit_reg_lines && reg.y_size > max_reg_lines) { + if (limit_reg_lines && reg.y_size > (size_t)max_reg_lines) { continue; } wms->registers[op_reg_index(name)] = (PossiblyFreedShadaEntry) { @@ -2355,10 +2357,10 @@ static void shada_initialize_registers(WriteMergerState *const wms, .timestamp = reg.timestamp, .data = { .reg = { - .contents = (char **) reg.y_array, - .contents_size = (size_t) reg.y_size, + .contents = (char **)reg.y_array, + .contents_size = (size_t)reg.y_size, .type = reg.y_type, - .width = (size_t) (reg.y_type == kMTBlockWise ? reg.y_width : 0), + .width = (size_t)(reg.y_type == kMTBlockWise ? reg.y_width : 0), .additional_data = reg.additional_data, .name = name, .is_unnamed = is_unnamed, |