From f7e058a01ea288d1c6810562b1238c05bfaa30bc Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Wed, 22 Sep 2010 16:37:12 +0300 Subject: [PATCH] Eliminate separate fileIndexEntry from rpmal - This is exactly the same structure as availableIndexEntry, no need for a different struct for it. --- lib/rpmal.c | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/lib/rpmal.c b/lib/rpmal.c index 7ad1e8c..2f934c7 100644 --- a/lib/rpmal.c +++ b/lib/rpmal.c @@ -27,32 +27,19 @@ struct availablePackage_s { rpmfi fi; /*!< File info set. */ }; -typedef struct availableIndexEntry_s * availableIndexEntry; - /** \ingroup rpmdep * A single available item (e.g. a Provides: dependency). */ -struct availableIndexEntry_s { +typedef struct availableIndexEntry_s { rpmalNum pkgNum; /*!< Containing package index. */ unsigned int entryIx; /*!< Dependency index. */ -}; +} * availableIndexEntry; struct fileNameEntry_s { const char * dirName; const char * baseName; }; - -/** \ingroup rpmdep - * A file to be installed/removed. - */ -typedef struct fileIndexEntry_s * fileIndex; - -struct fileIndexEntry_s { - rpmalNum pkgNum; /*!< Containing package index. */ - unsigned int entryIx; -}; - #undef HASHTYPE #undef HTKEYTYPE #undef HTDATATYPE @@ -67,12 +54,10 @@ struct fileIndexEntry_s { #undef HTDATATYPE #define HASHTYPE rpmalFileHash #define HTKEYTYPE struct fileNameEntry_s -#define HTDATATYPE struct fileIndexEntry_s +#define HTDATATYPE struct availableIndexEntry_s #include "lib/rpmhash.H" #include "lib/rpmhash.C" - - /** \ingroup rpmdep * Set of available packages, items, and directories. */ @@ -171,7 +156,7 @@ void rpmalDel(rpmal al, rpmte p) static void rpmalAddFiles(rpmal al, rpmalNum pkgNum, rpmfi fi){ struct fileNameEntry_s fileName; - struct fileIndexEntry_s fileEntry; + struct availableIndexEntry_s fileEntry; int i; rpm_color_t ficolor; @@ -278,7 +263,7 @@ static rpmte * rpmalAllFileSatisfiesDepend(const rpmal al, const rpmds ds) /* Split path into dirname and basename components for lookup */ if ((slash = strrchr(fileName, '/')) != NULL) { - fileIndex result; + availableIndexEntry result; int resultCnt = 0; size_t bnStart = (slash - fileName) + 1; char dirName[bnStart + 1]; -- 2.7.4