Skip to content

Commit

Permalink
remove warnings (#4798)
Browse files Browse the repository at this point in the history
* remove warnings

* correct typo
  • Loading branch information
Jeffrey Mendelsohn authored and GitHub Enterprise committed Jun 20, 2024
1 parent f469b74 commit ebe6ef3
Show file tree
Hide file tree
Showing 25 changed files with 105 additions and 59 deletions.
4 changes: 2 additions & 2 deletions groups/bal/balb/balb_filecleanerconfiguration.t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,7 @@ int main(int argc, char *argv[])
objAllocatorPtr = &sa;
} break;
default: {
ASSERTV(LINE, CONFIG, !"Bad allocator config.");
ASSERTV(LINE, CONFIG, 0 == "Bad allocator config.");
} break;
}
ASSERTV(LINE, CONFIG, sizeof(Obj) == fa.numBytesInUse());
Expand Down Expand Up @@ -1491,7 +1491,7 @@ int main(int argc, char *argv[])
objAllocatorPtr = &sa;
} break;
default: {
ASSERTV(CONFIG, !"Bad allocator config.");
ASSERTV(CONFIG, 0 == "Bad allocator config.");
} break;
}

Expand Down
9 changes: 4 additions & 5 deletions groups/bal/balb/balb_leakybucket.t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

#include <bdlt_currenttime.h>

#include <bsla_maybeunused.h>

#include <bslmt_threadutil.h>

#include <bsls_asserttest.h>
Expand Down Expand Up @@ -356,8 +358,8 @@ static Ti testLB(

object.setRateAndCapacity(rate, capacity);

Uint64 numSleeps=0;
Uint64 loops = 0;
BSLA_MAYBE_UNUSED Uint64 numSleeps=0;
BSLA_MAYBE_UNUSED Uint64 loops = 0;

while (dataSent < dataSize) {
++loops;
Expand Down Expand Up @@ -560,7 +562,6 @@ int main(int argc, char *argv[])
<< "FUNCTIONALITY" << endl
<< "=============" << endl;

const Ti CREATION_TIME;
const Uint64 M = 1024*1024;
const Uint64 G = 1024LL*1024*1024;

Expand Down Expand Up @@ -1037,8 +1038,6 @@ int main(int argc, char *argv[])
const Uint64 G = 1000000000;
const Uint64 M = 1000000;

const Ti MNS_T(0, 999999999);

// Numbers of units to be consumed during different intervals
// at maximum rate.
const Uint64 U_5NS = (MAX_R / G) * 5 + ((MAX_R % G) * 5) / G;
Expand Down
2 changes: 1 addition & 1 deletion groups/bal/balb/balb_pipecontrolchannel.t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1704,7 +1704,7 @@ int main(int argc, char *argv[])
ASSERT(0 == rc);
}

ASSERT("The calling thread is unblocked.");
// The calling thread is unblocked.
}
ASSERT(0 == ta.numBytesInUse());
} break;
Expand Down
4 changes: 2 additions & 2 deletions groups/bal/balcl/balcl_typeinfo.t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1778,7 +1778,7 @@ int main(int argc, const char *argv[]) {
int test = argc > 1 ? bsl::atoi(argv[1]) : 0;
int verbose = argc > 2;
int veryVerbose = argc > 3;
int veryVeryVerbose = argc > 4;
int veryVeryVerbose = argc > 4; (void)veryVeryVerbose;
int veryVeryVeryVerbose = argc > 5;

bsl::cout << "TEST " << __FILE__ << " CASE " << test << bsl::endl;
Expand Down Expand Up @@ -1868,7 +1868,7 @@ int main(int argc, const char *argv[]) {

ASSERTV(maxSize, 4 == maxSize);

if (verbose) "C-2 Paring incorrect input.\n";
if (verbose) cout << "C-2 Parsing incorrect input.\n";

static const struct ErrorData {
int d_line;
Expand Down
2 changes: 1 addition & 1 deletion groups/bal/ball/ball_asyncfileobserver.t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2334,7 +2334,7 @@ int main(int argc, char *argv[])
objAllocatorPtr = &sa;
} break;
default: {
ASSERTV(CONFIG, !"Bad allocator config.");
ASSERTV(CONFIG, 0 == "Bad allocator config.");
} break;
}

Expand Down
4 changes: 4 additions & 0 deletions groups/bal/ball/ball_attribute.t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@
using namespace BloombergLP;
using namespace bsl;

#ifdef BSLS_PLATFORM_CMP_CLANG
#pragma clang diagnostic ignored "-Wself-assign-overloaded"
#endif

//=============================================================================
// TEST PLAN
//-----------------------------------------------------------------------------
Expand Down
4 changes: 4 additions & 0 deletions groups/bal/ball/ball_attributecontainerlist.t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
using namespace BloombergLP;
using namespace bsl;

#ifdef BSLS_PLATFORM_CMP_CLANG
#pragma clang diagnostic ignored "-Wself-assign-overloaded"
#endif

//=============================================================================
// TEST PLAN
//-----------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion groups/bal/ball/ball_attributecontext.t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2041,7 +2041,7 @@ int main(int argc, char *argv[])
objAllocatorPtr = Z;
} break;
default: {
ASSERTV(CONFIG, !"Bad allocator config.");
ASSERTV(CONFIG, 0 == "Bad allocator config.");
} break;
}

