From 9b0967588abde9599751a6ede176fa429202dd72 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Tue, 5 Feb 2008 13:09:13 +0200 Subject: More rpm-headerdata types: rpm_dev_t and rpm_ino_t, use where spotted - both hardwired to 32bit internally --- build/files.c | 8 ++++---- lib/rpmfi.c | 6 +++--- lib/rpmfi.h | 2 +- lib/rpmfi_internal.h | 2 +- lib/rpmtypes.h | 2 ++ 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/build/files.c b/build/files.c index 0709d9b3e..c268128ea 100644 --- a/build/files.c +++ b/build/files.c @@ -1161,16 +1161,16 @@ static void genCpioListAndHeader(FileList fl, (void) headerAddOrAppendEntry(h, RPMTAG_FILERDEVS, RPM_INT16_TYPE, &(flp->fl_rdev), 1); } - if (sizeof(flp->fl_dev) != sizeof(uint32_t)) { - uint32_t pdevice = (uint32_t)flp->fl_dev; + if (sizeof(flp->fl_dev) != sizeof(rpm_dev_t)) { + rpm_dev_t pdevice = (rpm_dev_t)flp->fl_dev; (void) headerAddOrAppendEntry(h, RPMTAG_FILEDEVICES, RPM_INT32_TYPE, &(pdevice), 1); } else { (void) headerAddOrAppendEntry(h, RPMTAG_FILEDEVICES, RPM_INT32_TYPE, &(flp->fl_dev), 1); } - if (sizeof(flp->fl_ino) != sizeof(uint32_t)) { - uint32_t ino = (uint32_t)flp->fl_ino; + if (sizeof(flp->fl_ino) != sizeof(rpm_ino_t)) { + rpm_ino_t ino = (rpm_ino_t)flp->fl_ino; (void) headerAddOrAppendEntry(h, RPMTAG_FILEINODES, RPM_INT32_TYPE, &(ino), 1); } else { diff --git a/lib/rpmfi.c b/lib/rpmfi.c index d476865c9..92022984b 100644 --- a/lib/rpmfi.c +++ b/lib/rpmfi.c @@ -215,9 +215,9 @@ rpm_rdev_t rpmfiFRdev(rpmfi fi) return frdev; } -uint32_t rpmfiFInode(rpmfi fi) +rpm_ino_t rpmfiFInode(rpmfi fi) { - uint32_t finode = 0; + rpm_ino_t finode = 0; if (fi != NULL && fi->i >= 0 && fi->i < fi->fc) { if (fi->finodes != NULL) @@ -298,7 +298,7 @@ uint32_t rpmfiFNlink(rpmfi fi) if (fi != NULL && fi->i >= 0 && fi->i < fi->fc) { /* XXX rpm-2.3.12 has not RPMTAG_FILEINODES */ if (fi->finodes && fi->frdevs) { - uint32_t finode = fi->finodes[fi->i]; + rpm_ino_t finode = fi->finodes[fi->i]; rpm_rdev_t frdev = fi->frdevs[fi->i]; int j; diff --git a/lib/rpmfi.h b/lib/rpmfi.h index c6f40e421..35b417273 100644 --- a/lib/rpmfi.h +++ b/lib/rpmfi.h @@ -237,7 +237,7 @@ rpm_rdev_t rpmfiFRdev(rpmfi fi); * @param fi file info set * @return current file inode, 0 on invalid */ -uint32_t rpmfiFInode(rpmfi fi); +rpm_ino_t rpmfiFInode(rpmfi fi); /** \ingroup rpmfi * Return union of all file color bits from file info set. diff --git a/lib/rpmfi_internal.h b/lib/rpmfi_internal.h index cf4e46f03..52dfeeec5 100644 --- a/lib/rpmfi_internal.h +++ b/lib/rpmfi_internal.h @@ -51,7 +51,7 @@ struct rpmfi_s { /*?null?*/ const rpm_rdev_t * frdevs; /*!< File rdev(s) (from header) */ /*?null?*/ - const uint32_t * finodes; /*!< File inodes(s) (from header) */ + const rpm_ino_t * finodes; /*!< File inodes(s) (from header) */ const char ** fuser; /*!< File owner(s) (from header) */ const char ** fgroup; /*!< File group(s) (from header) */ diff --git a/lib/rpmtypes.h b/lib/rpmtypes.h index 56b6661de..79142f95a 100644 --- a/lib/rpmtypes.h +++ b/lib/rpmtypes.h @@ -30,6 +30,8 @@ typedef uint32_t rpm_off_t; typedef uint32_t rpm_time_t; typedef uint16_t rpm_mode_t; typedef uint16_t rpm_rdev_t; +typedef uint32_t rpm_dev_t; +typedef uint32_t rpm_ino_t; typedef struct headerToken_s * Header; typedef struct headerIterator_s * HeaderIterator; -- cgit v1.2.3