* [PATCH] xdiff: remove unused functions
@ 2012-05-09 20:43 René Scharfe
2012-05-09 21:14 ` Junio C Hamano
0 siblings, 1 reply; 2+ messages in thread
From: René Scharfe @ 2012-05-09 20:43 UTC (permalink / raw)
To: git discussion list; +Cc: Junio C Hamano
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>
---
xdiff/xutils.c | 43 -------------------------------------------
xdiff/xutils.h | 3 ---
2 files changed, 46 deletions(-)
diff --git a/xdiff/xutils.c b/xdiff/xutils.c
index 1b3b471..ae6ce0d 100644
--- a/xdiff/xutils.c
+++ b/xdiff/xutils.c
@@ -122,35 +122,6 @@ void *xdl_cha_alloc(chastore_t *cha) {
return data;
}
-
-void *xdl_cha_first(chastore_t *cha) {
- chanode_t *sncur;
-
- if (!(cha->sncur = sncur = cha->head))
- return NULL;
-
- cha->scurr = 0;
-
- return (char *) sncur + sizeof(chanode_t) + cha->scurr;
-}
-
-
-void *xdl_cha_next(chastore_t *cha) {
- chanode_t *sncur;
-
- if (!(sncur = cha->sncur))
- return NULL;
- cha->scurr += cha->isize;
- if (cha->scurr == sncur->icurr) {
- if (!(sncur = cha->sncur = sncur->next))
- return NULL;
- cha->scurr = 0;
- }
-
- return (char *) sncur + sizeof(chanode_t) + cha->scurr;
-}
-
-
long xdl_guess_lines(mmfile_t *mf, long sample) {
long nl = 0, size, tsize = 0;
char const *data, *cur, *top;
@@ -430,20 +401,6 @@ int xdl_num_out(char *out, long val) {
return str - out;
}
-
-long xdl_atol(char const *str, char const **next) {
- long val, base;
- char const *top;
-
- for (top = str; XDL_ISDIGIT(*top); top++);
- if (next)
- *next = top;
- for (val = 0, base = 1, top--; top >= str; top--, base *= 10)
- val += base * (long)(*top - '0');
- return val;
-}
-
-
int xdl_emit_hunk_hdr(long s1, long c1, long s2, long c2,
const char *func, long funclen, xdemitcb_t *ecb) {
int nb = 0;
diff --git a/xdiff/xutils.h b/xdiff/xutils.h
index 714719a..ad1428e 100644
--- a/xdiff/xutils.h
+++ b/xdiff/xutils.h
@@ -31,14 +31,11 @@ int xdl_emit_diffrec(char const *rec, long size, char const *pre, long psize,
int xdl_cha_init(chastore_t *cha, long isize, long icount);
void xdl_cha_free(chastore_t *cha);
void *xdl_cha_alloc(chastore_t *cha);
-void *xdl_cha_first(chastore_t *cha);
-void *xdl_cha_next(chastore_t *cha);
long xdl_guess_lines(mmfile_t *mf, long sample);
int xdl_recmatch(const char *l1, long s1, const char *l2, long s2, long flags);
unsigned long xdl_hash_record(char const **data, char const *top, long flags);
unsigned int xdl_hashbits(unsigned int size);
int xdl_num_out(char *out, long val);
-long xdl_atol(char const *str, char const **next);
int xdl_emit_hunk_hdr(long s1, long c1, long s2, long c2,
const char *func, long funclen, xdemitcb_t *ecb);
int xdl_fall_back_diff(xdfenv_t *diff_env, xpparam_t const *xpp,
--
1.7.10.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] xdiff: remove unused functions
2012-05-09 20:43 [PATCH] xdiff: remove unused functions René Scharfe
@ 2012-05-09 21:14 ` Junio C Hamano
0 siblings, 0 replies; 2+ messages in thread
From: Junio C Hamano @ 2012-05-09 21:14 UTC (permalink / raw)
To: René Scharfe; +Cc: git discussion list
René Scharfe <rene.scharfe@lsrfire.ath.cx> writes:
> 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.
I was of two minds wondering the exact pros-and-cons you described above,
but OK, let's shrink it.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-05-09 21:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-09 20:43 [PATCH] xdiff: remove unused functions René Scharfe
2012-05-09 21:14 ` Junio C Hamano
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).