Expand Down
2 changes: 1 addition & 1 deletion groups/bal/ball/ball_broadcastobserver.t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1609,7 +1609,7 @@ int main(int argc, char *argv[])
objAllocatorPtr = &sa;
} break;
default: {
ASSERTV(CONFIG, !"Bad allocator config.");
ASSERTV(CONFIG, 0 == "Bad allocator config.");
}
}

Expand Down
4 changes: 2 additions & 2 deletions groups/bal/ball/ball_filteringobserver.t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ int main(int argc, char *argv[])
objAllocatorPtr = &sa;
} break;
default: {
ASSERTV(CONFIG, !"Bad allocator config.");
ASSERTV(CONFIG, 0 == "Bad allocator config.");
} break;
}

Expand All @@ -551,7 +551,7 @@ int main(int argc, char *argv[])
objPtr = new (fa) Obj(innerObserver, callback, &sa);
} break;
default: {
ASSERTV(CONFIG, !"Bad allocator config.");
ASSERTV(CONFIG, 0 == "Bad allocator config.");
} break;
}

Expand Down
3 changes: 3 additions & 0 deletions groups/bal/ball/ball_fixedsizerecordbuffer.t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
#include <bdlt_datetimeutil.h>
#include <bdlt_epochutil.h>

#include <bsla_maybeunused.h>

#include <bslma_default.h>

#include <bslmt_barrier.h>
Expand Down Expand Up @@ -134,6 +136,7 @@ static bslmt::Mutex printMutex; // mutex to protect output macros
#define PT(X) { printMutex.lock(); P(X); printMutex.unlock(); }
#define PT_(X) { printMutex.lock(); P_(X); printMutex.unlock(); }

BSLA_MAYBE_UNUSED
static bslmt::Mutex &assertMutex = printMutex; // mutex to protect assert
// macros

Expand Down
4 changes: 2 additions & 2 deletions groups/bal/ball/ball_loggermanager.t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6488,7 +6488,7 @@ int main(int argc, char *argv[])
objAllocatorPtr = &sa;
} break;
default: {
ASSERTV(CONFIG, !"Bad allocator config.");
ASSERTV(CONFIG, 0 == "Bad allocator config.");
continue;
}
}
Expand Down Expand Up @@ -6617,7 +6617,7 @@ int main(int argc, char *argv[])
objAllocatorPtr = &sa;
} break;
default: {
ASSERTV(CONFIG, !"Bad allocator config.");
ASSERTV(CONFIG, 0 == "Bad allocator config.");
continue;
}
}
Expand Down
16 changes: 9 additions & 7 deletions groups/bal/ball/ball_logthrottle.t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
#include <bdlt_currenttime.h>
#include <bdlt_timeunitratio.h>

