From e1943248855756174c445870716cc98ebf16b30e Mon Sep 17 00:00:00 2001 From: Eliseo Martínez Date: Fri, 25 Apr 2014 12:59:27 +0200 Subject: 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. --- src/fold.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/fold.c') 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 -- cgit