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>

René Scharfe committed May 9, 2012 at 22:43 UTC be89977543c7798411f336236a506bf07b0a3d71
2 files changed -46
xdiff/xutils.c
-43
@@ -122,35 +122,6 @@ void *xdl_cha_alloc(chastore_t *cha) {
122 return data;
123 }
124
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 -
125 long xdl_guess_lines(mmfile_t *mf, long sample) {
126 long nl = 0, size, tsize = 0;
127 char const *data, *cur, *top;
@@ -430,20 +401,6 @@ int xdl_num_out(char *out, long val) {
401 return str - out;
402 }
403
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 -
404 int xdl_emit_hunk_hdr(long s1, long c1, long s2, long c2,
405 const char *func, long funclen, xdemitcb_t *ecb) {
406 int nb = 0;
xdiff/xutils.h
-3
@@ -31,14 +31,11 @@ int xdl_emit_diffrec(char const *rec, long size, char const *pre, long psize,
31 int xdl_cha_init(chastore_t *cha, long isize, long icount);
32 void xdl_cha_free(chastore_t *cha);
33 void *xdl_cha_alloc(chastore_t *cha);
34 -void *xdl_cha_first(chastore_t *cha);
35 -void *xdl_cha_next(chastore_t *cha);
34 long xdl_guess_lines(mmfile_t *mf, long sample);
35 int xdl_recmatch(const char *l1, long s1, const char *l2, long s2, long flags);
36 unsigned long xdl_hash_record(char const **data, char const *top, long flags);
37 unsigned int xdl_hashbits(unsigned int size);
38 int xdl_num_out(char *out, long val);
41 -long xdl_atol(char const *str, char const **next);
39 int xdl_emit_hunk_hdr(long s1, long c1, long s2, long c2,
40 const char *func, long funclen, xdemitcb_t *ecb);
41 int xdl_fall_back_diff(xdfenv_t *diff_env, xpparam_t const *xpp,