From e5ee31898cdc9177df164a3c43a176b2d43846a5 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Thu, 7 Sep 2017 11:53:38 +0200 Subject: use native 64bit integers instead of Math::Int64 it's now possible since perl-5.26.0-8.mga7 --- NEWS | 3 +++ URPM.xs | 16 ++++++++-------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/NEWS b/NEWS index b5183b6..dcaeec5 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,6 @@ +- use native 64bit integers instead of Math::Int64 + (needs perl >= 5.26.0-8.mga7) + Version 5.13 - 23 August 2017 - add support to rpm-4.14 diff --git a/URPM.xs b/URPM.xs index 305e4aa..8926770 100644 --- a/URPM.xs +++ b/URPM.xs @@ -46,7 +46,7 @@ typedef struct rpmSpec_s * Spec; struct s_Package { Header h; - uint64_t filesize; + UV filesize; unsigned flag; char *info; char *requires; @@ -201,7 +201,7 @@ get_arch(const Header header) { return headerIsEntry(header, RPMTAG_SOURCERPM) ? get_name(header, RPMTAG_ARCH) : "src"; } -static uint64_t +static UV get_int(const Header header, rpmTag tag) { struct rpmtd_s val; @@ -209,7 +209,7 @@ get_int(const Header header, rpmTag tag) { return rpmtdGetNumber(&val); } -static uint64_t +static UV get_int2(const Header header, rpmTag newtag, rpmTag oldtag) { struct rpmtd_s val; @@ -218,7 +218,7 @@ get_int2(const Header header, rpmTag newtag, rpmTag oldtag) { return rpmtdGetNumber(&val); } -static uint64_t +static UV get_filesize(const Header h) { return get_int2(h, RPMTAG_LONGSIGSIZE, RPMTAG_SIGSIZE) + 440; /* 440 is the rpm header size (?) empirical, but works */ } @@ -1760,7 +1760,7 @@ Pkg_compare(pkg, evr) OUTPUT: RETVAL -uint64_t +UV Pkg_size(pkg) URPM::Package pkg CODE: @@ -1784,11 +1784,11 @@ Pkg_size(pkg) void Pkg_set_filesize(pkg, filesize) URPM::Package pkg - uint64_t filesize; + UV filesize; PPCODE: pkg->filesize = filesize; -uint64_t +UV Pkg_filesize(pkg) URPM::Package pkg CODE: @@ -2096,7 +2096,7 @@ Pkg_build_info(pkg, fileno, provides_files=NULL, recommends=0) CODE: if (pkg->info) { char buff[65536*2]; - uint64_t size; + UV size; /* info line should be the last to be written */ if (pkg->provides && *pkg->provides) { -- cgit v1.2.1