From fc2055e1e08e4e3b662b0c5f67a0d0a57267acd3 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sun, 4 Jun 2017 18:14:13 +0200 Subject: 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 --- apt-pkg/contrib/hashes.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'apt-pkg/contrib/hashes.cc') 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) -- cgit v1.2.3