diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2008-02-04 11:27:00 +0200 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2008-02-04 11:27:00 +0200 |
commit | e886043a1027fabf975f5e6542437e412a137e67 (patch) | |
tree | e393703802e01c444fac13b4a7d18297567b3bd3 /lib | |
parent | f53c32337238b84bb2c555ca12cdc07f6a963361 (diff) | |
download | rpm-e886043a1027fabf975f5e6542437e412a137e67.tar.gz rpm-e886043a1027fabf975f5e6542437e412a137e67.tar.bz2 rpm-e886043a1027fabf975f5e6542437e412a137e67.zip |
Add rpm_off_t type for file size types, use where spotted
- preliminaries for bumping up the max size, use rpm-specific type
as off_t size varies, header data needs fixed size
Diffstat (limited to 'lib')
-rw-r--r-- | lib/formats.c | 4 | ||||
-rw-r--r-- | lib/fsm.c | 8 | ||||
-rw-r--r-- | lib/fsm.h | 4 | ||||
-rw-r--r-- | lib/psm.c | 4 | ||||
-rw-r--r-- | lib/query.c | 4 | ||||
-rw-r--r-- | lib/rpmcallback.h | 4 | ||||
-rw-r--r-- | lib/rpmcli.h | 4 | ||||
-rw-r--r-- | lib/rpmfi.c | 4 | ||||
-rw-r--r-- | lib/rpmfi.h | 2 | ||||
-rw-r--r-- | lib/rpmfi_internal.h | 8 | ||||
-rw-r--r-- | lib/rpminstall.c | 6 | ||||
-rw-r--r-- | lib/rpmte.c | 2 | ||||
-rw-r--r-- | lib/rpmte.h | 2 | ||||
-rw-r--r-- | lib/rpmte_internal.h | 2 | ||||
-rw-r--r-- | lib/rpmts.c | 4 | ||||
-rw-r--r-- | lib/rpmts.h | 4 | ||||
-rw-r--r-- | lib/rpmtypes.h | 2 | ||||
-rw-r--r-- | lib/signature.c | 4 | ||||
-rw-r--r-- | lib/tthread.c | 4 | ||||
-rw-r--r-- | lib/verify.c | 2 |
20 files changed, 40 insertions, 38 deletions
diff --git a/lib/formats.c b/lib/formats.c index 545562a7a..eb9f965c1 100644 --- a/lib/formats.c +++ b/lib/formats.c @@ -555,8 +555,8 @@ static int fssizesTag(Header h, rpm_tagtype_t* type, { HGE_t hge = (HGE_t)headerGetEntryMinMemory; const char ** filenames; - int32_t * filesizes; - uint32_t * usages; + rpm_off_t * filesizes; + rpm_off_t * usages; rpm_count_t numFiles; if (!hge(h, RPMTAG_FILESIZES, NULL, (rpm_data_t *) &filesizes, &numFiles)) { @@ -489,9 +489,9 @@ FSM_t freeFSM(FSM_t fsm) int fsmSetup(FSM_t fsm, fileStage goal, const rpmts ts, const rpmfi fi, FD_t cfd, - unsigned int * archiveSize, char ** failedFile) + rpm_off_t * archiveSize, char ** failedFile) { - size_t pos = 0; + rpm_off_t pos = 0; int rc, ec = 0; fsm->goal = goal; @@ -741,7 +741,7 @@ int fsmMapAttrs(FSM_t fsm) static int expandRegular(FSM_t fsm) { const struct stat * st = &fsm->sb; - int left = st->st_size; + rpm_off_t left = st->st_size; int rc = 0; rc = fsmNext(fsm, FSM_WOPEN); @@ -1683,7 +1683,7 @@ if (!(fsm->mapFlags & CPIO_ALL_HARDLINKS)) break; rpmts ts = fsmGetTs(fsm); rpmfi fi = fsmGetFi(fsm); void * ptr; - unsigned int archivePos = fdGetCpioPos(fsm->cfd); + rpm_off_t archivePos = fdGetCpioPos(fsm->cfd); if (archivePos > fi->archivePos) { fi->archivePos = archivePos; ptr = rpmtsNotify(ts, fi->te, RPMCALLBACK_INST_PROGRESS, @@ -130,7 +130,7 @@ struct fsm_s { int ix; /*!< Current file iterator index. */ hardLink_t links; /*!< Pending hard linked file(s). */ hardLink_t li; /*!< Current hard linked file(s). */ - unsigned int * archiveSize; /*!< Pointer to archive size. */ + rpm_off_t * archiveSize; /*!< Pointer to archive size. */ char ** failedFile; /*!< First file name that failed. */ const char * subdir; /*!< Current file sub-directory. */ char subbuf[64]; /* XXX eliminate */ @@ -211,7 +211,7 @@ int fsmSetup(FSM_t fsm, fileStage goal, const rpmts ts, const rpmfi fi, FD_t cfd, - unsigned int * archiveSize, + rpm_off_t * archiveSize, char ** failedFile); /** @@ -62,8 +62,8 @@ struct rpmpsm_s { int chrootDone; /*!< Was chroot(2) done by pkgStage? */ int unorderedSuccessor; /*!< Can the PSM be run asynchronously? */ rpmCallbackType what; /*!< Callback type. */ - unsigned long amount; /*!< Callback amount. */ - unsigned long total; /*!< Callback total. */ + rpm_off_t amount; /*!< Callback amount. */ + rpm_off_t total; /*!< Callback total. */ rpmRC rc; pkgStage goal; pkgStage stage; /*!< Current psm stage. */ diff --git a/lib/query.c b/lib/query.c index c8644e179..75f512690 100644 --- a/lib/query.c +++ b/lib/query.c @@ -28,7 +28,7 @@ /** */ static void printFileInfo(char * te, const char * name, - unsigned int size, unsigned short mode, + rpm_off_t size, unsigned short mode, unsigned int mtime, unsigned short rdev, unsigned int nlink, const char * owner, const char * group, @@ -185,7 +185,7 @@ int showQueryPackage(QVA_t qva, rpmts ts, Header h) unsigned short frdev; unsigned int fmtime; rpmfileState fstate; - size_t fsize; + rpm_off_t fsize; const char * fn; char fmd5[32+1]; const char * fuser; diff --git a/lib/rpmcallback.h b/lib/rpmcallback.h index 82ed68744..0a6c9ec9f 100644 --- a/lib/rpmcallback.h +++ b/lib/rpmcallback.h @@ -35,8 +35,8 @@ typedef enum rpmCallbackType_e { typedef void * (*rpmCallbackFunction) (const void * h, const rpmCallbackType what, - const unsigned long amount, - const unsigned long total, + const rpm_off_t amount, + const rpm_off_t total, fnpyKey key, rpmCallbackData data); diff --git a/lib/rpmcli.h b/lib/rpmcli.h index 64700e759..425fde0ff 100644 --- a/lib/rpmcli.h +++ b/lib/rpmcli.h @@ -470,8 +470,8 @@ extern int rpmcliProgressTotal; */ void * rpmShowProgress(const void * arg, const rpmCallbackType what, - const unsigned long amount, - const unsigned long total, + const rpm_off_t amount, + const rpm_off_t total, fnpyKey key, void * data); diff --git a/lib/rpmfi.c b/lib/rpmfi.c index 5ad0053bf..fe75c6b61 100644 --- a/lib/rpmfi.c +++ b/lib/rpmfi.c @@ -193,9 +193,9 @@ const char * rpmfiFLink(rpmfi fi) return flink; } -uint32_t rpmfiFSize(rpmfi fi) +rpm_off_t rpmfiFSize(rpmfi fi) { - uint32_t fsize = 0; + rpm_off_t fsize = 0; if (fi != NULL && fi->i >= 0 && fi->i < fi->fc) { if (fi->fsizes != NULL) diff --git a/lib/rpmfi.h b/lib/rpmfi.h index 40262806f..d2237d6f5 100644 --- a/lib/rpmfi.h +++ b/lib/rpmfi.h @@ -223,7 +223,7 @@ extern const char * rpmfiFLink(rpmfi fi); * @param fi file info set * @return current file size, 0 on invalid */ -uint32_t rpmfiFSize(rpmfi fi); +rpm_off_t rpmfiFSize(rpmfi fi); /** \ingroup rpmfi * Return current file rdev from file info set. diff --git a/lib/rpmfi_internal.h b/lib/rpmfi_internal.h index 651110534..ce3aab279 100644 --- a/lib/rpmfi_internal.h +++ b/lib/rpmfi_internal.h @@ -43,7 +43,7 @@ struct rpmfi_s { /*?null?*/ const uint32_t * fflags; /*!< File flag(s) (from header) */ /*?null?*/ - const uint32_t * fsizes; /*!< File size(s) (from header) */ + const rpm_off_t * fsizes; /*!< File size(s) (from header) */ /*?null?*/ const uint32_t * fmtimes; /*!< File modification time(s) (from header) */ /*?null?*/ @@ -108,8 +108,8 @@ struct rpmfi_s { size_t astriplen; size_t striplen; - unsigned int archivePos; - unsigned int archiveSize; + rpm_off_t archivePos; + rpm_off_t archiveSize; mode_t dperms; /*!< Directory perms (0755) if not mapped. */ mode_t fperms; /*!< File perms (0644) if not mapped. */ const char ** apath; @@ -119,7 +119,7 @@ struct rpmfi_s { int keep_header; /*!< Keep header? */ uint32_t color; /*!< Color bit(s) from file color union. */ sharedFileInfo replaced; /*!< (TR_ADDED) */ - uint32_t * replacedSizes; /*!< (TR_ADDED) */ + rpm_off_t * replacedSizes; /*!< (TR_ADDED) */ unsigned int record; /*!< (TR_REMOVED) */ int magic; #define RPMFIMAGIC 0x09697923 diff --git a/lib/rpminstall.c b/lib/rpminstall.c index e0176344c..b9d7e8520 100644 --- a/lib/rpminstall.c +++ b/lib/rpminstall.c @@ -29,7 +29,7 @@ int rpmcliProgressTotal = 0; * @param amount current * @param total final */ -static void printHash(const unsigned long amount, const unsigned long total) +static void printHash(const rpm_off_t amount, const rpm_off_t total) { int hashesNeeded; @@ -74,8 +74,8 @@ static void printHash(const unsigned long amount, const unsigned long total) void * rpmShowProgress(const void * arg, const rpmCallbackType what, - const unsigned long amount, - const unsigned long total, + const rpm_off_t amount, + const rpm_off_t total, fnpyKey key, void * data) { diff --git a/lib/rpmte.c b/lib/rpmte.c index 05ea8b943..48c172503 100644 --- a/lib/rpmte.c +++ b/lib/rpmte.c @@ -301,7 +301,7 @@ uint32_t rpmteSetColor(rpmte te, uint32_t color) return ocolor; } -uint32_t rpmtePkgFileSize(rpmte te) +rpm_off_t rpmtePkgFileSize(rpmte te) { return (te != NULL ? te->pkgFileSize : 0); } diff --git a/lib/rpmte.h b/lib/rpmte.h index 82d7bcaca..fa426a6cf 100644 --- a/lib/rpmte.h +++ b/lib/rpmte.h @@ -165,7 +165,7 @@ void rpmteSetDBInstance(rpmte te, unsigned int instance); * @param te transaction element * @return size in bytes of package file. */ -uint32_t rpmtePkgFileSize(rpmte te); +rpm_off_t rpmtePkgFileSize(rpmte te); /** \ingroup rpmte * Retrieve dependency tree depth of transaction element. diff --git a/lib/rpmte_internal.h b/lib/rpmte_internal.h index 7051bdcbb..95e43d94e 100644 --- a/lib/rpmte_internal.h +++ b/lib/rpmte_internal.h @@ -55,7 +55,7 @@ struct rpmte_s { rpmfi fi; /*!< File information. */ uint32_t color; /*!< Color bit(s) from package dependencies. */ - uint32_t pkgFileSize; /*!< No. of bytes in package file (approx). */ + rpm_off_t pkgFileSize; /*!< No. of bytes in package file (approx). */ fnpyKey key; /*!< (TR_ADDED) Retrieval key. */ rpmRelocation * relocs; /*!< (TR_ADDED) Payload file relocations. */ diff --git a/lib/rpmts.c b/lib/rpmts.c index a4ba78dbb..bb83da35d 100644 --- a/lib/rpmts.c +++ b/lib/rpmts.c @@ -1297,7 +1297,7 @@ int rpmtsInitDSI(const rpmts ts) } void rpmtsUpdateDSI(const rpmts ts, dev_t dev, - uint32_t fileSize, uint32_t prevSize, uint32_t fixupSize, + rpm_off_t fileSize, rpm_off_t prevSize, rpm_off_t fixupSize, rpmFileAction action) { rpmDiskSpaceInfo dsi; @@ -1384,7 +1384,7 @@ void rpmtsCheckDSIProblems(const rpmts ts, const rpmte te) } void * rpmtsNotify(rpmts ts, rpmte te, - rpmCallbackType what, unsigned long amount, unsigned long total) + rpmCallbackType what, rpm_off_t amount, rpm_off_t total) { void * ptr = NULL; if (ts && ts->notify && te) { diff --git a/lib/rpmts.h b/lib/rpmts.h index f9ebb8f0a..049629c6c 100644 --- a/lib/rpmts.h +++ b/lib/rpmts.h @@ -603,7 +603,7 @@ int rpmtsInitDSI(const rpmts ts); * @param action file disposition */ void rpmtsUpdateDSI(const rpmts ts, dev_t dev, - uint32_t fileSize, uint32_t prevSize, uint32_t fixupSize, + rpm_off_t fileSize, rpm_off_t prevSize, rpm_off_t fixupSize, rpmFileAction action); /** \ingroup rpmts @@ -623,7 +623,7 @@ void rpmtsCheckDSIProblems(const rpmts ts, const rpmte te); * @return callback dependent pointer */ void * rpmtsNotify(rpmts ts, rpmte te, - rpmCallbackType what, unsigned long amount, unsigned long total); + rpmCallbackType what, rpm_off_t amount, rpm_off_t total); /** \ingroup rpmts * Return number of (ordered) transaction set elements. diff --git a/lib/rpmtypes.h b/lib/rpmtypes.h index 07ae98c14..3170b7baf 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_off_t; + typedef struct headerToken_s * Header; typedef struct headerIterator_s * HeaderIterator; diff --git a/lib/signature.c b/lib/signature.c index 7e19439b0..92fdc2a6b 100644 --- a/lib/signature.c +++ b/lib/signature.c @@ -106,7 +106,7 @@ const char * rpmDetectPGPVersion(pgpVersion * pgpVer) * @param datalen length of header+payload * @return rpmRC return code */ -static inline rpmRC printSize(FD_t fd, size_t siglen, size_t pad, size_t datalen) +static inline rpmRC printSize(FD_t fd, size_t siglen, size_t pad, rpm_off_t datalen) { struct stat st; int fdno = Fileno(fd); @@ -273,7 +273,7 @@ rpmRC rpmReadSignature(FD_t fd, Header * sighp, sigType sig_type, char ** msg) { size_t sigSize = headerSizeof(sigh, HEADER_MAGIC_YES); size_t pad = (8 - (sigSize % 8)) % 8; /* 8-byte pad */ ssize_t trc; - uint32_t * archSize = NULL; + rpm_off_t * archSize = NULL; /* Position at beginning of header. */ if (pad && (trc = timedRead(fd, (void *)block, pad)) != pad) { diff --git a/lib/tthread.c b/lib/tthread.c index bae934e2b..b20d03d45 100644 --- a/lib/tthread.c +++ b/lib/tthread.c @@ -15,8 +15,8 @@ extern int _psm_debug; static void *other_notify(const void *h, const rpmCallbackType what, - const unsigned long amount, - const unsigned long total, + const rpm_off_t amount, + const rpm_off_t total, fnpyKey key, rpmCallbackData data) { diff --git a/lib/verify.c b/lib/verify.c index 8984d8437..dbdfeae11 100644 --- a/lib/verify.c +++ b/lib/verify.c @@ -112,7 +112,7 @@ int rpmVerifyFile(const rpmts ts, const rpmfi fi, if (flags & RPMVERIFY_MD5) { unsigned char md5sum[16]; - size_t fsize; + rpm_off_t fsize; /* XXX If --nomd5, then prelinked library sizes are not corrected. */ rc = rpmDoDigest(PGPHASHALGO_MD5, fn, 0, md5sum, &fsize); |