Mercurial > vim
changeset 2675:f987220caa57 v7.3.094
updated for version 7.3.094
Problem: Using abs() requires type cast to int.
Solution: Use labs() so that the value remains long. (Hong Xu)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Thu, 30 Dec 2010 14:57:08 +0100 |
parents | f921368d43c3 |
children | 8464d084fa74 |
files | src/screen.c src/version.c |
diffstat | 2 files changed, 4 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/screen.c +++ b/src/screen.c @@ -2317,7 +2317,7 @@ fold_line(wp, fold_count, foldinfo, lnum num = (long)lnum; else /* 'relativenumber', don't use negative numbers */ - num = (long)abs((int)get_cursor_rel_lnum(wp, lnum)); + num = labs((long)get_cursor_rel_lnum(wp, lnum)); sprintf((char *)buf, "%*ld ", w, num); #ifdef FEAT_RIGHTLEFT @@ -3475,8 +3475,7 @@ win_line(wp, lnum, startrow, endrow, noc num = (long)lnum; else /* 'relativenumber', don't use negative numbers */ - num = (long)abs((int)get_cursor_rel_lnum(wp, - lnum)); + num = labs((long)get_cursor_rel_lnum(wp, lnum)); sprintf((char *)extra, "%*ld ", number_width(wp), num);