Revision: 946 http://trac.macosforge.org/projects/darwinbuild/changeset/946 Author: wsiegrist@apple.com Date: 2011-06-16 15:38:16 -0700 (Thu, 16 Jun 2011) Log Message: ----------- Fix compiler warnings. Modified Paths: -------------- trunk/darwinup/DB.cpp trunk/darwinup/Digest.cpp trunk/darwinup/Digest.h Modified: trunk/darwinup/DB.cpp =================================================================== --- trunk/darwinup/DB.cpp 2011-04-18 16:14:01 UTC (rev 945) +++ trunk/darwinup/DB.cpp 2011-06-16 22:38:16 UTC (rev 946) @@ -157,7 +157,7 @@ SHA1Digest* digest = NULL; uint8_t* dp; - memcpy(&dp, &data[this->file_offset(7)], sizeof(uint8_t*)); + memcpy(&dp, (uint8_t**)&data[this->file_offset(7)], sizeof(uint8_t*)); if (dp) { digest = new SHA1Digest(); digest->m_size = CC_SHA1_DIGEST_LENGTH; Modified: trunk/darwinup/Digest.cpp =================================================================== --- trunk/darwinup/Digest.cpp 2011-04-18 16:14:01 UTC (rev 945) +++ trunk/darwinup/Digest.cpp 2011-06-16 22:38:16 UTC (rev 946) @@ -43,6 +43,10 @@ uint8_t* Digest::data() { return m_data; } uint32_t Digest::size() { return m_size; } +Digest::~Digest() { + +} + char* Digest::string() { static const char* hexabet = "0123456789abcdef"; char* result = (char*)malloc(2*m_size+1); @@ -88,6 +92,10 @@ digest(m_data, data, size); } +SHA1Digest::~SHA1Digest() { + +} + void SHA1Digest::digest(unsigned char* md, int fd) { CC_SHA1_CTX c; CC_SHA1_Init(&c); @@ -123,3 +131,8 @@ digest(m_data, (uint8_t*)link, res); } } + +SHA1DigestSymlink::~SHA1DigestSymlink() { + +} + Modified: trunk/darwinup/Digest.h =================================================================== --- trunk/darwinup/Digest.h 2011-04-18 16:14:01 UTC (rev 945) +++ trunk/darwinup/Digest.h 2011-06-16 22:38:16 UTC (rev 946) @@ -67,6 +67,8 @@ // Returns the digest as an ASCII string, represented in hexidecimal. virtual char* string(); + + virtual ~Digest(); //// // Class functions @@ -95,7 +97,7 @@ struct SHA1Digest : Digest { // Creates an empty digest. SHA1Digest(); - + // Computes the SHA-1 digest of data read from the stream. SHA1Digest(int fd); @@ -105,6 +107,8 @@ // Computes the SHA-1 digest of the block of memory. SHA1Digest(uint8_t* data, uint32_t size); + ~SHA1Digest(); + void digest(unsigned char* md, int fd); void digest(unsigned char* md, uint8_t* data, uint32_t size); @@ -118,6 +122,7 @@ // Computes the SHA-1 digest of the target of the symlink. // The target is obtained via readlink(2). SHA1DigestSymlink(const char* filename); + ~SHA1DigestSymlink(); }; #endif