*: Fix linter errors

This commit is contained in:
ZyX
2017-11-06 20:28:37 +03:00
parent 24a353364d
commit 4aebd00a9e
5 changed files with 14 additions and 16 deletions

View File

@@ -1009,10 +1009,10 @@ Dictionary nvim_parse_expression(String expr, String flags, Boolean highlight,
ExprAST east = viml_pexpr_parse(&pstate, pflags);
const size_t ret_size = (
2 // "ast", "len"
+ (size_t)(east.err.msg != NULL) // "error"
+ (size_t)highlight // "highlight"
);
2 // "ast", "len"
+ (size_t)(east.err.msg != NULL) // "error"
+ (size_t)highlight // "highlight"
+ 0);
Dictionary ret = {
.items = xmalloc(ret_size * sizeof(ret.items[0])),
.size = 0,
@@ -1242,12 +1242,12 @@ Dictionary nvim_parse_expression(String expr, String flags, Boolean highlight,
ret_node->items[ret_node->size++] = (KeyValuePair) {
.key = STATIC_CSTR_TO_STRING("cmp_type"),
.value = STRING_OBJ(cstr_to_string(
eltkn_cmp_type_tab[node->data.cmp.type])),
eltkn_cmp_type_tab[node->data.cmp.type])),
};
ret_node->items[ret_node->size++] = (KeyValuePair) {
.key = STATIC_CSTR_TO_STRING("ccs_strategy"),
.value = STRING_OBJ(cstr_to_string(
ccs_tab[node->data.cmp.ccs])),
ccs_tab[node->data.cmp.ccs])),
};
ret_node->items[ret_node->size++] = (KeyValuePair) {
.key = STATIC_CSTR_TO_STRING("invert"),
@@ -1266,9 +1266,9 @@ Dictionary nvim_parse_expression(String expr, String flags, Boolean highlight,
ret_node->items[ret_node->size++] = (KeyValuePair) {
.key = STATIC_CSTR_TO_STRING("ivalue"),
.value = INTEGER_OBJ((Integer)(
node->data.num.value > API_INTEGER_MAX
? API_INTEGER_MAX
: (Integer)node->data.num.value)),
node->data.num.value > API_INTEGER_MAX
? API_INTEGER_MAX
: (Integer)node->data.num.value)),
};
break;
}

View File

@@ -301,10 +301,10 @@ local function mergedicts_copy(d1, d2)
for k, v in pairs(d2) do
if d2[k] == REMOVE_THIS then
ret[k] = nil
elseif type(d1[k]) == 'table' and type(d2[k]) == 'table' then
ret[k] = mergedicts_copy(d1[k], d2[k])
elseif type(d1[k]) == 'table' and type(v) == 'table' then
ret[k] = mergedicts_copy(d1[k], v)
else
ret[k] = d2[k]
ret[k] = v
end
end
return ret

View File

@@ -5,7 +5,6 @@ local itp = helpers.gen_itp(it)
local cimport = helpers.cimport
local ffi = helpers.ffi
local eq = helpers.eq
local shallowcopy = global_helpers.shallowcopy
local updated = global_helpers.updated

View File

@@ -112,7 +112,6 @@ return {
pline2lua = pline2lua,
pstate_str = pstate_str,
new_pstate = new_pstate,
intchar2lua = intchar2lua,
conv_cmp_type = conv_cmp_type,
pstate_set_str = pstate_set_str,
}