From 7514058dfd22eadac9c6a504c8afdf569eb0cf1f Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Wed, 22 Feb 2012 19:23:31 +0000 Subject: (sigsize_to_filesize) rename as get_filesize(), moving deferencing from callers into callee --- URPM.xs | 10 +++++----- 1 file 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 -- cgit v1.2.1