diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2019-07-28 21:30:17 -0400 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2019-07-28 22:19:11 -0400 |
commit | b388f462669199386a967afba6e299a033d37833 (patch) | |
tree | 2325cbb71cdf8317a98eeccc16fa8225889c62f4 /src | |
parent | 01e3690ca870276bfdc78d81a1bd75b7f1a78a9e (diff) | |
download | rneovim-b388f462669199386a967afba6e299a033d37833.tar.gz rneovim-b388f462669199386a967afba6e299a033d37833.tar.bz2 rneovim-b388f462669199386a967afba6e299a033d37833.zip |
buffer: add attributes to pure functions
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/buffer.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index 34fe52c10e..89f1e33a86 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -5171,18 +5171,21 @@ chk_modeline( // Return true if "buf" is a help buffer. bool bt_help(const buf_T *const buf) + FUNC_ATTR_PURE FUNC_ATTR_WARN_UNUSED_RESULT { return buf != NULL && buf->b_help; } // Return true if "buf" is the quickfix buffer. bool bt_quickfix(const buf_T *const buf) + FUNC_ATTR_PURE FUNC_ATTR_WARN_UNUSED_RESULT { return buf != NULL && buf->b_p_bt[0] == 'q'; } // Return true if "buf" is a terminal buffer. bool bt_terminal(const buf_T *const buf) + FUNC_ATTR_PURE FUNC_ATTR_WARN_UNUSED_RESULT { return buf != NULL && buf->b_p_bt[0] == 't'; } @@ -5190,6 +5193,7 @@ bool bt_terminal(const buf_T *const buf) // Return true if "buf" is a "nofile", "acwrite" or "terminal" buffer. // This means the buffer name is not a file name. bool bt_nofile(const buf_T *const buf) + FUNC_ATTR_PURE FUNC_ATTR_WARN_UNUSED_RESULT { return buf != NULL && ((buf->b_p_bt[0] == 'n' && buf->b_p_bt[2] == 'f') || buf->b_p_bt[0] == 'a' || buf->terminal); @@ -5197,11 +5201,13 @@ bool bt_nofile(const buf_T *const buf) // Return true if "buf" is a "nowrite", "nofile" or "terminal" buffer. bool bt_dontwrite(const buf_T *const buf) + FUNC_ATTR_PURE FUNC_ATTR_WARN_UNUSED_RESULT { return buf != NULL && (buf->b_p_bt[0] == 'n' || buf->terminal); } bool bt_dontwrite_msg(const buf_T *const buf) + FUNC_ATTR_PURE FUNC_ATTR_WARN_UNUSED_RESULT { if (bt_dontwrite(buf)) { EMSG(_("E382: Cannot write, 'buftype' option is set")); |