Use a more reasonable type for rpmteHeaderSize()
authorPanu Matilainen <pmatilai@redhat.com>
Tue, 9 Feb 2010 08:01:40 +0000 (10:01 +0200)
committerPanu Matilainen <pmatilai@redhat.com>
Tue, 9 Feb 2010 08:01:40 +0000 (10:01 +0200)
- Headers must always fit into memory which is not true of rpm_loff_t,
  and the real size is arbitrarily capped far below even that limit.
  headerSizeof() uses unsigned int here, just use that...
- Doesn't affect the calculations, just type pedantry...

lib/rpmte.c
lib/rpmte_internal.h

index ed07ec5..0e38430 100644 (file)
@@ -51,7 +51,7 @@ struct rpmte_s {
 
     rpm_color_t color;         /*!< Color bit(s) from package dependencies. */
     rpm_loff_t pkgFileSize;    /*!< No. of bytes in package file (approx). */
-    rpm_loff_t headerSize;     /*!< No. of bytes in package header */
+    unsigned int headerSize;   /*!< No. of bytes in package header */
 
     fnpyKey key;               /*!< (TR_ADDED) Retrieval key. */
     rpmRelocation * relocs;    /*!< (TR_ADDED) Payload file relocations. */
@@ -403,7 +403,7 @@ rpm_loff_t rpmtePkgFileSize(rpmte te)
     return (te != NULL ? te->pkgFileSize : 0);
 }
 
-rpm_loff_t rpmteHeaderSize(rpmte te) {
+unsigned int rpmteHeaderSize(rpmte te) {
     return (te != NULL ? te->headerSize : 0);
 }
 
index 1cd2365..fe2dbe4 100644 (file)
@@ -130,7 +130,7 @@ void rpmRelocateFileList(rpmRelocation *relocs, int numRelocations, rpmfs fs, He
  * @return             size in bytes of package file.
  */
 RPM_GNUC_INTERNAL
-rpm_loff_t rpmteHeaderSize(rpmte te);
+unsigned int rpmteHeaderSize(rpmte te);
 
 #endif /* _RPMTE_INTERNAL_H */