aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ops.c
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2015-12-26 20:12:24 -0500
committerJustin M. Keyes <justinkz@gmail.com>2016-01-01 14:26:32 -0500
commit3fd62f961294d11fff5754a3c597e982b54ca74a (patch)
treec02ae5c2f393f5019071fb441b1e19b121ab731a /src/nvim/ops.c
parent76bf21de26340a93005deea0c2f846edc6fc3743 (diff)
downloadrneovim-3fd62f961294d11fff5754a3c597e982b54ca74a.tar.gz
rneovim-3fd62f961294d11fff5754a3c597e982b54ca74a.tar.bz2
rneovim-3fd62f961294d11fff5754a3c597e982b54ca74a.zip
file_pat_to_reg_pat, buflist_findpat: const params
file_pat_to_reg_pat() and buflist_findpat() do not modify the data of these parameters.
Diffstat (limited to 'src/nvim/ops.c')
-rw-r--r--src/nvim/ops.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/src/nvim/ops.c b/src/nvim/ops.c
index 159b4c03e7..2b1056e90e 100644
--- a/src/nvim/ops.c
+++ b/src/nvim/ops.c
@@ -703,18 +703,16 @@ char_u *get_expr_line_src(void)
/// @param writing allow only writable registers
bool valid_yank_reg(int regname, bool writing)
{
- if ( (regname > 0 && ASCII_ISALNUM(regname))
- || (!writing && vim_strchr((char_u *)
- "/.%:="
- , regname) != NULL)
- || regname == '#'
- || regname == '"'
- || regname == '-'
- || regname == '_'
- || regname == '*'
- || regname == '+'
- )
+ if ((regname > 0 && ASCII_ISALNUM(regname))
+ || (!writing && vim_strchr((char_u *) "/.%:=" , regname) != NULL)
+ || regname == '#'
+ || regname == '"'
+ || regname == '-'
+ || regname == '_'
+ || regname == '*'
+ || regname == '+') {
return true;
+ }
return false;
}
@@ -4666,11 +4664,12 @@ void write_reg_contents_ex(int name,
int num = atoi((char *)str);
buf = buflist_findnr(num);
- if (buf == NULL)
+ if (buf == NULL) {
EMSGN(_(e_nobufnr), (long)num);
+ }
} else {
buf = buflist_findnr(buflist_findpat(str, str + STRLEN(str),
- true, false, false));
+ true, false, false));
}
if (buf == NULL) {
return;