#include <bsla_maybeunused.h>

#include <bslim_testutil.h>

#include <bslma_allocator.h>
Expand Down Expand Up @@ -176,13 +178,13 @@ typedef BloombergLP::bslma::TestAllocator TestAllocator;
typedef BloombergLP::bsls::Types::IntPtr IntPtr;
typedef BloombergLP::bsls::Types::Int64 Int64;

const int TRACE = Sev::e_TRACE;
const int DEBUG = Sev::e_DEBUG;
const int INFO = Sev::e_INFO;
const int WARN = Sev::e_WARN;
const int ERROR = Sev::e_ERROR;
const int FATAL = Sev::e_FATAL;
const int OFF = Sev::e_OFF;
BSLA_MAYBE_UNUSED const int TRACE = Sev::e_TRACE;
BSLA_MAYBE_UNUSED const int DEBUG = Sev::e_DEBUG;
BSLA_MAYBE_UNUSED const int INFO = Sev::e_INFO;
BSLA_MAYBE_UNUSED const int WARN = Sev::e_WARN;
BSLA_MAYBE_UNUSED const int ERROR = Sev::e_ERROR;
BSLA_MAYBE_UNUSED const int FATAL = Sev::e_FATAL;
BSLA_MAYBE_UNUSED const int OFF = Sev::e_OFF;

static bool verbose;
static bool veryVerbose;
Expand Down
4 changes: 4 additions & 0 deletions groups/bal/ball/ball_managedattribute.t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
using namespace BloombergLP;
using namespace bsl;

#ifdef BSLS_PLATFORM_CMP_CLANG
#pragma clang diagnostic ignored "-Wself-assign-overloaded"
#endif

//=============================================================================
// TEST PLAN
//-----------------------------------------------------------------------------
Expand Down
4 changes: 4 additions & 0 deletions groups/bal/ball/ball_record.t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@
using namespace BloombergLP;
using namespace bsl;

#ifdef BSLS_PLATFORM_CMP_CLANG
#pragma clang diagnostic ignored "-Wself-assign-overloaded"
#endif

//=============================================================================
// TEST PLAN
//-----------------------------------------------------------------------------
Expand Down
10 changes: 5 additions & 5 deletions groups/bal/ball/ball_recordjsonformatter.t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ int main(int argc, char *argv[])
srcAllocatorPtr = &oa;
} break;
default: {
ASSERTV(CONFIG, !"Bad allocator config.");
ASSERTV(CONFIG, 0 == "Bad allocator config.");
} break;
}
bslma::TestAllocator& sa = *srcAllocatorPtr;
Expand Down Expand Up @@ -556,7 +556,7 @@ int main(int argc, char *argv[])
srcAllocatorPtr = &oa;
} break;
default: {
ASSERTV(CONFIG, !"Bad allocator config.");
ASSERTV(CONFIG, 0 == "Bad allocator config.");
} break;
}
bslma::TestAllocator& sa = *srcAllocatorPtr;
Expand Down Expand Up @@ -711,7 +711,7 @@ int main(int argc, char *argv[])
objAllocatorPtr = &za;
} break;
default: {
ASSERTV(CONFIG, !"Bad allocator config.");
ASSERTV(CONFIG, 0 == "Bad allocator config.");
} break;
}

Expand Down Expand Up @@ -1194,7 +1194,7 @@ int main(int argc, char *argv[])
objAllocatorPtr = &sa;
} break;
default: {
ASSERTV(CONFIG, !"Bad allocator config.");
ASSERTV(CONFIG, 0 == "Bad allocator config.");
} break;
}
ASSERTV(LINE, CONFIG, sizeof(Obj) == fa.numBytesInUse());
Expand Down Expand Up @@ -2321,7 +2321,7 @@ int main(int argc, char *argv[])
othAllocatorPtr = &da;
} break;
default: {
ASSERTV(CONFIG, !"Bad allocator config.");
ASSERTV(CONFIG, 0 == "Bad allocator config.");
} break;
}

