diff options
author | Chris Wilson <chris+github@qwirx.com> | 2008-12-30 14:54:55 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2008-12-30 14:54:55 +0000 |
commit | f5a529cfd4a9f1920c0b1d75375258dab2d71be1 (patch) | |
tree | 83028df92c92eae6557bf6bfecb943a8ca9c8df9 /lib | |
parent | a5400afe73492cbb8e0049a7facb2b32f0fcad04 (diff) |
Rename NDEBUG flag to BOX_RELEASE_BUILD, as other projects use NDEBUG as
well (e.g. wxWidgets) and it causes conflicts which are difficult to
resolve.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/backupclient/BackupStoreFile.h | 2 | ||||
-rw-r--r-- | lib/backupclient/BackupStoreFileDiff.cpp | 20 | ||||
-rw-r--r-- | lib/backupclient/BackupStoreFileEncodeStream.cpp | 2 | ||||
-rw-r--r-- | lib/backupstore/BackupStoreCheck.h | 4 | ||||
-rw-r--r-- | lib/backupstore/BackupStoreCheckData.cpp | 2 | ||||
-rw-r--r-- | lib/backupstore/BackupStoreInfo.cpp | 2 | ||||
-rw-r--r-- | lib/backupstore/StoreStructure.h | 2 | ||||
-rw-r--r-- | lib/common/Box.h | 2 | ||||
-rw-r--r-- | lib/common/DebugAssertFailed.cpp | 4 | ||||
-rw-r--r-- | lib/common/DebugMemLeakFinder.cpp | 4 | ||||
-rw-r--r-- | lib/common/DebugPrintf.cpp | 4 | ||||
-rw-r--r-- | lib/common/FdGetLine.h | 2 | ||||
-rw-r--r-- | lib/common/IOStreamGetLine.h | 2 | ||||
-rw-r--r-- | lib/common/Timer.cpp | 10 | ||||
-rw-r--r-- | lib/common/Utils.cpp | 2 | ||||
-rw-r--r-- | lib/compress/CompressStream.cpp | 2 | ||||
-rw-r--r-- | lib/raidfile/RaidFileUtil.cpp | 4 | ||||
-rw-r--r-- | lib/raidfile/RaidFileWrite.cpp | 2 | ||||
-rw-r--r-- | lib/server/Daemon.cpp | 2 | ||||
-rw-r--r-- | lib/server/Protocol.cpp | 2 | ||||
-rw-r--r-- | lib/server/SSLLib.cpp | 2 | ||||
-rw-r--r-- | lib/server/SSLLib.h | 2 | ||||
-rw-r--r-- | lib/server/ServerStream.h | 2 | ||||
-rw-r--r-- | lib/server/SocketStreamTLS.cpp | 2 |
24 files changed, 42 insertions, 42 deletions
diff --git a/lib/backupclient/BackupStoreFile.h b/lib/backupclient/BackupStoreFile.h index d7a71318..7bd75fa5 100644 --- a/lib/backupclient/BackupStoreFile.h +++ b/lib/backupclient/BackupStoreFile.h @@ -215,7 +215,7 @@ public: static BackupStoreFileStats msStats; // For debug -#ifndef NDEBUG +#ifndef BOX_RELEASE_BUILD static bool TraceDetailsOfDiffProcess; #endif diff --git a/lib/backupclient/BackupStoreFileDiff.cpp b/lib/backupclient/BackupStoreFileDiff.cpp index da0324fd..87cf7cff 100644 --- a/lib/backupclient/BackupStoreFileDiff.cpp +++ b/lib/backupclient/BackupStoreFileDiff.cpp @@ -40,7 +40,7 @@ using namespace BackupStoreFileCreation; // By default, don't trace out details of the diff as we go along -- would fill up logs significantly. // But it's useful for the test. -#ifndef NDEBUG +#ifndef BOX_RELEASE_BUILD bool BackupStoreFile::TraceDetailsOfDiffProcess = false; #endif @@ -436,7 +436,7 @@ static void FindMostUsedSizes(BlocksAvailableEntry *pIndex, int64_t NumBlocks, i } // trace the size table in debug builds -#ifndef NDEBUG +#ifndef BOX_RELEASE_BUILD if(BackupStoreFile::TraceDetailsOfDiffProcess) { for(int t = 0; t < BACKUP_FILE_DIFF_MAX_BLOCK_SIZES; ++t) @@ -728,7 +728,7 @@ static void SearchForMatchingBlocks(IOStream &rFile, std::map<int64_t, int64_t> throw; } -#ifndef NDEBUG +#ifndef BOX_RELEASE_BUILD if(BackupStoreFile::TraceDetailsOfDiffProcess) { // Trace out the found blocks in debug mode @@ -810,7 +810,7 @@ static bool SecondStageMatch(BlocksAvailableEntry *pFirstInHashList, RollingChec ASSERT(pFirstInHashList != 0); ASSERT(pIndex != 0); -#ifndef NDEBUG +#ifndef BOX_RELEASE_BUILD uint16_t DEBUG_Hash = fastSum.GetComponentForHashing(); #endif uint32_t Checksum = fastSum.GetChecksum(); @@ -916,7 +916,7 @@ static void GenerateRecipe(BackupStoreFileEncodeStream::Recipe &rRecipe, BlocksA instruction.mSpaceBefore = SizeOfInputFile; rRecipe.push_back(instruction); - #ifndef NDEBUG + #ifndef BOX_RELEASE_BUILD if(BackupStoreFile::TraceDetailsOfDiffProcess) { BOX_TRACE("Diff: Default recipe generated, " << @@ -936,7 +936,7 @@ static void GenerateRecipe(BackupStoreFileEncodeStream::Recipe &rRecipe, BlocksA ASSERT(i != rFoundBlocks.end()); // check logic // Counting for debug tracing -#ifndef NDEBUG +#ifndef BOX_RELEASE_BUILD int64_t debug_NewBytesFound = 0; int64_t debug_OldBlocksUsed = 0; #endif @@ -963,7 +963,7 @@ static void GenerateRecipe(BackupStoreFileEncodeStream::Recipe &rRecipe, BlocksA instruction.mSpaceBefore = i->first - loc; // Move location forward to match loc += instruction.mSpaceBefore; -#ifndef NDEBUG +#ifndef BOX_RELEASE_BUILD debug_NewBytesFound += instruction.mSpaceBefore; #endif } @@ -989,7 +989,7 @@ static void GenerateRecipe(BackupStoreFileEncodeStream::Recipe &rRecipe, BlocksA instruction.mBlocks += 1; } -#ifndef NDEBUG +#ifndef BOX_RELEASE_BUILD debug_OldBlocksUsed++; #endif @@ -1005,14 +1005,14 @@ static void GenerateRecipe(BackupStoreFileEncodeStream::Recipe &rRecipe, BlocksA { RESET_INSTRUCTION instruction.mSpaceBefore = SizeOfInputFile - loc; -#ifndef NDEBUG +#ifndef BOX_RELEASE_BUILD debug_NewBytesFound += instruction.mSpaceBefore; #endif rRecipe.push_back(instruction); } // dump out the recipe -#ifndef NDEBUG +#ifndef BOX_RELEASE_BUILD BOX_TRACE("Diff: " << debug_NewBytesFound << " new bytes found, " << debug_OldBlocksUsed << " old blocks used"); diff --git a/lib/backupclient/BackupStoreFileEncodeStream.cpp b/lib/backupclient/BackupStoreFileEncodeStream.cpp index 3b45e6c0..b2d44697 100644 --- a/lib/backupclient/BackupStoreFileEncodeStream.cpp +++ b/lib/backupclient/BackupStoreFileEncodeStream.cpp @@ -236,7 +236,7 @@ void BackupStoreFileEncodeStream::Setup(const char *Filename, { throw std::bad_alloc(); } -#ifndef NDEBUG +#ifndef BOX_RELEASE_BUILD // In debug builds, make sure that the reallocation code is exercised. mEncodedBuffer.Allocate(mAllocatedBufferSize / 4); #else diff --git a/lib/backupstore/BackupStoreCheck.h b/lib/backupstore/BackupStoreCheck.h index 3f48312a..1d5c1b1e 100644 --- a/lib/backupstore/BackupStoreCheck.h +++ b/lib/backupstore/BackupStoreCheck.h @@ -48,7 +48,7 @@ The following problems can be fixed: // Size of blocks in the list of IDs -#ifdef NDEBUG +#ifdef BOX_RELEASE_BUILD #define BACKUPSTORECHECK_BLOCK_SIZE (64*1024) #else #define BACKUPSTORECHECK_BLOCK_SIZE 8 @@ -150,7 +150,7 @@ private: return (pBlock->mFlags[Index / Flags__NumItemsPerEntry] >> ((Index % Flags__NumItemsPerEntry) * Flags__NumFlags)) & Flags__MASK; } -#ifndef NDEBUG +#ifndef BOX_RELEASE_BUILD void DumpObjectInfo(); #define DUMP_OBJECT_INFO DumpObjectInfo(); #else diff --git a/lib/backupstore/BackupStoreCheckData.cpp b/lib/backupstore/BackupStoreCheckData.cpp index aeb96173..fed0c3f1 100644 --- a/lib/backupstore/BackupStoreCheckData.cpp +++ b/lib/backupstore/BackupStoreCheckData.cpp @@ -174,7 +174,7 @@ BackupStoreCheck::IDBlock *BackupStoreCheck::LookupID(BackupStoreCheck_ID_t ID, } -#ifndef NDEBUG +#ifndef BOX_RELEASE_BUILD // -------------------------------------------------------------------------- // // Function diff --git a/lib/backupstore/BackupStoreInfo.cpp b/lib/backupstore/BackupStoreInfo.cpp index 70d51a12..1d55fdf0 100644 --- a/lib/backupstore/BackupStoreInfo.cpp +++ b/lib/backupstore/BackupStoreInfo.cpp @@ -55,7 +55,7 @@ typedef struct END_STRUCTURE_PACKING_FOR_WIRE #endif -#ifdef NDEBUG +#ifdef BOX_RELEASE_BUILD #define NUM_DELETED_DIRS_BLOCK 256 #else #define NUM_DELETED_DIRS_BLOCK 2 diff --git a/lib/backupstore/StoreStructure.h b/lib/backupstore/StoreStructure.h index 094c0deb..ffbe83dd 100644 --- a/lib/backupstore/StoreStructure.h +++ b/lib/backupstore/StoreStructure.h @@ -12,7 +12,7 @@ #include <string> -#ifdef NDEBUG +#ifdef BOX_RELEASE_BUILD #define STORE_ID_SEGMENT_LENGTH 8 #define STORE_ID_SEGMENT_MASK 0xff #else diff --git a/lib/common/Box.h b/lib/common/Box.h index 6b50ade1..1124a062 100644 --- a/lib/common/Box.h +++ b/lib/common/Box.h @@ -37,7 +37,7 @@ #include "CommonException.h" #include "Logging.h" -#ifndef NDEBUG +#ifndef BOX_RELEASE_BUILD extern bool AssertFailuresToSyslog; #define ASSERT_FAILS_TO_SYSLOG_ON {AssertFailuresToSyslog = true;} diff --git a/lib/common/DebugAssertFailed.cpp b/lib/common/DebugAssertFailed.cpp index cceab0ef..e498d641 100644 --- a/lib/common/DebugAssertFailed.cpp +++ b/lib/common/DebugAssertFailed.cpp @@ -7,7 +7,7 @@ // // -------------------------------------------------------------------------- -#ifndef NDEBUG +#ifndef BOX_RELEASE_BUILD #include "Box.h" @@ -33,5 +33,5 @@ void BoxDebugAssertFailed(const char *cond, const char *file, int line) } -#endif // NDEBUG +#endif // BOX_RELEASE_BUILD diff --git a/lib/common/DebugMemLeakFinder.cpp b/lib/common/DebugMemLeakFinder.cpp index 90372a72..230d7163 100644 --- a/lib/common/DebugMemLeakFinder.cpp +++ b/lib/common/DebugMemLeakFinder.cpp @@ -8,7 +8,7 @@ // -------------------------------------------------------------------------- -#ifndef NDEBUG +#ifndef BOX_RELEASE_BUILD #include "Box.h" @@ -548,4 +548,4 @@ void operator delete(void *ptr) throw () internal_delete(ptr); } -#endif // NDEBUG +#endif // BOX_RELEASE_BUILD diff --git a/lib/common/DebugPrintf.cpp b/lib/common/DebugPrintf.cpp index 8d75f458..1335d473 100644 --- a/lib/common/DebugPrintf.cpp +++ b/lib/common/DebugPrintf.cpp @@ -7,7 +7,7 @@ // // -------------------------------------------------------------------------- -#ifndef NDEBUG +#ifndef BOX_RELEASE_BUILD #include "Box.h" @@ -80,4 +80,4 @@ int BoxDebugTrace(const char *format, ...) } -#endif // NDEBUG +#endif // BOX_RELEASE_BUILD diff --git a/lib/common/FdGetLine.h b/lib/common/FdGetLine.h index a18007a3..df43c3c9 100644 --- a/lib/common/FdGetLine.h +++ b/lib/common/FdGetLine.h @@ -12,7 +12,7 @@ #include <string> -#ifdef NDEBUG +#ifdef BOX_RELEASE_BUILD #define FDGETLINE_BUFFER_SIZE 1024 #elif defined WIN32 // need enough space for at least one unicode character diff --git a/lib/common/IOStreamGetLine.h b/lib/common/IOStreamGetLine.h index cf152e5a..9a5d1818 100644 --- a/lib/common/IOStreamGetLine.h +++ b/lib/common/IOStreamGetLine.h @@ -14,7 +14,7 @@ #include "IOStream.h" -#ifdef NDEBUG +#ifdef BOX_RELEASE_BUILD #define IOSTREAMGETLINE_BUFFER_SIZE 1024 #else #define IOSTREAMGETLINE_BUFFER_SIZE 4 diff --git a/lib/common/Timer.cpp b/lib/common/Timer.cpp index b4629ed2..cac86512 100644 --- a/lib/common/Timer.cpp +++ b/lib/common/Timer.cpp @@ -347,7 +347,7 @@ Timer::Timer(size_t timeoutSecs, const std::string& rName) , mTimerHandle(INVALID_HANDLE_VALUE) #endif { - #ifndef NDEBUG + #ifndef BOX_RELEASE_BUILD if (timeoutSecs == 0) { BOX_TRACE(TIMER_ID "initialised for " << timeoutSecs << @@ -476,7 +476,7 @@ void Timer::Stop() Timer::~Timer() { - #ifndef NDEBUG + #ifndef BOX_RELEASE_BUILD BOX_TRACE(TIMER_ID "destroyed"); #endif @@ -503,7 +503,7 @@ Timer::Timer(const Timer& rToCopy) , mTimerHandle(INVALID_HANDLE_VALUE) #endif { - #ifndef NDEBUG + #ifndef BOX_RELEASE_BUILD if (mExpired) { BOX_TRACE(TIMER_ID "initialised from timer " << &rToCopy << ", " @@ -544,7 +544,7 @@ Timer::Timer(const Timer& rToCopy) Timer& Timer::operator=(const Timer& rToCopy) { - #ifndef NDEBUG + #ifndef BOX_RELEASE_BUILD if (rToCopy.mExpired) { BOX_TRACE(TIMER_ID "initialised from timer " << &rToCopy << ", " @@ -595,7 +595,7 @@ Timer& Timer::operator=(const Timer& rToCopy) void Timer::OnExpire() { - #ifndef NDEBUG + #ifndef BOX_RELEASE_BUILD BOX_TRACE(TIMER_ID "fired"); #endif diff --git a/lib/common/Utils.cpp b/lib/common/Utils.cpp index c259edeb..408eaa57 100644 --- a/lib/common/Utils.cpp +++ b/lib/common/Utils.cpp @@ -58,7 +58,7 @@ void SplitString(const std::string &String, char SplitOn, std::vector<std::strin { rOutput.push_back(String.substr(b)); } -/*#ifndef NDEBUG +/*#ifndef BOX_RELEASE_BUILD BOX_TRACE("Splitting string '" << String << " on " << (char)SplitOn); for(unsigned int l = 0; l < rOutput.size(); ++l) { diff --git a/lib/compress/CompressStream.cpp b/lib/compress/CompressStream.cpp index 322b203b..9bb73e3d 100644 --- a/lib/compress/CompressStream.cpp +++ b/lib/compress/CompressStream.cpp @@ -19,7 +19,7 @@ #include "MemLeakFindOn.h" // How big a buffer to use -#ifndef NDEBUG +#ifndef BOX_RELEASE_BUILD // debug! #define BUFFER_SIZE 256 #else diff --git a/lib/raidfile/RaidFileUtil.cpp b/lib/raidfile/RaidFileUtil.cpp index 84ff2060..079d14d0 100644 --- a/lib/raidfile/RaidFileUtil.cpp +++ b/lib/raidfile/RaidFileUtil.cpp @@ -58,7 +58,7 @@ RaidFileUtil::ExistType RaidFileUtil::RaidFileExists(RaidFileDiscSet &rDiscSet, if(pRevisionID != 0) { (*pRevisionID) = FileModificationTime(st); -#ifdef NDEBUG +#ifdef BOX_RELEASE_BUILD // The resolution of timestamps may be very // low, e.g. 1 second. So add the size to it // to give a bit more chance of it changing. @@ -107,7 +107,7 @@ RaidFileUtil::ExistType RaidFileUtil::RaidFileExists(RaidFileDiscSet &rDiscSet, if(pRevisionID != 0) { (*pRevisionID) = revisionID; -#ifdef NDEBUG +#ifdef BOX_RELEASE_BUILD // The resolution of timestamps may be very low, e.g. // 1 second. So add the size to it to give a bit more // chance of it changing. diff --git a/lib/raidfile/RaidFileWrite.cpp b/lib/raidfile/RaidFileWrite.cpp index ab405c6f..efec43a2 100644 --- a/lib/raidfile/RaidFileWrite.cpp +++ b/lib/raidfile/RaidFileWrite.cpp @@ -390,7 +390,7 @@ void RaidFileWrite::TransformToRaidStorage() // // DEBUG MODE -- check file system size block size is same as block size for files // // doesn't really apply, as space benefits of using fragment size are worth efficiency, // // and anyway, it'll be buffered eventually so it won't matter. -// #ifndef NDEBUG +// #ifndef BOX_RELEASE_BUILD // { // if(writeFileStat.st_blksize != blockSize) // { diff --git a/lib/server/Daemon.cpp b/lib/server/Daemon.cpp index 4d7cbb34..3c21f6f9 100644 --- a/lib/server/Daemon.cpp +++ b/lib/server/Daemon.cpp @@ -296,7 +296,7 @@ int Daemon::Main(const char *DefaultConfigFile, int argc, const char *argv[]) mConfigFileName = DefaultConfigFile; mAppName = argv[0]; - #ifdef NDEBUG + #ifdef BOX_RELEASE_BUILD mLogLevel = Log::NOTICE; // need an int to do math with #else mLogLevel = Log::INFO; // need an int to do math with diff --git a/lib/server/Protocol.cpp b/lib/server/Protocol.cpp index 41f60e5a..5dc5d0b1 100644 --- a/lib/server/Protocol.cpp +++ b/lib/server/Protocol.cpp @@ -26,7 +26,7 @@ #include "MemLeakFindOn.h" -#ifdef NDEBUG +#ifdef BOX_RELEASE_BUILD #define PROTOCOL_ALLOCATE_SEND_BLOCK_CHUNK 1024 #else // #define PROTOCOL_ALLOCATE_SEND_BLOCK_CHUNK 1024 diff --git a/lib/server/SSLLib.cpp b/lib/server/SSLLib.cpp index c4d71f78..de7a941b 100644 --- a/lib/server/SSLLib.cpp +++ b/lib/server/SSLLib.cpp @@ -23,7 +23,7 @@ #include "MemLeakFindOn.h" -#ifndef NDEBUG +#ifndef BOX_RELEASE_BUILD bool SSLLib__TraceErrors = false; #endif diff --git a/lib/server/SSLLib.h b/lib/server/SSLLib.h index 5802a601..ff4aab19 100644 --- a/lib/server/SSLLib.h +++ b/lib/server/SSLLib.h @@ -10,7 +10,7 @@ #ifndef SSLLIB__H #define SSLLIB__H -#ifndef NDEBUG +#ifndef BOX_RELEASE_BUILD extern bool SSLLib__TraceErrors; #define SET_DEBUG_SSLLIB_TRACE_ERRORS {SSLLib__TraceErrors = true;} #else diff --git a/lib/server/ServerStream.h b/lib/server/ServerStream.h index c7d81740..34de7def 100644 --- a/lib/server/ServerStream.h +++ b/lib/server/ServerStream.h @@ -108,7 +108,7 @@ public: { // Child task, dump leaks to trace, which we make sure is on #ifdef BOX_MEMORY_LEAK_TESTING - #ifndef NDEBUG + #ifndef BOX_RELEASE_BUILD TRACE_TO_SYSLOG(true); TRACE_TO_STDOUT(true); #endif diff --git a/lib/server/SocketStreamTLS.cpp b/lib/server/SocketStreamTLS.cpp index 5b7bf646..979aee9b 100644 --- a/lib/server/SocketStreamTLS.cpp +++ b/lib/server/SocketStreamTLS.cpp @@ -391,7 +391,7 @@ void SocketStreamTLS::Write(const void *pBuffer, int NBytes) case SSL_ERROR_WANT_WRITE: // wait for the requried data { - #ifndef NDEBUG + #ifndef BOX_RELEASE_BUILD bool conditionmet = #endif WaitWhenRetryRequired(se, IOStream::TimeOutInfinite); |