From: Guillem Jover Date: Tue, 22 Jan 2008 08:35:12 +0000 (+0200) Subject: libdpkg: Remove dead verrevcmp function X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=50739385a384eeafe2ce3d213ce74512827eaed8;p=dpkg libdpkg: Remove dead verrevcmp function --- diff --git a/ChangeLog b/ChangeLog index 527cb67e..885181ba 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2008-01-22 Guillem Jover + + * lib/vercmp.c [0] (verrevcmp): Remove dead code. + 2008-01-22 Guillem Jover * lib/dpkg.h [!offsetof] (offsetof): New compatibilty macro. diff --git a/lib/vercmp.c b/lib/vercmp.c index 5e9b006c..2360724f 100644 --- a/lib/vercmp.c +++ b/lib/vercmp.c @@ -65,42 +65,6 @@ static int verrevcmp(const char *val, const char *ref) { return 0; } - -#if 0 -static int verrevcmp(const char *ival, const char *iref) { - static char empty[] = ""; - int vc, rc; - long vl, rl; - char *vp, *rp; - char *val, *ref; - memcpy(&val,&ival,sizeof(char*)); - memcpy(&ref,&iref,sizeof(char*)); - - if (!val) val= empty; - if (!ref) ref= empty; - for (;;) { - vp= val; while (*vp && !isdigit(*vp)) vp++; - rp= ref; while (*rp && !isdigit(*rp)) rp++; - for (;;) { - vc= val == vp ? 0 : *val++; - rc= ref == rp ? 0 : *ref++; - if (!rc && !vc) break; - if (vc && !isalpha(vc)) vc += 256; /* assumes ASCII character set */ - if (rc && !isalpha(rc)) rc += 256; - if (vc != rc) return vc - rc; - } - val= vp; - ref= rp; - vl=0; if (isdigit(*vp)) vl= strtol(val,&val,10); - rl=0; if (isdigit(*rp)) rl= strtol(ref,&ref,10); - if (vl != rl) return vl - rl; - if (!*val && !*ref) return 0; - if (!*val) return -1; - if (!*ref) return +1; - } -} -#endif - int versioncompare(const struct versionrevision *version, const struct versionrevision *refversion) { int r;