Expand Down
4 changes: 4 additions & 0 deletions groups/bal/ball/ball_recordstringformatter.t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ using bsl::strcmp;
using bsl::string;
using bsl::uppercase;

#ifdef BSLS_PLATFORM_CMP_CLANG
#pragma clang diagnostic ignored "-Wself-assign-overloaded"
#endif

// ============================================================================
// TEST PLAN
// ----------------------------------------------------------------------------
Expand Down
18 changes: 9 additions & 9 deletions groups/bal/ball/ball_userfieldvalue.t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,7 @@ int main(int argc, char *argv[])
objAllocatorPtr = &sa;
} break;
default: {
ASSERTV(LINE, CONFIG, !"Bad allocator config.");
ASSERTV(LINE, CONFIG, 0 == "Bad allocator config.");
} break;
}
ASSERTV(LINE, CONFIG, sizeof(Obj) == fa.numBytesInUse());
Expand Down Expand Up @@ -1004,7 +1004,7 @@ int main(int argc, char *argv[])
objAllocatorPtr = &sa;
} break;
default: {
ASSERTV(CONFIG, !"Bad allocator config.");
ASSERTV(CONFIG, 0 == "Bad allocator config.");
} break;
}
ASSERTV(CONFIG, sizeof(Obj) == fa.numBytesInUse());
Expand Down Expand Up @@ -1140,7 +1140,7 @@ int main(int argc, char *argv[])
objAllocatorPtr = &sa;
} break;
default: {
ASSERTV(CONFIG, !"Bad allocator config.");
ASSERTV(CONFIG, 0 == "Bad allocator config.");
} break;
}
ASSERTV(CONFIG, sizeof(Obj) == fa.numBytesInUse());
Expand Down Expand Up @@ -1353,7 +1353,7 @@ int main(int argc, char *argv[])
objAllocatorPtr = &sa;
} break;
default: {
ASSERTV(LINE, CONFIG, !"Bad allocator config.");
ASSERTV(LINE, CONFIG, 0 == "Bad allocator config.");
} break;
}
ASSERTV(LINE, CONFIG, sizeof(Obj) == fa.numBytesInUse());
Expand Down Expand Up @@ -1457,7 +1457,7 @@ int main(int argc, char *argv[])
objAllocatorPtr = &sa;
} break;
default: {
ASSERTV(LINE, CONFIG, !"Bad allocator config.");
ASSERTV(LINE, CONFIG, 0 == "Bad allocator config.");
} break;
}
ASSERTV(LINE, CONFIG, sizeof(Obj) == fa.numBytesInUse());
Expand Down Expand Up @@ -1575,7 +1575,7 @@ int main(int argc, char *argv[])
objAllocatorPtr = &sa;
} break;
default: {
ASSERTV(LINE, CONFIG, !"Bad allocator config.");
ASSERTV(LINE, CONFIG, 0 == "Bad allocator config.");
} break;
}
ASSERTV(LINE, CONFIG, sizeof(Obj) == fa.numBytesInUse());
Expand Down Expand Up @@ -2571,7 +2571,7 @@ int main(int argc, char *argv[])
objAllocatorPtr = &sa;
} break;
default: {
ASSERTV(CONFIG, !"Bad allocator config.");
ASSERTV(CONFIG, 0 == "Bad allocator config.");
} break;
}
ASSERTV(LINE, CONFIG, sizeof(Obj) == fa.numBytesInUse());
Expand Down Expand Up @@ -3594,7 +3594,7 @@ int main(int argc, char *argv[])
objAllocatorPtr = &sa;
} break;
default: {
ASSERTV(CONFIG, !"Bad allocator config.");
ASSERTV(CONFIG, 0 == "Bad allocator config.");
} break;
}

Expand Down Expand Up @@ -3660,7 +3660,7 @@ int main(int argc, char *argv[])
objAllocatorPtr = &sa;
} break;
default: {
ASSERTV(CONFIG, !"Bad allocator config.");
ASSERTV(CONFIG, 0 == "Bad allocator config.");
} break;
}

Expand Down
Loading

0 comments on commit ebe6ef3

Please sign in to comment.