X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/1b5a62221cc034658354692be6ba4dfb7ef152e7..3b8d17737d840f48a60f1d4d1af3c285047ad61e:/apt-pkg/contrib/sha1.cc diff --git a/apt-pkg/contrib/sha1.cc b/apt-pkg/contrib/sha1.cc index 9b402c523..abc2aaf9f 100644 --- a/apt-pkg/contrib/sha1.cc +++ b/apt-pkg/contrib/sha1.cc @@ -29,18 +29,14 @@ */ /*}}} */ // Include Files /*{{{*/ -#ifdef __GNUG__ -#pragma implementation "apt-pkg/sha1.h" -#endif - #include #include +#include #include #include #include #include -#include /*}}}*/ // SHA1Transform - Alters an existing SHA-1 hash /*{{{*/ @@ -78,10 +74,9 @@ static void SHA1Transform(uint32_t state[5],uint8_t const buffer[64]) uint32_t l[16]; } CHAR64LONG16; - CHAR64LONG16 *block; + CHAR64LONG16 workspace, *block; - uint8_t workspace[64]; - block = (CHAR64LONG16 *)workspace; + block = &workspace; memcpy(block,buffer,sizeof(workspace)); /* Copy context->state[] to working vars */ @@ -347,7 +342,7 @@ bool SHA1Summation::AddFD(int Fd,unsigned long Size) while (Size != 0 || ToEOF) { unsigned n = sizeof(Buf); - if (!ToEOF) n = MIN(Size,n); + if (!ToEOF) n = min(Size,(unsigned long)n); Res = read(Fd,Buf,n); if (Res < 0 || (!ToEOF && (unsigned) Res != n)) // error, or short read return false;