aboutsummaryrefslogtreecommitdiff
path: root/src/fold.c
diff options
context:
space:
mode:
authorEliseo Martínez <eliseomarmol@gmail.com>2014-04-25 12:59:27 +0200
committerThiago de Arruda <tpadilha84@gmail.com>2014-04-28 07:59:25 -0300
commite1943248855756174c445870716cc98ebf16b30e (patch)
treec91b252241aecf5f25641ea3c6249dc8a08d1dae /src/fold.c
parentb8520b8ee403388f94fda7306f1713bfa1ffae8a (diff)
downloadrneovim-e1943248855756174c445870716cc98ebf16b30e.tar.gz
rneovim-e1943248855756174c445870716cc98ebf16b30e.tar.bz2
rneovim-e1943248855756174c445870716cc98ebf16b30e.zip
Use portable format specifiers: Clarify some casted expressions.
Though correct (to my understanding), some of the casts introduced in previous commits could lead to confusion, by casting only the first expression component instead of the whole expression. This fixes that, parenthesizing casted expressions, except where operator precedence rules make it unneccesary.
Diffstat (limited to 'src/fold.c')
-rw-r--r--src/fold.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/fold.c b/src/fold.c
index 275e6c6d6a..38432a79aa 100644
--- a/src/fold.c
+++ b/src/fold.c
@@ -2958,8 +2958,8 @@ static int put_folds_recurse(FILE *fd, garray_T *gap, linenr_T off)
if (put_folds_recurse(fd, &fp->fd_nested, off + fp->fd_top) == FAIL)
return FAIL;
if (fprintf(fd, "%" PRId64 ",%" PRId64 "fold",
- (int64_t)fp->fd_top + off,
- (int64_t)fp->fd_top + off + fp->fd_len - 1) < 0
+ (int64_t)(fp->fd_top + off),
+ (int64_t)(fp->fd_top + off + fp->fd_len - 1)) < 0
|| put_eol(fd) == FAIL)
return FAIL;
++fp;
@@ -2983,7 +2983,7 @@ static int put_foldopen_recurse(FILE *fd, win_T *wp, garray_T *gap, linenr_T off
if (fp->fd_flags != FD_LEVEL) {
if (fp->fd_nested.ga_len > 0) {
/* open nested folds while this fold is open */
- if (fprintf(fd, "%" PRId64, (int64_t)fp->fd_top + off) < 0
+ if (fprintf(fd, "%" PRId64, (int64_t)(fp->fd_top + off)) < 0
|| put_eol(fd) == FAIL
|| put_line(fd, "normal! zo") == FAIL)
return FAIL;
@@ -3020,7 +3020,7 @@ static int put_foldopen_recurse(FILE *fd, win_T *wp, garray_T *gap, linenr_T off
*/
static int put_fold_open_close(FILE *fd, fold_T *fp, linenr_T off)
{
- if (fprintf(fd, "%" PRId64, (int64_t)fp->fd_top + off) < 0
+ if (fprintf(fd, "%" PRId64, (int64_t)(fp->fd_top + off)) < 0
|| put_eol(fd) == FAIL
|| fprintf(fd, "normal! z%c",
fp->fd_flags == FD_CLOSED ? 'c' : 'o') < 0