From b9cd5a5e746d1bb0da5d6ccef8d83e7867569168 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Tue, 21 Sep 2010 14:55:03 +0300 Subject: [PATCH] Avoid stepping on toes of relatives, part 1 - Eliminate uses of "this" which is a reserved keyword in C++ --- lib/depends.c | 12 ++++++------ lib/rpmte.c | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/depends.c b/lib/depends.c index d010765..177e21b 100644 --- a/lib/depends.c +++ b/lib/depends.c @@ -182,7 +182,7 @@ static int findPos(rpmts ts, rpm_color_t tscolor, Header h, int upgrade) /* XXX can't use rpmtsiNext() filter or oc will have wrong value. */ for (oc = 0; (p = rpmtsiNext(pi, 0)) != NULL; oc++) { - rpmds this, obsoletes; + rpmds thisds, obsoletes; /* Only added binary packages need checking */ if (rpmteType(p) == TR_REMOVED || rpmteIsSource(p)) @@ -199,10 +199,10 @@ static int findPos(rpmts ts, rpm_color_t tscolor, Header h, int upgrade) } /* Replace already added obsoleted packages by obsoleting package */ - this = rpmteDS(p, RPMTAG_NAME); + thisds = rpmteDS(p, RPMTAG_NAME); rpmdsInit(obsChk); while (rpmdsNext(obsChk) >= 0) { - if (rpmdsCompare(obsChk, this)) { + if (rpmdsCompare(obsChk, thisds)) { obsolete = 1; break; } @@ -225,14 +225,14 @@ static int findPos(rpmts ts, rpm_color_t tscolor, Header h, int upgrade) * Always skip identical NEVR. * On upgrade, if newer NEVR was previously added, skip adding older. */ - if (rpmdsCompare(sameChk, this) || - (upgrade && rpmdsCompare(newChk, this))) { + if (rpmdsCompare(sameChk, thisds) || + (upgrade && rpmdsCompare(newChk, thisds))) { oc = -1; break;; } /* On upgrade, if older NEVR was previously added, replace with new */ - if (upgrade && rpmdsCompare(oldChk, this) != 0) { + if (upgrade && rpmdsCompare(oldChk, thisds) != 0) { break; } } diff --git a/lib/rpmte.c b/lib/rpmte.c index 8a56601..976be60 100644 --- a/lib/rpmte.c +++ b/lib/rpmte.c @@ -40,7 +40,7 @@ struct rpmte_s { unsigned int db_instance; /*!< Database instance (of removed pkgs) */ tsortInfo tsi; /*!< Dependency ordering chains. */ - rpmds this; /*!< This package's provided NEVR. */ + rpmds thisds; /*!< This package's provided NEVR. */ rpmds provides; /*!< Provides: dependencies. */ rpmds requires; /*!< Requires: dependencies. */ rpmds conflicts; /*!< Conflicts: dependencies. */ @@ -77,7 +77,7 @@ static int rpmteClose(rpmte te, int reset_fi); void rpmteCleanDS(rpmte te) { - te->this = rpmdsFree(te->this); + te->thisds = rpmdsFree(te->thisds); te->provides = rpmdsFree(te->provides); te->requires = rpmdsFree(te->requires); te->conflicts = rpmdsFree(te->conflicts); @@ -219,7 +219,7 @@ static void addTE(rpmte p, Header h, fnpyKey key, rpmRelocation * relocs) p->pkgFileSize = 0; p->headerSize = headerSizeof(h, HEADER_MAGIC_NO); - p->this = rpmdsThis(h, RPMTAG_PROVIDENAME, RPMSENSE_EQUAL); + p->thisds = rpmdsThis(h, RPMTAG_PROVIDENAME, RPMSENSE_EQUAL); p->provides = rpmdsNew(h, RPMTAG_PROVIDENAME, 0); p->requires = rpmdsNew(h, RPMTAG_REQUIRENAME, 0); p->conflicts = rpmdsNew(h, RPMTAG_CONFLICTNAME, 0); @@ -519,7 +519,7 @@ rpmds rpmteDS(rpmte te, rpmTag tag) return NULL; switch (tag) { - case RPMTAG_NAME: return te->this; + case RPMTAG_NAME: return te->thisds; case RPMTAG_PROVIDENAME: return te->provides; case RPMTAG_REQUIRENAME: return te->requires; case RPMTAG_CONFLICTNAME: return te->conflicts; -- 2.7.4