mirror of
https://github.com/neovim/neovim.git
synced 2025-01-01 17:23:36 -07:00
style/lint
This commit is contained in:
parent
336412e1db
commit
0c3dea5c4d
@ -14822,7 +14822,7 @@ static void f_setreg(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'u': case '"': { // unnamed register
|
case 'u': case '"': { // unnamed register
|
||||||
set_unnamed = true;
|
set_unnamed = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -5820,8 +5820,8 @@ size_t op_register_amount(void)
|
|||||||
|
|
||||||
/// Set register to a given value
|
/// Set register to a given value
|
||||||
///
|
///
|
||||||
/// @param[in] name Register name.
|
/// @param[in] name Register name.
|
||||||
/// @param[in] reg Register value.
|
/// @param[in] reg Register value.
|
||||||
/// @param[in] is_unnamed Whether to set the unnamed regiseter to reg
|
/// @param[in] is_unnamed Whether to set the unnamed regiseter to reg
|
||||||
///
|
///
|
||||||
/// @return true on success, false on failure.
|
/// @return true on success, false on failure.
|
||||||
@ -5860,6 +5860,7 @@ const yankreg_T *op_register_get(const char name)
|
|||||||
///
|
///
|
||||||
/// @return true on success, false on failure.
|
/// @return true on success, false on failure.
|
||||||
bool op_register_set_previous(const char name)
|
bool op_register_set_previous(const char name)
|
||||||
|
FUNC_ATTR_WARN_UNUSED_RESULT
|
||||||
{
|
{
|
||||||
int i = op_reg_index(name);
|
int i = op_reg_index(name);
|
||||||
if (i == -1) {
|
if (i == -1) {
|
||||||
|
@ -285,9 +285,9 @@ typedef struct {
|
|||||||
char name;
|
char name;
|
||||||
MotionType type;
|
MotionType type;
|
||||||
char **contents;
|
char **contents;
|
||||||
|
bool is_unnamed;
|
||||||
size_t contents_size;
|
size_t contents_size;
|
||||||
size_t width;
|
size_t width;
|
||||||
bool is_unnamed;
|
|
||||||
dict_T *additional_data;
|
dict_T *additional_data;
|
||||||
} reg;
|
} reg;
|
||||||
struct global_var {
|
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] wms The WriteMergerState used when writing.
|
||||||
/// @param[in] max_reg_lines The maximum number of register lines.
|
/// @param[in] max_reg_lines The maximum number of register lines.
|
||||||
static void shada_initialize_registers(WriteMergerState *const wms,
|
static inline void shada_initialize_registers(WriteMergerState *const wms,
|
||||||
int max_reg_lines) {
|
int max_reg_lines)
|
||||||
|
FUNC_ATTR_NONNULL_ALL FUNC_ATTR_ALWAYS_INLINE
|
||||||
|
{
|
||||||
const void *reg_iter = NULL;
|
const void *reg_iter = NULL;
|
||||||
const bool limit_reg_lines = max_reg_lines >= 0;
|
const bool limit_reg_lines = max_reg_lines >= 0;
|
||||||
do {
|
do {
|
||||||
@ -2345,7 +2347,7 @@ static void shada_initialize_registers(WriteMergerState *const wms,
|
|||||||
if (name == NUL) {
|
if (name == NUL) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (limit_reg_lines && reg.y_size > max_reg_lines) {
|
if (limit_reg_lines && reg.y_size > (size_t)max_reg_lines) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
wms->registers[op_reg_index(name)] = (PossiblyFreedShadaEntry) {
|
wms->registers[op_reg_index(name)] = (PossiblyFreedShadaEntry) {
|
||||||
@ -2355,10 +2357,10 @@ static void shada_initialize_registers(WriteMergerState *const wms,
|
|||||||
.timestamp = reg.timestamp,
|
.timestamp = reg.timestamp,
|
||||||
.data = {
|
.data = {
|
||||||
.reg = {
|
.reg = {
|
||||||
.contents = (char **) reg.y_array,
|
.contents = (char **)reg.y_array,
|
||||||
.contents_size = (size_t) reg.y_size,
|
.contents_size = (size_t)reg.y_size,
|
||||||
.type = reg.y_type,
|
.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,
|
.additional_data = reg.additional_data,
|
||||||
.name = name,
|
.name = name,
|
||||||
.is_unnamed = is_unnamed,
|
.is_unnamed = is_unnamed,
|
||||||
|
Loading…
Reference in New Issue
Block a user