aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/buffer.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/buffer.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/buffer.c')
-rw-r--r--src/nvim/buffer.c31
1 files changed, 15 insertions, 16 deletions
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c
index f498fca6ad..a6e3fedd3f 100644
--- a/src/nvim/buffer.c
+++ b/src/nvim/buffer.c
@@ -918,13 +918,15 @@ do_buffer (
if (buf == NULL) { /* could not find it */
if (start == DOBUF_FIRST) {
- /* don't warn when deleting */
- if (!unload)
+ // don't warn when deleting
+ if (!unload) {
EMSGN(_(e_nobufnr), count);
- } else if (dir == FORWARD)
+ }
+ } else if (dir == FORWARD) {
EMSG(_("E87: Cannot go beyond last buffer"));
- else
+ } else {
EMSG(_("E88: Cannot go before first buffer"));
+ }
return FAIL;
}
@@ -1711,18 +1713,15 @@ static buf_T *buflist_findname_file_id(char_u *ffname, FileID *file_id,
return NULL;
}
-/*
- * Find file in buffer list by a regexp pattern.
- * Return fnum of the found buffer.
- * Return < 0 for error.
- */
-int
-buflist_findpat (
- char_u *pattern,
- char_u *pattern_end, /* pointer to first char after pattern */
- int unlisted, /* find unlisted buffers */
- int diffmode, /* find diff-mode buffers only */
- int curtab_only /* find buffers in current tab only */
+/// Find file in buffer list by a regexp pattern.
+/// Return fnum of the found buffer.
+/// Return < 0 for error.
+int buflist_findpat(
+ const char_u *pattern,
+ const char_u *pattern_end, // pointer to first char after pattern
+ int unlisted, // find unlisted buffers
+ int diffmode, // find diff-mode buffers only
+ int curtab_only // find buffers in current tab only
)
{
int match = -1;