mirror of
https://github.com/neovim/neovim.git
synced 2025-10-08 02:46:31 +00:00
PVS/V1028: cast operands, not the result #10502
This commit is contained in:

committed by
Justin M. Keyes

parent
8a3f8589a3
commit
6316247da3
@@ -1471,7 +1471,8 @@ int op_delete(oparg_T *oap)
|
|||||||
// copy up to deleted part
|
// copy up to deleted part
|
||||||
memmove(newp, oldp, (size_t)bd.textcol);
|
memmove(newp, oldp, (size_t)bd.textcol);
|
||||||
// insert spaces
|
// insert spaces
|
||||||
memset(newp + bd.textcol, ' ', (size_t)(bd.startspaces + bd.endspaces));
|
memset(newp + bd.textcol, ' ', (size_t)bd.startspaces +
|
||||||
|
(size_t)bd.endspaces);
|
||||||
// copy the part after the deleted part
|
// copy the part after the deleted part
|
||||||
oldp += bd.textcol + bd.textlen;
|
oldp += bd.textcol + bd.textlen;
|
||||||
STRMOVE(newp + bd.textcol + bd.startspaces + bd.endspaces, oldp);
|
STRMOVE(newp + bd.textcol + bd.startspaces + bd.endspaces, oldp);
|
||||||
@@ -1743,7 +1744,7 @@ int op_replace(oparg_T *oap, int c)
|
|||||||
oldp = get_cursor_line_ptr();
|
oldp = get_cursor_line_ptr();
|
||||||
oldlen = (int)STRLEN(oldp);
|
oldlen = (int)STRLEN(oldp);
|
||||||
|
|
||||||
size_t newp_size = (size_t)(bd.textcol + bd.startspaces);
|
size_t newp_size = (size_t)bd.textcol + (size_t)bd.startspaces;
|
||||||
if (had_ctrl_v_cr || (c != '\r' && c != '\n')) {
|
if (had_ctrl_v_cr || (c != '\r' && c != '\n')) {
|
||||||
newp_size += (size_t)numc;
|
newp_size += (size_t)numc;
|
||||||
if (!bd.is_short) {
|
if (!bd.is_short) {
|
||||||
|
Reference in New Issue
Block a user