aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-02-22 19:23:31 +0000
committerThierry Vignaud <tv@mageia.org>2012-02-22 19:23:31 +0000
commit7514058dfd22eadac9c6a504c8afdf569eb0cf1f (patch)
treedebaf289855f111663801b446d65d1d0c319f194
parentf473f9b521f3d02941a9dea7ce869527d1b78af6 (diff)
downloadperl-URPM-7514058dfd22eadac9c6a504c8afdf569eb0cf1f.tar
perl-URPM-7514058dfd22eadac9c6a504c8afdf569eb0cf1f.tar.gz
perl-URPM-7514058dfd22eadac9c6a504c8afdf569eb0cf1f.tar.bz2
perl-URPM-7514058dfd22eadac9c6a504c8afdf569eb0cf1f.tar.xz
perl-URPM-7514058dfd22eadac9c6a504c8afdf569eb0cf1f.zip
(sigsize_to_filesize) rename as get_filesize(), moving deferencing from callers into callee
-rw-r--r--URPM.xs10
1 files changed, 5 insertions, 5 deletions
diff --git a/URPM.xs b/URPM.xs
index 90e896f..20dcea3 100644
--- a/URPM.xs
+++ b/URPM.xs
@@ -174,9 +174,9 @@ get_int(Header header, int32_t tag) {
return ep ? *ep : 0;
}
-static int
-sigsize_to_filesize(int sigsize) {
- return sigsize + 440; /* 440 is the rpm header size (?) empirical, but works */
+static size_t
+get_filesize(const Header h) {
+ return get_int(h, RPMTAG_SIGSIZE) + 440; /* 440 is the rpm header size (?) empirical, but works */
}
static int
@@ -801,7 +801,7 @@ pack_header(URPM__Package pkg) {
get_name(pkg->h, RPMTAG_GROUP));
pkg->info = memcpy(malloc(p-buff), buff, p-buff);
}
- if (pkg->filesize == 0) pkg->filesize = sigsize_to_filesize(get_int(pkg->h, RPMTAG_SIGSIZE));
+ if (pkg->filesize == 0) pkg->filesize = get_filesize(pkg->h);
if (pkg->requires == NULL && pkg->suggests == NULL)
has_old_suggests = 0;
pkg->requires = pack_list(pkg->h, RPMTAG_REQUIRENAME, RPMTAG_REQUIREFLAGS, RPMTAG_REQUIREVERSION, is_not_old_suggests);
@@ -1881,7 +1881,7 @@ Pkg_filesize(pkg)
if (pkg->filesize) {
RETVAL = pkg->filesize;
} else if (pkg->h) {
- RETVAL = sigsize_to_filesize(get_int(pkg->h, RPMTAG_SIGSIZE));
+ RETVAL = get_filesize(pkg->h);
} else RETVAL = 0;
OUTPUT:
RETVAL