diff options
author | Eliseo Martínez <eliseomarmol@gmail.com> | 2015-04-07 19:21:50 +0200 |
---|---|---|
committer | Eliseo Martínez <eliseomarmol@gmail.com> | 2015-04-07 19:21:50 +0200 |
commit | 6881d9705b78fcd2b30a9352c20ed21907471f1a (patch) | |
tree | 7b267cd84e0c5c3356fb6117e0691359da54c3d2 /src/nvim/option.c | |
parent | 5f3eeadd037e111e8ba5b04d39ff69806899ed6c (diff) | |
parent | 402c6fd939f088a623c5e2585b8826e7bf51dc53 (diff) | |
download | rneovim-6881d9705b78fcd2b30a9352c20ed21907471f1a.tar.gz rneovim-6881d9705b78fcd2b30a9352c20ed21907471f1a.tar.bz2 rneovim-6881d9705b78fcd2b30a9352c20ed21907471f1a.zip |
Merge #2228: Enable -Wconversion. (2)
Reviewed-by: oni-link <knil.ino@gmail.com>
Diffstat (limited to 'src/nvim/option.c')
-rw-r--r-- | src/nvim/option.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/nvim/option.c b/src/nvim/option.c index 2d016d8350..929b96a3f8 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -7653,18 +7653,22 @@ int check_ff_value(char_u *p) * Return the effective shiftwidth value for current buffer, using the * 'tabstop' value when 'shiftwidth' is zero. */ -long get_sw_value(buf_T *buf) +int get_sw_value(buf_T *buf) { - return buf->b_p_sw ? buf->b_p_sw : buf->b_p_ts; + long result = buf->b_p_sw ? buf->b_p_sw : buf->b_p_ts; + assert(result >= 0 && result <= INT_MAX); + return (int)result; } /* * Return the effective softtabstop value for the current buffer, using the * 'tabstop' value when 'softtabstop' is negative. */ -long get_sts_value(void) +int get_sts_value(void) { - return curbuf->b_p_sts < 0 ? get_sw_value(curbuf) : curbuf->b_p_sts; + long result = curbuf->b_p_sts < 0 ? get_sw_value(curbuf) : curbuf->b_p_sts; + assert(result >= 0 && result <= INT_MAX); + return (int)result; } /* |