diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2008-02-05 15:29:37 +0200 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2008-02-05 15:29:37 +0200 |
commit | 36e9f885e161395e2dfb033dcd7db1667764f273 (patch) | |
tree | 75f4632dc8e45bfcc6b8126f6a4172b1040b3977 | |
parent | ceb96638f6ceba45f353c132b104543404515fed (diff) | |
download | rpm-36e9f885e161395e2dfb033dcd7db1667764f273.tar.gz rpm-36e9f885e161395e2dfb033dcd7db1667764f273.tar.bz2 rpm-36e9f885e161395e2dfb033dcd7db1667764f273.zip |
Yet another typedef for transaction ID, use where spotted
- most remaining [u]int16|32 uses are indexes and such, ie actual numbers
-rw-r--r-- | lib/idtx.c | 4 | ||||
-rw-r--r-- | lib/psm.c | 2 | ||||
-rw-r--r-- | lib/rpmcli.h | 2 | ||||
-rw-r--r-- | lib/rpmts.c | 12 | ||||
-rw-r--r-- | lib/rpmts.h | 4 | ||||
-rw-r--r-- | lib/rpmts_internal.h | 2 | ||||
-rw-r--r-- | lib/rpmtypes.h | 1 | ||||
-rw-r--r-- | lib/tgi.c | 2 | ||||
-rw-r--r-- | lib/transaction.c | 6 | ||||
-rw-r--r-- | python/rpmts-py.c | 2 | ||||
-rw-r--r-- | rpmdb/rpmdb.c | 4 | ||||
-rw-r--r-- | tools/rpmcache.c | 4 |
12 files changed, 23 insertions, 22 deletions
diff --git a/lib/idtx.c b/lib/idtx.c index 8a9f5c1ce..9e6d2bf8c 100644 --- a/lib/idtx.c +++ b/lib/idtx.c @@ -81,7 +81,7 @@ IDTX IDTXload(rpmts ts, rpm_tag_t tag) while ((h = rpmdbNextIterator(mi)) != NULL) { rpm_tagtype_t type = RPM_NULL_TYPE; rpm_count_t count = 0; - int32_t * tidp; + rpm_tid_t * tidp; tidp = NULL; if (!hge(h, tag, &type, (rpm_data_t *)&tidp, &count) || tidp == NULL) @@ -115,7 +115,7 @@ IDTX IDTXglob(rpmts ts, const char * globstr, rpm_tag_t tag) IDTX idtx = NULL; HGE_t hge = (HGE_t) headerGetEntry; Header h; - int32_t * tidp; + rpm_tid_t * tidp; FD_t fd; char ** av = NULL; int ac = 0; @@ -1588,7 +1588,7 @@ assert(psm->mi == NULL); /* Add remove transaction id to header. */ if (psm->oh != NULL) - { int32_t tid = rpmtsGetTid(ts); + { rpm_tid_t tid = rpmtsGetTid(ts); xx = headerAddEntry(psm->oh, RPMTAG_REMOVETID, RPM_INT32_TYPE, &tid, 1); } diff --git a/lib/rpmcli.h b/lib/rpmcli.h index 3936f15c1..0327b2e72 100644 --- a/lib/rpmcli.h +++ b/lib/rpmcli.h @@ -422,7 +422,7 @@ struct rpmInstallArguments_s { rpmInstallInterfaceFlags installInterfaceFlags; rpmEraseInterfaceFlags eraseInterfaceFlags; rpmQueryFlags qva_flags; /*!< from --nodigest/--nosignature */ - uint32_t rbtid; /*!< from --rollback */ + rpm_tid_t rbtid; /*!< from --rollback */ int numRelocations; int noDeps; int incldocs; diff --git a/lib/rpmts.c b/lib/rpmts.c index 191842673..fdecf1b0a 100644 --- a/lib/rpmts.c +++ b/lib/rpmts.c @@ -497,7 +497,7 @@ rpmRC rpmtsImportPubkey(const rpmts ts, const unsigned char * pkt, size_t pktlen /* XXX W2DO: tag value inheirited from parent? */ xx = headerAddEntry(h, RPMTAG_BUILDHOST, RPM_STRING_TYPE, buildhost, 1); - { int32_t tid = rpmtsGetTid(ts); + { rpm_tid_t tid = rpmtsGetTid(ts); xx = headerAddEntry(h, RPMTAG_INSTALLTIME, RPM_INT32_TYPE, &tid, 1); /* XXX W2DO: tag value inheirited from parent? */ xx = headerAddEntry(h, RPMTAG_BUILDTIME, RPM_INT32_TYPE, &tid, 1); @@ -1121,18 +1121,18 @@ int rpmtsSetChrootDone(rpmts ts, int chrootDone) return ochrootDone; } -int32_t rpmtsGetTid(rpmts ts) +rpm_tid_t rpmtsGetTid(rpmts ts) { - int32_t tid = -1; /* XXX -1 is time(2) error return. */ + rpm_tid_t tid = -1; /* XXX -1 is time(2) error return. */ if (ts != NULL) { tid = ts->tid; } return tid; } -int32_t rpmtsSetTid(rpmts ts, int32_t tid) +rpm_tid_t rpmtsSetTid(rpmts ts, rpm_tid_t tid) { - int32_t otid = -1; /* XXX -1 is time(2) error return. */ + rpm_tid_t otid = -1; /* XXX -1 is time(2) error return. */ if (ts != NULL) { otid = ts->tid; ts->tid = tid; @@ -1552,7 +1552,7 @@ rpmts rpmtsCreate(void) ts->dbmode = O_RDONLY; ts->scriptFd = NULL; - ts->tid = (int32_t) time(NULL); + ts->tid = (rpm_tid_t) time(NULL); ts->delta = 5; ts->color = rpmExpandNumeric("%{?_transaction_color}"); diff --git a/lib/rpmts.h b/lib/rpmts.h index 69080192b..8b086198d 100644 --- a/lib/rpmts.h +++ b/lib/rpmts.h @@ -507,7 +507,7 @@ int rpmtsSetChrootDone(rpmts ts, int chrootDone); * @param ts transaction set * @return transaction id */ -int32_t rpmtsGetTid(rpmts ts); +rpm_tid_t rpmtsGetTid(rpmts ts); /** \ingroup rpmts * Set transaction id, i.e. transaction time stamp. @@ -515,7 +515,7 @@ int32_t rpmtsGetTid(rpmts ts); * @param tid new transaction id * @return previous transaction id */ -int32_t rpmtsSetTid(rpmts ts, int32_t tid); +rpm_tid_t rpmtsSetTid(rpmts ts, rpm_tid_t tid); /** \ingroup rpmts * Get signature tag. diff --git a/lib/rpmts_internal.h b/lib/rpmts_internal.h index ff0404fad..c8d47ad0c 100644 --- a/lib/rpmts_internal.h +++ b/lib/rpmts_internal.h @@ -90,7 +90,7 @@ struct rpmts_s { char * currDir; /*!< Current working directory. */ FD_t scriptFd; /*!< Scriptlet stdout/stderr. */ int delta; /*!< Delta for reallocation. */ - int32_t tid; /*!< Transaction id. */ + rpm_tid_t tid; /*!< Transaction id. */ rpm_color_t color; /*!< Transaction color bits. */ rpm_color_t prefcolor; /*!< Preferred file color. */ diff --git a/lib/rpmtypes.h b/lib/rpmtypes.h index d673bafaf..499d0424c 100644 --- a/lib/rpmtypes.h +++ b/lib/rpmtypes.h @@ -34,6 +34,7 @@ typedef const void * rpm_constdata_t; typedef uint32_t rpm_color_t; typedef uint32_t rpm_flag_t; +typedef int32_t rpm_tid_t; /** @} */ /** \ingroup rpmtypes @@ -117,7 +117,7 @@ main(int argc, char *argv[]) vsflags |= RPMVSF_NOHDRCHK; (void) rpmtsSetVSFlags(ts, vsflags); - { int32_t tid = (int32_t) time(NULL); + { rpm_tid_t tid = (rpm_tid_t) time(NULL); (void) rpmtsSetTid(ts, tid); } diff --git a/lib/transaction.c b/lib/transaction.c index d23127fd0..3b32801f7 100644 --- a/lib/transaction.c +++ b/lib/transaction.c @@ -886,7 +886,7 @@ static rpmRC _rpmtsRollback(rpmts rollbackTransaction) int rc = 0; int numAdded = 0; int numRemoved = 0; - int32_t tid; + rpm_tid_t tid; rpmtsi tsi; rpmte te; rpmps ps; @@ -1009,7 +1009,7 @@ static rpmRC getRepackageHeaderFromTE(rpmts ts, rpmte te, Header *hdrp, const char **fnp) { - int32_t tid; + rpm_tid_t tid; const char * name; const char * rpname = NULL; const char * _repackage_dir = NULL; @@ -1375,7 +1375,7 @@ int rpmtsRun(rpmts ts, rpmps okProbs, rpmprobFilterFlags ignoreSet) (void) rpmtsSetChrootDone(ts, 0); - { int32_t tid = (int32_t) time(NULL); + { rpm_tid_t tid = (rpm_tid_t) time(NULL); (void) rpmtsSetTid(ts, tid); } diff --git a/python/rpmts-py.c b/python/rpmts-py.c index 17b8d1f23..16d1eae28 100644 --- a/python/rpmts-py.c +++ b/python/rpmts-py.c @@ -584,7 +584,7 @@ rpmts_Rollback(rpmtsObject * s, PyObject * args, PyObject * kwds) struct rpmInstallArguments_s * ia = alloca(sizeof(*ia)); rpmtransFlags transFlags; const char ** av = NULL; - uint32_t rbtid; + rpm_tid_t rbtid; int rc; char * kwlist[] = {"transactionId", NULL}; diff --git a/rpmdb/rpmdb.c b/rpmdb/rpmdb.c index e564b4edf..ac0bbc172 100644 --- a/rpmdb/rpmdb.c +++ b/rpmdb/rpmdb.c @@ -2450,7 +2450,7 @@ memset(data, 0, sizeof(*data)); #ifdef DYING /* Add remove transaction id to header. */ if (rid != 0 && rid != -1) { - int32_t tid = rid; + rpm_tid_t tid = rid; (void) headerAddEntry(h, RPMTAG_REMOVETID, RPM_INT32_TYPE, &tid, 1); } #endif @@ -2730,7 +2730,7 @@ memset(data, 0, sizeof(*data)); xx = headerRemoveEntry(h, RPMTAG_REMOVETID); #endif if (iid != 0 && iid != -1) { - int32_t tid = iid; + rpm_tid_t tid = iid; if (!headerIsEntry(h, RPMTAG_INSTALLTID)) xx = headerAddEntry(h, RPMTAG_INSTALLTID, RPM_INT32_TYPE, &tid, 1); } diff --git a/tools/rpmcache.c b/tools/rpmcache.c index 43bb2bf8c..23f08c0d4 100644 --- a/tools/rpmcache.c +++ b/tools/rpmcache.c @@ -107,7 +107,7 @@ static int ftsCachePrint(rpmts ts, FILE * fp) static int ftsCacheUpdate(rpmts ts) { HGE_t hge = (HGE_t)headerGetEntryMinMemory; - int32_t tid = rpmtsGetTid(ts); + rpm_tid_t tid = rpmtsGetTid(ts); rpmdbMatchIterator mi; unsigned char * md5; int rc = 0; @@ -572,7 +572,7 @@ main(int argc, char *argv[]) vsflags |= RPMVSF_NOHDRCHK; (void) rpmtsSetVSFlags(ts, vsflags); - { int32_t tid = (int32_t) time(NULL); + { rpm_tid_t tid = (rpm_tid_t) time(NULL); (void) rpmtsSetTid(ts, tid); } |