diff options
author | Ben Summers <ben@fluffy.co.uk> | 2006-02-01 19:50:54 +0000 |
---|---|---|
committer | Ben Summers <ben@fluffy.co.uk> | 2006-02-01 19:50:54 +0000 |
commit | 45d64d4d38b698f0945fd04f1fce484e008dba99 (patch) | |
tree | da0fc6d9ba24d00f2ee787c6420a565e9db031e6 | |
parent | cea3d8219a4b025e63238e08421cc1b6da74e796 (diff) |
Get rid of the non-test compiler warnings seen on Darwin with gcc4
-rw-r--r-- | lib/backupclient/BackupStoreDirectory.cpp | 2 | ||||
-rw-r--r-- | lib/backupclient/BackupStoreFile.cpp | 24 | ||||
-rw-r--r-- | lib/backupclient/BackupStoreFile.h | 3 | ||||
-rw-r--r-- | lib/backupclient/BackupStoreFileDiff.cpp | 6 | ||||
-rw-r--r-- | lib/crypto/Random.cpp | 2 | ||||
-rw-r--r-- | test/backupdiff/testbackupdiff.cpp | 2 |
6 files changed, 34 insertions, 5 deletions
diff --git a/lib/backupclient/BackupStoreDirectory.cpp b/lib/backupclient/BackupStoreDirectory.cpp index 6b5a55d1..61e6461d 100644 --- a/lib/backupclient/BackupStoreDirectory.cpp +++ b/lib/backupclient/BackupStoreDirectory.cpp @@ -36,7 +36,7 @@ typedef struct // Then a StreamableMemBlock for attributes } dir_StreamFormat; -enum +typedef enum { Option_DependencyInfoPresent = 1 } dir_StreamFormatOptions; diff --git a/lib/backupclient/BackupStoreFile.cpp b/lib/backupclient/BackupStoreFile.cpp index 28d88d27..fd1a8918 100644 --- a/lib/backupclient/BackupStoreFile.cpp +++ b/lib/backupclient/BackupStoreFile.cpp @@ -1499,3 +1499,27 @@ void BackupStoreFile::EncodingBuffer::Reallocate(int NewSize) } +// -------------------------------------------------------------------------- +// +// Function +// Name: DiffTimer::DiffTimer(); +// Purpose: Constructor +// Created: 2005/02/01 +// +// -------------------------------------------------------------------------- +DiffTimer::DiffTimer() +{ +} + + +// -------------------------------------------------------------------------- +// +// Function +// Name: DiffTimer::DiffTimer(); +// Purpose: Destructor +// Created: 2005/02/01 +// +// -------------------------------------------------------------------------- +DiffTimer::~DiffTimer() +{ +} diff --git a/lib/backupclient/BackupStoreFile.h b/lib/backupclient/BackupStoreFile.h index 27b2ef98..437b4232 100644 --- a/lib/backupclient/BackupStoreFile.h +++ b/lib/backupclient/BackupStoreFile.h @@ -47,6 +47,9 @@ typedef struct class DiffTimer { public: + DiffTimer(); + virtual ~DiffTimer(); +public: virtual void DoKeepAlive() = 0; virtual time_t GetTimeMgmtEpoch() = 0; virtual int GetMaximumDiffingTime() = 0; diff --git a/lib/backupclient/BackupStoreFileDiff.cpp b/lib/backupclient/BackupStoreFileDiff.cpp index 571f4351..78890008 100644 --- a/lib/backupclient/BackupStoreFileDiff.cpp +++ b/lib/backupclient/BackupStoreFileDiff.cpp @@ -835,7 +835,9 @@ static bool SecondStageMatch(BlocksAvailableEntry *pFirstInHashList, RollingChec ASSERT(pFirstInHashList != 0); ASSERT(pIndex != 0); - uint16_t Hash = fastSum.GetComponentForHashing(); +#ifndef NDEBUG + uint16_t DEBUG_Hash = fastSum.GetComponentForHashing(); +#endif uint32_t Checksum = fastSum.GetChecksum(); // Before we go to the expense of the MD5, make sure it's a darn good match on the checksum we already know. @@ -873,7 +875,7 @@ static bool SecondStageMatch(BlocksAvailableEntry *pFirstInHashList, RollingChec { //TRACE3("scan size %d, block size %d, hash %d\n", scan->mSize, BlockSize, Hash); ASSERT(scan->mSize == BlockSize); - ASSERT(RollingChecksum::ExtractHashingComponent(scan->mWeakChecksum) == Hash); + ASSERT(RollingChecksum::ExtractHashingComponent(scan->mWeakChecksum) == DEBUG_Hash); // Compare? if(strong.DigestMatches(scan->mStrongChecksum)) diff --git a/lib/crypto/Random.cpp b/lib/crypto/Random.cpp index c64e7d50..30049ff7 100644 --- a/lib/crypto/Random.cpp +++ b/lib/crypto/Random.cpp @@ -69,7 +69,7 @@ void Random::Generate(void *pOutput, int Length) std::string Random::GenerateHex(int Length) { uint8_t r[256]; - if(Length > sizeof(r)) + if(Length > (int)sizeof(r)) { THROW_EXCEPTION(CipherException, LengthRequestedTooLongForRandomHex) } diff --git a/test/backupdiff/testbackupdiff.cpp b/test/backupdiff/testbackupdiff.cpp index 584dd70c..d532d8a6 100644 --- a/test/backupdiff/testbackupdiff.cpp +++ b/test/backupdiff/testbackupdiff.cpp @@ -83,7 +83,7 @@ void make_file_of_zeros(const char *filename, size_t size) fclose(f); free(b); - TEST_THAT(TestGetFileSize(filename) == size); + TEST_THAT((size_t)TestGetFileSize(filename) == size); } |