aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJames McCoy <jamessan@jamessan.com>2017-12-15 15:57:38 -0500
committerJames McCoy <jamessan@jamessan.com>2017-12-15 15:57:38 -0500
commitdcb2780b834d4df006f55a0475e03bd2a38ac344 (patch)
tree1c2aa0dbd479f322fa6d8221b9f141fc6e2d3a44 /src
parentd5bce42b524708a54243658e87b1e3bd9c7acdf3 (diff)
downloadrneovim-dcb2780b834d4df006f55a0475e03bd2a38ac344.tar.gz
rneovim-dcb2780b834d4df006f55a0475e03bd2a38ac344.tar.bz2
rneovim-dcb2780b834d4df006f55a0475e03bd2a38ac344.zip
lint
Diffstat (limited to 'src')
-rw-r--r--src/nvim/memline.c29
-rw-r--r--src/nvim/regexp.c16
2 files changed, 21 insertions, 24 deletions
diff --git a/src/nvim/memline.c b/src/nvim/memline.c
index fde21f7992..80775c607d 100644
--- a/src/nvim/memline.c
+++ b/src/nvim/memline.c
@@ -1743,11 +1743,11 @@ ml_get_buf (
if (lnum > buf->b_ml.ml_line_count) { /* invalid line number */
if (recursive == 0) {
- /* Avoid giving this message for a recursive call, may happen when
- * the GUI redraws part of the text. */
- ++recursive;
+ // Avoid giving this message for a recursive call, may happen when
+ // the GUI redraws part of the text.
+ recursive++;
IEMSGN(_("E315: ml_get: invalid lnum: %" PRId64), lnum);
- --recursive;
+ recursive--;
}
errorret:
STRCPY(IObuff, "???");
@@ -1775,11 +1775,11 @@ errorret:
*/
if ((hp = ml_find_line(buf, lnum, ML_FIND)) == NULL) {
if (recursive == 0) {
- /* Avoid giving this message for a recursive call, may happen
- * when the GUI redraws part of the text. */
- ++recursive;
+ // Avoid giving this message for a recursive call, may happen
+ // when the GUI redraws part of the text.
+ recursive++;
IEMSGN(_("E316: ml_get: cannot find line %" PRId64), lnum);
- --recursive;
+ recursive--;
}
goto errorret;
}
@@ -2631,9 +2631,9 @@ static void ml_flush_line(buf_T *buf)
new_line = buf->b_ml.ml_line_ptr;
hp = ml_find_line(buf, lnum, ML_FIND);
- if (hp == NULL)
+ if (hp == NULL) {
IEMSGN(_("E320: Cannot find line %" PRId64), lnum);
- else {
+ } else {
dp = hp->bh_data;
idx = lnum - buf->b_ml.ml_locked_low;
start = ((dp->db_index[idx]) & DB_INDEX_MASK);
@@ -2879,13 +2879,14 @@ static bhdr_T *ml_find_line(buf_T *buf, linenr_T lnum, int action)
break;
}
}
- if (idx >= (int)pp->pb_count) { /* past the end: something wrong! */
- if (lnum > buf->b_ml.ml_line_count)
+ if (idx >= (int)pp->pb_count) { // past the end: something wrong!
+ if (lnum > buf->b_ml.ml_line_count) {
IEMSGN(_("E322: line number out of range: %" PRId64 " past the end"),
- lnum - buf->b_ml.ml_line_count);
+ lnum - buf->b_ml.ml_line_count);
- else
+ } else {
IEMSGN(_("E323: line count wrong in block %" PRId64), bnum);
+ }
goto error_block;
}
if (action == ML_DELETE) {
diff --git a/src/nvim/regexp.c b/src/nvim/regexp.c
index e921706b3a..ec9916f4a2 100644
--- a/src/nvim/regexp.c
+++ b/src/nvim/regexp.c
@@ -458,17 +458,13 @@ static int toggle_Magic(int x)
/* Used for an error (down from) vim_regcomp(): give the error message, set
* rc_did_emsg and return NULL */
-#define EMSG_RET_NULL(m) return (EMSG(m), rc_did_emsg = TRUE, (void *)NULL)
+#define EMSG_RET_NULL(m) return (EMSG(m), rc_did_emsg = true, (void *)NULL)
#define IEMSG_RET_NULL(m) return (IEMSG(m), rc_did_emsg = true, (void *)NULL)
-#define EMSG_RET_FAIL(m) return (EMSG(m), rc_did_emsg = TRUE, FAIL)
-#define EMSG2_RET_NULL(m, \
- c) return (EMSG2((m), \
- (c) ? "" : "\\"), rc_did_emsg = true, \
- (void *)NULL)
-#define EMSG2_RET_FAIL(m, \
- c) return (EMSG2((m), \
- (c) ? "" : "\\"), rc_did_emsg = true, \
- FAIL)
+#define EMSG_RET_FAIL(m) return (EMSG(m), rc_did_emsg = true, FAIL)
+#define EMSG2_RET_NULL(m, c) \
+ return (EMSG2((m), (c) ? "" : "\\"), rc_did_emsg = true, (void *)NULL)
+#define EMSG2_RET_FAIL(m, c) \
+ return (EMSG2((m), (c) ? "" : "\\"), rc_did_emsg = true, FAIL)
#define EMSG_ONE_RET_NULL EMSG2_RET_NULL(_( \
"E369: invalid item in %s%%[]"), reg_magic == MAGIC_ALL)