diff options
Diffstat (limited to 'src/nvim/api')
-rw-r--r-- | src/nvim/api/buffer.c | 4 | ||||
-rw-r--r-- | src/nvim/api/extmark.c | 2 | ||||
-rw-r--r-- | src/nvim/api/options.c | 2 | ||||
-rw-r--r-- | src/nvim/api/private/converter.c | 4 |
4 files changed, 6 insertions, 6 deletions
diff --git a/src/nvim/api/buffer.c b/src/nvim/api/buffer.c index ca3cf76388..10c684941c 100644 --- a/src/nvim/api/buffer.c +++ b/src/nvim/api/buffer.c @@ -404,7 +404,7 @@ void nvim_buf_set_lines(uint64_t channel_id, Buffer buffer, Integer start, Integ // If the size of the range is reducing (ie, new_len < old_len) we // need to delete some old_len. We do this at the start, by // repeatedly deleting line "start". - size_t to_delete = (new_len < old_len) ? (size_t)(old_len - new_len) : 0; + size_t to_delete = (new_len < old_len) ? old_len - new_len : 0; for (size_t i = 0; i < to_delete; i++) { if (ml_delete((linenr_T)start, false) == FAIL) { api_set_error(err, kErrorTypeException, "Failed to delete line"); @@ -648,7 +648,7 @@ void nvim_buf_set_text(uint64_t channel_id, Buffer buffer, Integer start_row, In // If the size of the range is reducing (ie, new_len < old_len) we // need to delete some old_len. We do this at the start, by // repeatedly deleting line "start". - size_t to_delete = (new_len < old_len) ? (size_t)(old_len - new_len) : 0; + size_t to_delete = (new_len < old_len) ? old_len - new_len : 0; for (size_t i = 0; i < to_delete; i++) { if (ml_delete((linenr_T)start_row, false) == FAIL) { api_set_error(err, kErrorTypeException, "Failed to delete line"); diff --git a/src/nvim/api/extmark.c b/src/nvim/api/extmark.c index eb49587d03..b781da1dc3 100644 --- a/src/nvim/api/extmark.c +++ b/src/nvim/api/extmark.c @@ -1168,7 +1168,7 @@ static bool extmark_get_index_from_obj(buf_T *buf, Integer ns_id, Object obj, in Integer pos_row = pos.items[0].data.integer; Integer pos_col = pos.items[1].data.integer; - *row = (int)(pos_row >= 0 ? pos_row : MAXLNUM); + *row = (int)(pos_row >= 0 ? pos_row : MAXLNUM); *col = (colnr_T)(pos_col >= 0 ? pos_col : MAXCOL); return true; } else { diff --git a/src/nvim/api/options.c b/src/nvim/api/options.c index 467a4720a6..2d1b170d2d 100644 --- a/src/nvim/api/options.c +++ b/src/nvim/api/options.c @@ -546,7 +546,7 @@ void set_option_to(uint64_t channel_id, void *to, int type, String name, Object // For global-win-local options -> setlocal // For win-local options -> setglobal and setlocal (opt_flags == 0) const int opt_flags = (type == SREQ_WIN && !(flags & SOPT_GLOBAL)) ? 0 : - (type == SREQ_GLOBAL) ? OPT_GLOBAL : OPT_LOCAL; + (type == SREQ_GLOBAL) ? OPT_GLOBAL : OPT_LOCAL; WITH_SCRIPT_CONTEXT(channel_id, { access_option_value_for(name.data, &numval, &stringval, opt_flags, type, to, false, err); diff --git a/src/nvim/api/private/converter.c b/src/nvim/api/private/converter.c index 7d04d883f5..a62f975cfd 100644 --- a/src/nvim/api/private/converter.c +++ b/src/nvim/api/private/converter.c @@ -51,7 +51,7 @@ typedef struct { const size_t len_ = (size_t)(len); \ const char *const str_ = (str); \ assert(len_ == 0 || str_ != NULL); \ - kvi_push(edata->stack, STRING_OBJ(cbuf_to_string((len_?str_:""), len_))); \ + kvi_push(edata->stack, STRING_OBJ(cbuf_to_string((len_ ? str_ : ""), len_))); \ } while (0) #define TYPVAL_ENCODE_CONV_STR_STRING TYPVAL_ENCODE_CONV_STRING @@ -275,7 +275,7 @@ bool object_to_vim(Object obj, typval_T *tv, Error *err) case kObjectTypeBoolean: tv->v_type = VAR_BOOL; - tv->vval.v_bool = obj.data.boolean? kBoolVarTrue: kBoolVarFalse; + tv->vval.v_bool = obj.data.boolean ? kBoolVarTrue : kBoolVarFalse; break; case kObjectTypeBuffer: |