mirror of
https://github.com/vim/vim.git
synced 2025-07-25 10:54:51 -04:00
patch 8.1.0366: pieces of the xdiff code are not used
Problem: Pieces of the xdiff code are not used. Solution: Add "#if 0" to omit unused code.
This commit is contained in:
parent
4c7b08f640
commit
007921611b
@ -794,6 +794,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
366,
|
||||||
/**/
|
/**/
|
||||||
365,
|
365,
|
||||||
/**/
|
/**/
|
||||||
|
@ -95,6 +95,7 @@ xdchange_t *xdl_get_hunk(xdchange_t **xscr, xdemitconf_t const *xecfg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#if 0
|
||||||
static long def_ff(const char *rec, long len, char *buf, long sz, void *priv UNUSED)
|
static long def_ff(const char *rec, long len, char *buf, long sz, void *priv UNUSED)
|
||||||
{
|
{
|
||||||
if (len > 0 &&
|
if (len > 0 &&
|
||||||
@ -110,7 +111,9 @@ static long def_ff(const char *rec, long len, char *buf, long sz, void *priv UNU
|
|||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if 0
|
||||||
static long match_func_rec(xdfile_t *xdf, xdemitconf_t const *xecfg, long ri,
|
static long match_func_rec(xdfile_t *xdf, xdemitconf_t const *xecfg, long ri,
|
||||||
char *buf, long sz)
|
char *buf, long sz)
|
||||||
{
|
{
|
||||||
@ -120,18 +123,22 @@ static long match_func_rec(xdfile_t *xdf, xdemitconf_t const *xecfg, long ri,
|
|||||||
return def_ff(rec, len, buf, sz, xecfg->find_func_priv);
|
return def_ff(rec, len, buf, sz, xecfg->find_func_priv);
|
||||||
return xecfg->find_func(rec, len, buf, sz, xecfg->find_func_priv);
|
return xecfg->find_func(rec, len, buf, sz, xecfg->find_func_priv);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if 0
|
||||||
static int is_func_rec(xdfile_t *xdf, xdemitconf_t const *xecfg, long ri)
|
static int is_func_rec(xdfile_t *xdf, xdemitconf_t const *xecfg, long ri)
|
||||||
{
|
{
|
||||||
char dummy[1];
|
char dummy[1];
|
||||||
return match_func_rec(xdf, xecfg, ri, dummy, sizeof(dummy)) >= 0;
|
return match_func_rec(xdf, xecfg, ri, dummy, sizeof(dummy)) >= 0;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
struct func_line {
|
struct func_line {
|
||||||
long len;
|
long len;
|
||||||
char buf[80];
|
char buf[80];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#if 0
|
||||||
static long get_func_line(xdfenv_t *xe, xdemitconf_t const *xecfg,
|
static long get_func_line(xdfenv_t *xe, xdemitconf_t const *xecfg,
|
||||||
struct func_line *func_line, long start, long limit)
|
struct func_line *func_line, long start, long limit)
|
||||||
{
|
{
|
||||||
@ -151,7 +158,9 @@ static long get_func_line(xdfenv_t *xe, xdemitconf_t const *xecfg,
|
|||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if 0
|
||||||
static int is_empty_rec(xdfile_t *xdf, long ri)
|
static int is_empty_rec(xdfile_t *xdf, long ri)
|
||||||
{
|
{
|
||||||
const char *rec;
|
const char *rec;
|
||||||
@ -163,12 +172,15 @@ static int is_empty_rec(xdfile_t *xdf, long ri)
|
|||||||
}
|
}
|
||||||
return !len;
|
return !len;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
int xdl_emit_diff(xdfenv_t *xe, xdchange_t *xscr, xdemitcb_t *ecb,
|
int xdl_emit_diff(xdfenv_t *xe, xdchange_t *xscr, xdemitcb_t *ecb,
|
||||||
xdemitconf_t const *xecfg) {
|
xdemitconf_t const *xecfg) {
|
||||||
long s1, s2, e1, e2, lctx;
|
long s1, s2, e1, e2, lctx;
|
||||||
xdchange_t *xch, *xche;
|
xdchange_t *xch, *xche;
|
||||||
|
#if 0
|
||||||
long funclineprev = -1;
|
long funclineprev = -1;
|
||||||
|
#endif
|
||||||
struct func_line func_line;
|
struct func_line func_line;
|
||||||
|
|
||||||
func_line.len = 0;
|
func_line.len = 0;
|
||||||
@ -181,6 +193,7 @@ int xdl_emit_diff(xdfenv_t *xe, xdchange_t *xscr, xdemitcb_t *ecb,
|
|||||||
s1 = XDL_MAX(xch->i1 - xecfg->ctxlen, 0);
|
s1 = XDL_MAX(xch->i1 - xecfg->ctxlen, 0);
|
||||||
s2 = XDL_MAX(xch->i2 - xecfg->ctxlen, 0);
|
s2 = XDL_MAX(xch->i2 - xecfg->ctxlen, 0);
|
||||||
|
|
||||||
|
#if 0
|
||||||
if (xecfg->flags & XDL_EMIT_FUNCCONTEXT) {
|
if (xecfg->flags & XDL_EMIT_FUNCCONTEXT) {
|
||||||
long fs1, i1 = xch->i1;
|
long fs1, i1 = xch->i1;
|
||||||
|
|
||||||
@ -218,6 +231,7 @@ int xdl_emit_diff(xdfenv_t *xe, xdchange_t *xscr, xdemitcb_t *ecb,
|
|||||||
}
|
}
|
||||||
|
|
||||||
post_context_calculation:
|
post_context_calculation:
|
||||||
|
#endif
|
||||||
lctx = xecfg->ctxlen;
|
lctx = xecfg->ctxlen;
|
||||||
lctx = XDL_MIN(lctx, xe->xdf1.nrec - (xche->i1 + xche->chg1));
|
lctx = XDL_MIN(lctx, xe->xdf1.nrec - (xche->i1 + xche->chg1));
|
||||||
lctx = XDL_MIN(lctx, xe->xdf2.nrec - (xche->i2 + xche->chg2));
|
lctx = XDL_MIN(lctx, xe->xdf2.nrec - (xche->i2 + xche->chg2));
|
||||||
@ -225,6 +239,7 @@ int xdl_emit_diff(xdfenv_t *xe, xdchange_t *xscr, xdemitcb_t *ecb,
|
|||||||
e1 = xche->i1 + xche->chg1 + lctx;
|
e1 = xche->i1 + xche->chg1 + lctx;
|
||||||
e2 = xche->i2 + xche->chg2 + lctx;
|
e2 = xche->i2 + xche->chg2 + lctx;
|
||||||
|
|
||||||
|
#if 0
|
||||||
if (xecfg->flags & XDL_EMIT_FUNCCONTEXT) {
|
if (xecfg->flags & XDL_EMIT_FUNCCONTEXT) {
|
||||||
long fe1 = get_func_line(xe, xecfg, NULL,
|
long fe1 = get_func_line(xe, xecfg, NULL,
|
||||||
xche->i1 + xche->chg1,
|
xche->i1 + xche->chg1,
|
||||||
@ -253,16 +268,19 @@ int xdl_emit_diff(xdfenv_t *xe, xdchange_t *xscr, xdemitcb_t *ecb,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Emit current hunk header.
|
* Emit current hunk header.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#if 0
|
||||||
if (xecfg->flags & XDL_EMIT_FUNCNAMES) {
|
if (xecfg->flags & XDL_EMIT_FUNCNAMES) {
|
||||||
get_func_line(xe, xecfg, &func_line,
|
get_func_line(xe, xecfg, &func_line,
|
||||||
s1 - 1, funclineprev);
|
s1 - 1, funclineprev);
|
||||||
funclineprev = s1 - 1;
|
funclineprev = s1 - 1;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
if (xdl_emit_hunk_hdr(s1 + 1, e1 - s1, s2 + 1, e2 - s2,
|
if (xdl_emit_hunk_hdr(s1 + 1, e1 - s1, s2 + 1, e2 - s2,
|
||||||
func_line.buf, func_line.len, ecb) < 0)
|
func_line.buf, func_line.len, ecb) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user