aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/normal.c
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2019-01-15 22:20:26 +0100
committerJustin M. Keyes <justinkz@gmail.com>2019-01-18 00:09:50 +0100
commited171f7be29f7337aaba8c420406afc8a58c1613 (patch)
treeecee5c4316c5e02603b3f779ea769b4698d8d21f /src/nvim/normal.c
parentdca0da4e3fa68b3da28a4571488e2c7d805615cf (diff)
downloadrneovim-ed171f7be29f7337aaba8c420406afc8a58c1613.tar.gz
rneovim-ed171f7be29f7337aaba8c420406afc8a58c1613.tar.bz2
rneovim-ed171f7be29f7337aaba8c420406afc8a58c1613.zip
PVS/V1028: cast operands, not the result
Diffstat (limited to 'src/nvim/normal.c')
-rw-r--r--src/nvim/normal.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/nvim/normal.c b/src/nvim/normal.c
index 0e3946740a..0dc5f3175d 100644
--- a/src/nvim/normal.c
+++ b/src/nvim/normal.c
@@ -3284,11 +3284,11 @@ void clear_showcmd(void)
p_sbr = empty_option;
getvcols(curwin, &curwin->w_cursor, &VIsual, &leftcol, &rightcol);
p_sbr = saved_sbr;
- sprintf((char *)showcmd_buf, "%" PRId64 "x%" PRId64,
- (int64_t)lines, (int64_t)(rightcol - leftcol + 1));
- } else if (VIsual_mode == 'V' || VIsual.lnum != curwin->w_cursor.lnum)
- sprintf((char *)showcmd_buf, "%" PRId64, (int64_t)lines);
- else {
+ snprintf((char *)showcmd_buf, SHOWCMD_BUFLEN, "%" PRId64 "x%" PRId64,
+ (int64_t)lines, (int64_t)rightcol - leftcol + 1);
+ } else if (VIsual_mode == 'V' || VIsual.lnum != curwin->w_cursor.lnum) {
+ snprintf((char *)showcmd_buf, SHOWCMD_BUFLEN, "%" PRId64, (int64_t)lines);
+ } else {
char_u *s, *e;
int l;
int bytes = 0;
@@ -4930,10 +4930,10 @@ get_visual_text (
} else {
if (lt(curwin->w_cursor, VIsual)) {
*pp = ml_get_pos(&curwin->w_cursor);
- *lenp = (size_t)(VIsual.col - curwin->w_cursor.col + 1);
+ *lenp = (size_t)VIsual.col - (size_t)curwin->w_cursor.col + 1;
} else {
*pp = ml_get_pos(&VIsual);
- *lenp = (size_t)(curwin->w_cursor.col - VIsual.col + 1);
+ *lenp = (size_t)curwin->w_cursor.col - (size_t)VIsual.col + 1;
}
if (has_mbyte)
/* Correct the length to include the whole last character. */