summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2017-06-04 18:14:13 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2017-06-26 23:31:15 +0200
commitfc2055e1e08e4e3b662b0c5f67a0d0a57267acd3 (patch)
treebf071ffd9f1beb27847ec62d7186e7f2902cad41 /apt-pkg/contrib
parentd0eb158be03f15139eee65c4162c9c6e3be10718 (diff)
avoid explicit types for pkg counts by auto
Changes nothing on the program front and as the datatypes are sufficently comparable fixes no bug either, but problems later on if we ever change the types of those and prevent us using types which are too large for the values we want to store waste (a tiny bit of) resources. Gbp-Dch: Ignore
Diffstat (limited to 'apt-pkg/contrib')
-rw-r--r--apt-pkg/contrib/hashes.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/apt-pkg/contrib/hashes.cc b/apt-pkg/contrib/hashes.cc
index 662c2bf8b..4727d489e 100644
--- a/apt-pkg/contrib/hashes.cc
+++ b/apt-pkg/contrib/hashes.cc
@@ -339,7 +339,7 @@ bool Hashes::AddFD(int const Fd,unsigned long long Size)
bool const ToEOF = (Size == UntilEOF);
while (Size != 0 || ToEOF)
{
- unsigned long long n = sizeof(Buf);
+ decltype(Size) n = sizeof(Buf);
if (!ToEOF) n = std::min(Size, n);
ssize_t const Res = read(Fd,Buf,n);
if (Res < 0 || (!ToEOF && Res != (ssize_t) n)) // error, or short read
@@ -363,9 +363,9 @@ bool Hashes::AddFD(FileFd &Fd,unsigned long long Size)
bool const ToEOF = (Size == 0);
while (Size != 0 || ToEOF)
{
- unsigned long long n = sizeof(Buf);
+ decltype(Size) n = sizeof(Buf);
if (!ToEOF) n = std::min(Size, n);
- unsigned long long a = 0;
+ decltype(Size) a = 0;
if (Fd.Read(Buf, n, &a) == false) // error
return false;
if (ToEOF == false)