style/lint

This commit is contained in:
AdnoC 2017-05-29 11:31:06 -04:00
parent 336412e1db
commit 0c3dea5c4d
3 changed files with 15 additions and 12 deletions

View File

@ -14822,7 +14822,7 @@ static void f_setreg(typval_T *argvars, typval_T *rettv, FunPtr fptr)
}
break;
}
case 'u': case '"': { // unnamed register
case 'u': case '"': { // unnamed register
set_unnamed = true;
break;
}

View File

@ -5820,8 +5820,8 @@ size_t op_register_amount(void)
/// Set register to a given value
///
/// @param[in] name Register name.
/// @param[in] reg Register value.
/// @param[in] name Register name.
/// @param[in] reg Register value.
/// @param[in] is_unnamed Whether to set the unnamed regiseter to reg
///
/// @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.
bool op_register_set_previous(const char name)
FUNC_ATTR_WARN_UNUSED_RESULT
{
int i = op_reg_index(name);
if (i == -1) {

View File

@ -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,