diff options
author | ZyX <kp-pav@yandex.ru> | 2014-07-13 11:10:27 +0400 |
---|---|---|
committer | ZyX <kp-pav@yandex.ru> | 2016-04-18 02:43:43 +0300 |
commit | ebabdff5cd24f2d30ab35051d1d65f7c29fa3dd3 (patch) | |
tree | 0bae55f8b469efbef6df94dd16394ea334b22a55 /src/nvim/charset.c | |
parent | 83c683f5e15867c2e2889442860e91fd1074b4e1 (diff) | |
download | rneovim-ebabdff5cd24f2d30ab35051d1d65f7c29fa3dd3.tar.gz rneovim-ebabdff5cd24f2d30ab35051d1d65f7c29fa3dd3.tar.bz2 rneovim-ebabdff5cd24f2d30ab35051d1d65f7c29fa3dd3.zip |
keymap: Make replace_termcodes and friends accept length and cpo_flags
Reasons:
- One does not have to do `s[len] = NUL` to work with these functions if they do
not need to replace the whole string: thus `s` may be const.
- One does not have to save/restore p_cpo to work with them.
Diffstat (limited to 'src/nvim/charset.c')
-rw-r--r-- | src/nvim/charset.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/nvim/charset.c b/src/nvim/charset.c index 83e2aaa6e6..d0dc7b66fc 100644 --- a/src/nvim/charset.c +++ b/src/nvim/charset.c @@ -1794,10 +1794,11 @@ bool vim_isblankline(char_u *lbuf) /// @param nptr Returns the signed result. /// @param unptr Returns the unsigned result. /// @param maxlen Max length of string to check. -void vim_str2nr(char_u *start, int *prep, int *len, int what, - long *nptr, unsigned long *unptr, int maxlen) +void vim_str2nr(const char_u *const start, int *const prep, int *const len, + const int what, long *const nptr, unsigned long *const unptr, + const int maxlen) { - char_u *ptr = start; + const char_u *ptr = start; int pre = 0; // default is decimal bool negative = false; unsigned long un = 0; |