diff src/xdiff/xdiffi.c @ 14730:193471015e1a v8.1.0377

patch 8.1.0377: xdiff doesn't use the Vim memory allocation functions commit https://github.com/vim/vim/commit/42335f50bc6fac444a8af74c81df8369d722a6fb Author: Bram Moolenaar <Bram@vim.org> Date: Thu Sep 13 15:33:43 2018 +0200 patch 8.1.0377: xdiff doesn't use the Vim memory allocation functions Problem: Xdiff doesn't use the Vim memory allocation functions. Solution: Change the xdl_ defines. Check for out-of-memory. Rename "ignored" to "vim_ignored".
author Christian Brabandt <cb@256bit.org>
date Thu, 13 Sep 2018 15:45:05 +0200
parents 195e8b1fcbbf
children 3be01cf0a632
line wrap: on
line diff
--- a/src/xdiff/xdiffi.c
+++ b/src/xdiff/xdiffi.c
@@ -392,9 +392,9 @@ static int recs_match(xrecord_t *rec1, x
 }
 
 /*
- * If a line is indented more than this, get_indent() just returns this value.
+ * If a line is indented more than this, xget_indent() just returns this value.
  * This avoids having to do absurd amounts of work for data that are not
- * human-readable text, and also ensures that the output of get_indent fits within
+ * human-readable text, and also ensures that the output of xget_indent fits within
  * an int.
  */
 #define MAX_INDENT 200
@@ -404,7 +404,7 @@ static int recs_match(xrecord_t *rec1, x
  * columns. Return -1 if line is empty or contains only whitespace. Clamp the
  * output value at MAX_INDENT.
  */
-static int get_indent(xrecord_t *rec)
+static int xget_indent(xrecord_t *rec)
 {
 	long i;
 	int ret = 0;
@@ -492,13 +492,13 @@ static void measure_split(const xdfile_t
 		m->indent = -1;
 	} else {
 		m->end_of_file = 0;
-		m->indent = get_indent(xdf->recs[split]);
+		m->indent = xget_indent(xdf->recs[split]);
 	}
 
 	m->pre_blank = 0;
 	m->pre_indent = -1;
 	for (i = split - 1; i >= 0; i--) {
-		m->pre_indent = get_indent(xdf->recs[i]);
+		m->pre_indent = xget_indent(xdf->recs[i]);
 		if (m->pre_indent != -1)
 			break;
 		m->pre_blank += 1;
@@ -511,7 +511,7 @@ static void measure_split(const xdfile_t
 	m->post_blank = 0;
 	m->post_indent = -1;
 	for (i = split + 1; i < xdf->nrec; i++) {
-		m->post_indent = get_indent(xdf->recs[i]);
+		m->post_indent = xget_indent(xdf->recs[i]);
 		if (m->post_indent != -1)
 			break;
 		m->post_blank += 1;