diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2008-02-05 12:12:31 +0200 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2008-02-05 12:12:31 +0200 |
commit | 630a5a4c1a34f12ae264cba870005de0858353e6 (patch) | |
tree | b41a60681da0f7e77f13a9e5dd9760ed8d10f5ce /lib | |
parent | b12cb085232a586ebca8673ee766d9d6e826c8dd (diff) | |
download | librpm-tizen-630a5a4c1a34f12ae264cba870005de0858353e6.tar.gz librpm-tizen-630a5a4c1a34f12ae264cba870005de0858353e6.tar.bz2 librpm-tizen-630a5a4c1a34f12ae264cba870005de0858353e6.zip |
Add rpm_color_t type for rpm color bits, use where spotted
Diffstat (limited to 'lib')
-rw-r--r-- | lib/depends.c | 18 | ||||
-rw-r--r-- | lib/psm.c | 2 | ||||
-rw-r--r-- | lib/rpmal.c | 16 | ||||
-rw-r--r-- | lib/rpmal.h | 4 | ||||
-rw-r--r-- | lib/rpmds.c | 10 | ||||
-rw-r--r-- | lib/rpmds.h | 2 | ||||
-rw-r--r-- | lib/rpmfi.c | 12 | ||||
-rw-r--r-- | lib/rpmfi.h | 4 | ||||
-rw-r--r-- | lib/rpmfi_internal.h | 4 | ||||
-rw-r--r-- | lib/rpmte.c | 10 | ||||
-rw-r--r-- | lib/rpmte.h | 4 | ||||
-rw-r--r-- | lib/rpmte_internal.h | 2 | ||||
-rw-r--r-- | lib/rpmts.c | 8 | ||||
-rw-r--r-- | lib/rpmts.h | 6 | ||||
-rw-r--r-- | lib/rpmts_internal.h | 4 | ||||
-rw-r--r-- | lib/rpmtypes.h | 2 | ||||
-rw-r--r-- | lib/transaction.c | 20 |
17 files changed, 65 insertions, 63 deletions
diff --git a/lib/depends.c b/lib/depends.c index 797a6df7f..8fea08858 100644 --- a/lib/depends.c +++ b/lib/depends.c @@ -106,12 +106,12 @@ static int removePackage(rpmts ts, Header h, int dboffset, int rpmtsAddInstallElement(rpmts ts, Header h, fnpyKey key, int upgrade, rpmRelocation * relocs) { - uint32_t tscolor = rpmtsColor(ts); - uint32_t dscolor; - uint32_t hcolor; + rpm_color_t tscolor = rpmtsColor(ts); + rpm_color_t dscolor; + rpm_color_t hcolor; + rpm_color_t ohcolor; rpmdbMatchIterator mi; Header oh; - uint32_t ohcolor; int isSource; int duplicate = 0; rpmtsi pi = NULL; rpmte p; @@ -559,9 +559,9 @@ exit: */ static int checkPackageDeps(rpmts ts, const char * pkgNEVRA, rpmds requires, rpmds conflicts, - const char * depName, uint32_t tscolor, int adding) + const char * depName, rpm_color_t tscolor, int adding) { - uint32_t dscolor; + rpm_color_t dscolor; const char * Name; int rc; int ourrc = 0; @@ -1003,7 +1003,7 @@ static int orderListIndexCmp(const void * one, const void * two) static void addQ(rpmte p, rpmte * qp, rpmte * rp, - uint32_t prefcolor) + rpm_color_t prefcolor) { rpmte q, qprev; @@ -1045,7 +1045,7 @@ int rpmtsOrder(rpmts ts) { rpmds requires; rpmsenseFlags Flags; - uint32_t prefcolor = rpmtsPrefColor(ts); + rpm_color_t prefcolor = rpmtsPrefColor(ts); rpmtsi pi; rpmte p; rpmtsi qi; rpmte q; rpmtsi ri; rpmte r; @@ -1479,7 +1479,7 @@ assert(newOrderCount == ts->orderCount); int rpmtsCheck(rpmts ts) { - uint32_t tscolor = rpmtsColor(ts); + rpm_color_t tscolor = rpmtsColor(ts); rpmdbMatchIterator mi = NULL; rpmtsi pi = NULL; rpmte p; int closeatexit = 0; @@ -1289,7 +1289,7 @@ static int rpmpsmNext(rpmpsm psm, pkgStage nstage) rpmRC rpmpsmStage(rpmpsm psm, pkgStage stage) { const rpmts ts = psm->ts; - uint32_t tscolor = rpmtsColor(ts); + rpm_color_t tscolor = rpmtsColor(ts); rpmfi fi = psm->fi; HGE_t hge = fi->hge; HFD_t hfd = (fi->hfd ? fi->hfd : headerFreeData); diff --git a/lib/rpmal.c b/lib/rpmal.c index 7a47b6fe9..a835f8134 100644 --- a/lib/rpmal.c +++ b/lib/rpmal.c @@ -23,7 +23,7 @@ struct availablePackage_s { rpmds provides; /*!< Provides: dependencies. */ rpmfi fi; /*!< File info set. */ - uint32_t tscolor; /*!< Transaction color bits. */ + rpm_color_t tscolor; /*!< Transaction color bits. */ fnpyKey key; /*!< Associated file name/python object */ @@ -64,7 +64,7 @@ struct fileIndexEntry_s { const char * baseName; /*!< File basename. */ int baseNameLen; rpmalNum pkgNum; /*!< Containing package index. */ - uint32_t ficolor; + rpm_color_t ficolor; }; typedef struct dirInfo_s * dirInfo; @@ -88,7 +88,7 @@ struct rpmal_s { int delta; /*!< Delta for pkg list reallocation. */ int size; /*!< No. of pkgs in list. */ int alloced; /*!< No. of pkgs allocated for list. */ - uint32_t tscolor; /*!< Transaction color. */ + rpm_color_t tscolor; /*!< Transaction color. */ int numDirs; /*!< No. of directories. */ dirInfo dirs; /*!< Set of directories. */ }; @@ -321,7 +321,7 @@ fprintf(stderr, " die[%5d] memset(%p,0,0x%lx)\n", al->numDirs, al->dirs + al- } rpmalKey rpmalAdd(rpmal * alistp, rpmalKey pkgKey, fnpyKey key, - rpmds provides, rpmfi fi, uint32_t tscolor) + rpmds provides, rpmfi fi, rpm_color_t tscolor) { rpmalNum pkgNum; rpmal al; @@ -505,9 +505,9 @@ static int indexcmp(const void * one, const void * two) return strcmp(a->entry, b->entry); } -void rpmalAddProvides(rpmal al, rpmalKey pkgKey, rpmds provides, uint32_t tscolor) +void rpmalAddProvides(rpmal al, rpmalKey pkgKey, rpmds provides, rpm_color_t tscolor) { - uint32_t dscolor; + rpm_color_t dscolor; const char * Name; rpmalNum pkgNum = alKey2Num(al, pkgKey); availableIndex ai = &al->index; @@ -578,8 +578,8 @@ void rpmalMakeIndex(rpmal al) fnpyKey * rpmalAllFileSatisfiesDepend(const rpmal al, const rpmds ds, rpmalKey * keyp) { - uint32_t tscolor; - uint32_t ficolor; + rpm_color_t tscolor; + rpm_color_t ficolor; int found = 0; char * dirName; const char * baseName; diff --git a/lib/rpmal.h b/lib/rpmal.h index da808c70e..ebb5dab08 100644 --- a/lib/rpmal.h +++ b/lib/rpmal.h @@ -56,7 +56,7 @@ rpmalKey rpmalAdd(rpmal * alistp, rpmalKey pkgKey, fnpyKey key, rpmds provides, rpmfi fi, - uint32_t tscolor); + rpm_color_t tscolor); /** * Add package provides to available list index. @@ -67,7 +67,7 @@ rpmalKey rpmalAdd(rpmal * alistp, */ void rpmalAddProvides(rpmal al, rpmalKey pkgKey, - rpmds provides, uint32_t tscolor); + rpmds provides, rpm_color_t tscolor); /** * Generate index for available list. diff --git a/lib/rpmds.c b/lib/rpmds.c index 62fd2e79b..e6a3afeda 100644 --- a/lib/rpmds.c +++ b/lib/rpmds.c @@ -32,7 +32,7 @@ struct rpmds_s { const char ** N; /*!< Name. */ const char ** EVR; /*!< Epoch-Version-Release. */ rpmsenseFlags * Flags; /*!< Bit(s) identifying context/comparison. */ - uint32_t * Color; /*!< Bit(s) calculated from file color(s). */ + rpm_color_t * Color; /*!< Bit(s) calculated from file color(s). */ int32_t * Refs; /*!< No. of file refs. */ time_t BT; /*!< Package build time tie breaker. */ rpm_tag_t tagN; /*!< Header tag. */ @@ -439,9 +439,9 @@ int rpmdsSetNoPromote(rpmds ds, int nopromote) return onopromote; } -uint32_t rpmdsColor(const rpmds ds) +rpm_color_t rpmdsColor(const rpmds ds) { - uint32_t Color = 0; + rpm_color_t Color = 0; if (ds != NULL && ds->i >= 0 && ds->i < ds->Count) { if (ds->Color != NULL) @@ -450,9 +450,9 @@ uint32_t rpmdsColor(const rpmds ds) return Color; } -uint32_t rpmdsSetColor(const rpmds ds, uint32_t color) +rpm_color_t rpmdsSetColor(const rpmds ds, rpm_color_t color) { - uint32_t ocolor = 0; + rpm_color_t ocolor = 0; if (ds != NULL && ds->i >= 0 && ds->i < ds->Count) { if (ds->Color != NULL) { diff --git a/lib/rpmds.h b/lib/rpmds.h index 75403bbab..ef0d65c23 100644 --- a/lib/rpmds.h +++ b/lib/rpmds.h @@ -258,7 +258,7 @@ uint32_t rpmdsColor(const rpmds ds); * @param color new dependency color * @return previous dependency color */ -uint32_t rpmdsSetColor(const rpmds ds, uint32_t color); +rpm_color_t rpmdsSetColor(const rpmds ds, rpm_color_t color); /** \ingroup rpmds * Return current dependency file refs. diff --git a/lib/rpmfi.c b/lib/rpmfi.c index b1e012695..05431bcf2 100644 --- a/lib/rpmfi.c +++ b/lib/rpmfi.c @@ -226,9 +226,9 @@ uint32_t rpmfiFInode(rpmfi fi) return finode; } -uint32_t rpmfiColor(rpmfi fi) +rpm_color_t rpmfiColor(rpmfi fi) { - uint32_t color = 0; + rpm_color_t color = 0; if (fi != NULL) /* XXX ignore all but lsnibble for now. */ @@ -236,9 +236,9 @@ uint32_t rpmfiColor(rpmfi fi) return color; } -uint32_t rpmfiFColor(rpmfi fi) +rpm_color_t rpmfiFColor(rpmfi fi) { - uint32_t fcolor = 0; + rpm_color_t fcolor = 0; if (fi != NULL && fi->i >= 0 && fi->i < fi->fc) { if (fi->fcolors != NULL) @@ -634,8 +634,8 @@ Header relocateFileList(const rpmts ts, rpmfi fi, uint32_t * newDirIndexes; rpm_count_t fileCount, dirCount, numValid; uint32_t * fFlags = NULL; - uint32_t * fColors = NULL; - uint32_t * dColors = NULL; + rpm_color_t * fColors = NULL; + rpm_color_t * dColors = NULL; uint16_t * fModes = NULL; Header h; int nrelocated = 0; diff --git a/lib/rpmfi.h b/lib/rpmfi.h index 690b03592..3dd202a36 100644 --- a/lib/rpmfi.h +++ b/lib/rpmfi.h @@ -244,14 +244,14 @@ uint32_t rpmfiFInode(rpmfi fi); * @param fi file info set * @return current color */ -uint32_t rpmfiColor(rpmfi fi); +rpm_color_t rpmfiColor(rpmfi fi); /** \ingroup rpmfi * Return current file color bits from file info set. * @param fi file info set * @return current file color */ -uint32_t rpmfiFColor(rpmfi fi); +rpm_color_t rpmfiFColor(rpmfi fi); /** \ingroup rpmfi * Return current file class from file info set. diff --git a/lib/rpmfi_internal.h b/lib/rpmfi_internal.h index 30124fd09..9060b18fc 100644 --- a/lib/rpmfi_internal.h +++ b/lib/rpmfi_internal.h @@ -58,7 +58,7 @@ struct rpmfi_s { char * fstates; /*!< File state(s) (from header) */ - const uint32_t * fcolors; /*!< File color bits (header) */ + const rpm_color_t * fcolors;/*!< File color bits (header) */ const char ** fcontexts; /*! FIle security contexts. */ @@ -117,7 +117,7 @@ struct rpmfi_s { int * fmapflags; FSM_t fsm; /*!< File state machine data. */ int keep_header; /*!< Keep header? */ - uint32_t color; /*!< Color bit(s) from file color union. */ + rpm_color_t color; /*!< Color bit(s) from file color union. */ sharedFileInfo replaced; /*!< (TR_ADDED) */ rpm_off_t * replacedSizes; /*!< (TR_ADDED) */ unsigned int record; /*!< (TR_REMOVED) */ diff --git a/lib/rpmte.c b/lib/rpmte.c index 3de5d1e25..67c218d01 100644 --- a/lib/rpmte.c +++ b/lib/rpmte.c @@ -285,14 +285,14 @@ int rpmteIsSource(rpmte te) return (te != NULL ? te->isSource : 0); } -uint32_t rpmteColor(rpmte te) +rpm_color_t rpmteColor(rpmte te) { return (te != NULL ? te->color : 0); } -uint32_t rpmteSetColor(rpmte te, uint32_t color) +rpm_color_t rpmteSetColor(rpmte te, rpm_color_t color) { - int ocolor = 0; + rpm_color_t ocolor = 0; if (te != NULL) { ocolor = te->color; te->color = color; @@ -512,9 +512,9 @@ void rpmteColorDS(rpmte te, rpm_tag_t tag) char deptype = 'R'; char mydt; const uint32_t * ddict; - int32_t * colors; + rpm_color_t * colors; int32_t * refs; - int32_t val; + rpm_color_t val; int Count; size_t nb; unsigned ix; diff --git a/lib/rpmte.h b/lib/rpmte.h index fa426a6cf..c37975460 100644 --- a/lib/rpmte.h +++ b/lib/rpmte.h @@ -134,7 +134,7 @@ extern int rpmteIsSource(rpmte te); * @param te transaction element * @return color bits */ -uint32_t rpmteColor(rpmte te); +rpm_color_t rpmteColor(rpmte te); /** \ingroup rpmte * Set color bits of transaction element. @@ -142,7 +142,7 @@ uint32_t rpmteColor(rpmte te); * @param color new color bits * @return previous color bits */ -uint32_t rpmteSetColor(rpmte te, uint32_t color); +rpm_color_t rpmteSetColor(rpmte te, rpm_color_t color); /** \ingroup rpmte * Retrieve last instance installed to the database. diff --git a/lib/rpmte_internal.h b/lib/rpmte_internal.h index 2101b6d95..8e3f60442 100644 --- a/lib/rpmte_internal.h +++ b/lib/rpmte_internal.h @@ -54,7 +54,7 @@ struct rpmte_s { rpmds obsoletes; /*!< Obsoletes: dependencies. */ rpmfi fi; /*!< File information. */ - uint32_t color; /*!< Color bit(s) from package dependencies. */ + rpm_color_t color; /*!< Color bit(s) from package dependencies. */ rpm_off_t pkgFileSize; /*!< No. of bytes in package file (approx). */ fnpyKey key; /*!< (TR_ADDED) Retrieval key. */ diff --git a/lib/rpmts.c b/lib/rpmts.c index bb83da35d..191842673 100644 --- a/lib/rpmts.c +++ b/lib/rpmts.c @@ -1462,14 +1462,14 @@ rpmte rpmtsSetRelocateElement(rpmts ts, rpmte relocateElement) return orelocateElement; } -uint32_t rpmtsColor(rpmts ts) +rpm_color_t rpmtsColor(rpmts ts) { return (ts != NULL ? ts->color : 0); } -uint32_t rpmtsSetColor(rpmts ts, uint32_t color) +rpm_color_t rpmtsSetColor(rpmts ts, rpm_color_t color) { - uint32_t ocolor = 0; + rpm_color_t ocolor = 0; if (ts != NULL) { ocolor = ts->color; ts->color = color; @@ -1477,7 +1477,7 @@ uint32_t rpmtsSetColor(rpmts ts, uint32_t color) return ocolor; } -uint32_t rpmtsPrefColor(rpmts ts) +rpm_color_t rpmtsPrefColor(rpmts ts) { return (ts != NULL ? ts->prefcolor : 0); } diff --git a/lib/rpmts.h b/lib/rpmts.h index 049629c6c..69080192b 100644 --- a/lib/rpmts.h +++ b/lib/rpmts.h @@ -697,14 +697,14 @@ rpmte rpmtsSetRelocateElement(rpmts ts, rpmte relocateElement); * @param ts transaction set * @return color bits */ -uint32_t rpmtsColor(rpmts ts); +rpm_color_t rpmtsColor(rpmts ts); /** \ingroup rpmts * Retrieve prefered file color * @param ts transaction set * @return color bits */ -uint32_t rpmtsPrefColor(rpmts ts); +rpm_color_t rpmtsPrefColor(rpmts ts); /** \ingroup rpmts * Set color bits of transaction set. @@ -712,7 +712,7 @@ uint32_t rpmtsPrefColor(rpmts ts); * @param color new color bits * @return previous color bits */ -uint32_t rpmtsSetColor(rpmts ts, uint32_t color); +rpm_color_t rpmtsSetColor(rpmts ts, rpm_color_t color); /** \ingroup rpmts * Retrieve operation timestamp from a transaction set. diff --git a/lib/rpmts_internal.h b/lib/rpmts_internal.h index 0af9f0f3f..ff0404fad 100644 --- a/lib/rpmts_internal.h +++ b/lib/rpmts_internal.h @@ -92,8 +92,8 @@ struct rpmts_s { int delta; /*!< Delta for reallocation. */ int32_t tid; /*!< Transaction id. */ - uint32_t color; /*!< Transaction color bits. */ - uint32_t prefcolor; /*!< Preferred file color. */ + rpm_color_t color; /*!< Transaction color bits. */ + rpm_color_t prefcolor; /*!< Preferred file color. */ rpmVSFlags vsflags; /*!< Signature/digest verification flags. */ diff --git a/lib/rpmtypes.h b/lib/rpmtypes.h index a535b3b6b..a55b74a93 100644 --- a/lib/rpmtypes.h +++ b/lib/rpmtypes.h @@ -24,6 +24,8 @@ typedef uint32_t rpm_count_t; typedef void * rpm_data_t; typedef const void * rpm_constdata_t; +typedef uint32_t rpm_color_t; + typedef uint32_t rpm_off_t; typedef uint32_t rpm_time_t; diff --git a/lib/transaction.c b/lib/transaction.c index 420457c00..0aab8542c 100644 --- a/lib/transaction.c +++ b/lib/transaction.c @@ -72,10 +72,10 @@ static int handleInstInstalledFiles(const rpmts ts, sharedFileInfo shared, int sharedCount, int reportConflicts) { - uint32_t tscolor = rpmtsColor(ts); - uint32_t prefcolor = rpmtsPrefColor(ts); - uint32_t otecolor, tecolor; - uint32_t oFColor, FColor; + rpm_color_t tscolor = rpmtsColor(ts); + rpm_color_t prefcolor = rpmtsPrefColor(ts); + rpm_color_t otecolor, tecolor; + rpm_color_t oFColor, FColor; char * altNEVR = NULL; rpmfi otherFi = NULL; int numReplaced = 0; @@ -379,9 +379,9 @@ static void handleOverlappedFiles(const rpmts ts, fi = rpmfiInit(fi, 0); if (fi != NULL) while ((i = rpmfiNext(fi)) >= 0) { - uint32_t tscolor = rpmtsColor(ts); - uint32_t prefcolor = rpmtsPrefColor(ts); - uint32_t oFColor, FColor; + rpm_color_t tscolor = rpmtsColor(ts); + rpm_color_t prefcolor = rpmtsPrefColor(ts); + rpm_color_t oFColor, FColor; struct fingerPrint_s * fiFps; int otherPkgNum, otherFileNum; rpmfi otherFi; @@ -641,8 +641,8 @@ static int ensureOlder(rpmts ts, /* FIX: fi->actions is modified. */ static void skipFiles(const rpmts ts, rpmfi fi) { - uint32_t tscolor = rpmtsColor(ts); - uint32_t FColor; + rpm_color_t tscolor = rpmtsColor(ts); + rpm_color_t FColor; int noConfigs = (rpmtsFlags(ts) & RPMTRANS_FLAG_NOCONFIGS); int noDocs = (rpmtsFlags(ts) & RPMTRANS_FLAG_NODOCS); char ** netsharedPaths = NULL; @@ -1288,7 +1288,7 @@ cleanup: int rpmtsRun(rpmts ts, rpmps okProbs, rpmprobFilterFlags ignoreSet) { - uint32_t tscolor = rpmtsColor(ts); + rpm_color_t tscolor = rpmtsColor(ts); int i, j; int ourrc = 0; int totalFileCount = 0; |