Skip to content

Commit be89977

Browse files
René Scharfegitster
authored andcommitted
xdiff: remove unused functions
The functions xdl_cha_first(), xdl_cha_next() and xdl_atol() are not used by us. While removing them increases the difference to the upstream version of libxdiff, it only adds a bit to the more than 600 differing lines in xutils.c (mmfile_t management was simplified significantly when the library was imported initially). Besides, if upstream modifies these functions in the future, we won't need to think about importing those changes, so in that sense it makes tracking modifications easier. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 3319e60 commit be89977

File tree

2 files changed

+0
-46
lines changed

2 files changed

+0
-46
lines changed

xdiff/xutils.c

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -122,35 +122,6 @@ void *xdl_cha_alloc(chastore_t *cha) {
122122
return data;
123123
}
124124

125-
126-
void *xdl_cha_first(chastore_t *cha) {
127-
chanode_t *sncur;
128-
129-
if (!(cha->sncur = sncur = cha->head))
130-
return NULL;
131-
132-
cha->scurr = 0;
133-
134-
return (char *) sncur + sizeof(chanode_t) + cha->scurr;
135-
}
136-
137-
138-
void *xdl_cha_next(chastore_t *cha) {
139-
chanode_t *sncur;
140-
141-
if (!(sncur = cha->sncur))
142-
return NULL;
143-
cha->scurr += cha->isize;
144-
if (cha->scurr == sncur->icurr) {
145-
if (!(sncur = cha->sncur = sncur->next))
146-
return NULL;
147-
cha->scurr = 0;
148-
}
149-
150-
return (char *) sncur + sizeof(chanode_t) + cha->scurr;
151-
}
152-
153-
154125
long xdl_guess_lines(mmfile_t *mf, long sample) {
155126
long nl = 0, size, tsize = 0;
156127
char const *data, *cur, *top;
@@ -430,20 +401,6 @@ int xdl_num_out(char *out, long val) {
430401
return str - out;
431402
}
432403

433-
434-
long xdl_atol(char const *str, char const **next) {
435-
long val, base;
436-
char const *top;
437-
438-
for (top = str; XDL_ISDIGIT(*top); top++);
439-
if (next)
440-
*next = top;
441-
for (val = 0, base = 1, top--; top >= str; top--, base *= 10)
442-
val += base * (long)(*top - '0');
443-
return val;
444-
}
445-
446-
447404
int xdl_emit_hunk_hdr(long s1, long c1, long s2, long c2,
448405
const char *func, long funclen, xdemitcb_t *ecb) {
449406
int nb = 0;

xdiff/xutils.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,11 @@ int xdl_emit_diffrec(char const *rec, long size, char const *pre, long psize,
3131
int xdl_cha_init(chastore_t *cha, long isize, long icount);
3232
void xdl_cha_free(chastore_t *cha);
3333
void *xdl_cha_alloc(chastore_t *cha);
34-
void *xdl_cha_first(chastore_t *cha);
35-
void *xdl_cha_next(chastore_t *cha);
3634
long xdl_guess_lines(mmfile_t *mf, long sample);
3735
int xdl_recmatch(const char *l1, long s1, const char *l2, long s2, long flags);
3836
unsigned long xdl_hash_record(char const **data, char const *top, long flags);
3937
unsigned int xdl_hashbits(unsigned int size);
4038
int xdl_num_out(char *out, long val);
41-
long xdl_atol(char const *str, char const **next);
4239
int xdl_emit_hunk_hdr(long s1, long c1, long s2, long c2,
4340
const char *func, long funclen, xdemitcb_t *ecb);
4441
int xdl_fall_back_diff(xdfenv_t *diff_env, xpparam_t const *xpp,

0 commit comments

Comments
 (0)