From 7eb7002b33013126e688eb73cc9560f1bcad68fa Mon Sep 17 00:00:00 2001 From: Michael Franceski Date: Tue, 24 Oct 2023 21:18:00 -0400 Subject: [PATCH] Run clang-format -i on all modified src/ files Signed-off-by: Michael Franceski --- src/groups/mqb/mqbc/mqbc_storageutil.cpp | 3 ++- .../mwcst/mwcst_basictableinfoprovider.cpp | 3 ++- src/groups/mwc/mwcst/mwcst_printutil.cpp | 11 +++++---- src/groups/mwc/mwcst/mwcst_printutil.t.cpp | 4 +++- src/groups/mwc/mwcst/mwcst_tableutil.cpp | 23 +++++++++++++------ 5 files changed, 29 insertions(+), 15 deletions(-) diff --git a/src/groups/mqb/mqbc/mqbc_storageutil.cpp b/src/groups/mqb/mqbc/mqbc_storageutil.cpp index e078b9bb2..604784e72 100644 --- a/src/groups/mqb/mqbc/mqbc_storageutil.cpp +++ b/src/groups/mqb/mqbc/mqbc_storageutil.cpp @@ -2721,7 +2721,8 @@ int StorageUtil::processCommand(mqbcmd::StorageResult* result, else if (command.isPartitionValue()) { const int partitionId = command.partition().partitionId(); - if (partitionId < 0 || partitionId >= static_cast(fileStores->size())) { + if (partitionId < 0 || + partitionId >= static_cast(fileStores->size())) { bdlma::LocalSequentialAllocator<256> localAllocator(allocator); mwcu::MemOutStream os(&localAllocator); os << "Invalid partitionId value: '" << partitionId << "'"; diff --git a/src/groups/mwc/mwcst/mwcst_basictableinfoprovider.cpp b/src/groups/mwc/mwcst/mwcst_basictableinfoprovider.cpp index 6265b8f70..88cbd85e8 100644 --- a/src/groups/mwc/mwcst/mwcst_basictableinfoprovider.cpp +++ b/src/groups/mwc/mwcst/mwcst_basictableinfoprovider.cpp @@ -404,7 +404,8 @@ BasicTableInfoProvider::addColumn(const bslstl::StringRef& tableColumnName, ColumnFormat& column = d_columns.back(); if (!d_columnGroups.empty()) { - column.d_columnGroupIndex = static_cast(d_columnGroups.size()) - 1; + column.d_columnGroupIndex = static_cast(d_columnGroups.size()) - + 1; } return column; diff --git a/src/groups/mwc/mwcst/mwcst_printutil.cpp b/src/groups/mwc/mwcst/mwcst_printutil.cpp index 2e75ded99..d5acf4667 100644 --- a/src/groups/mwc/mwcst/mwcst_printutil.cpp +++ b/src/groups/mwc/mwcst/mwcst_printutil.cpp @@ -117,9 +117,10 @@ const char* memoryHelper(bsls::Types::Int64* num, bsls::Types::Int64 div = (((bsls::Types::Int64)1) << shift); *num = bytes >> shift; - *remainder = static_cast(bsl::floor( - ((static_cast(bytes - (*num << shift)) / static_cast(div)) * - bsl::pow(10.0, precision)))); + *remainder = static_cast( + bsl::floor(((static_cast(bytes - (*num << shift)) / + static_cast(div)) * + bsl::pow(10.0, precision)))); if (negative) { *num = -*num; @@ -257,8 +258,8 @@ bsl::ostream& PrintUtil::printValueWithSeparator(bsl::ostream& stream, if (precision > 0) { double absValue = bsl::abs(value); - int remainder = static_cast(bsl::floor((absValue - bsl::floor(absValue)) * - bsl::pow(10.0, precision))); + int remainder = static_cast(bsl::floor( + (absValue - bsl::floor(absValue)) * bsl::pow(10.0, precision))); snprintf(pos - precision - 2, precision + 2, diff --git a/src/groups/mwc/mwcst/mwcst_printutil.t.cpp b/src/groups/mwc/mwcst/mwcst_printutil.t.cpp index d8c52ef74..2a1c00bad 100644 --- a/src/groups/mwc/mwcst/mwcst_printutil.t.cpp +++ b/src/groups/mwc/mwcst/mwcst_printutil.t.cpp @@ -401,7 +401,9 @@ int main(int argc, char* argv[]) PrintUtil::printedMemoryLength(data.d_arg, data.d_precision); LOOP_ASSERT_EQUALS(LINE, ss.str(), data.d_expected_p); - LOOP_ASSERT_EQUALS(LINE, static_cast(ss.str().length()), expectedLength); + LOOP_ASSERT_EQUALS(LINE, + static_cast(ss.str().length()), + expectedLength); } #undef TO_I64 diff --git a/src/groups/mwc/mwcst/mwcst_tableutil.cpp b/src/groups/mwc/mwcst/mwcst_tableutil.cpp index 7e1bade49..c75b184a5 100644 --- a/src/groups/mwc/mwcst/mwcst_tableutil.cpp +++ b/src/groups/mwc/mwcst/mwcst_tableutil.cpp @@ -60,8 +60,9 @@ int TableUtil::printTable(bsl::ostream& stream, const TableInfoProvider& info) columnWidths[0][i] = info.getHeaderSize(0, static_cast(i)); for (int row = 0; row < numRows; ++row) { - columnWidths[0][i] = bsl::max(columnWidths[0][i], - info.getValueSize(row, static_cast(i))); + columnWidths[0][i] = bsl::max( + columnWidths[0][i], + info.getValueSize(row, static_cast(i))); } } @@ -76,7 +77,8 @@ int TableUtil::printTable(bsl::ostream& stream, const TableInfoProvider& info) int lastUpdatedHeader = -1; int numSubHeaders = 0; for (size_t col = 0; col < lastLevelHeaders.size(); ++col) { - int headerIdx = info.getParentHeader(level - 1, static_cast(col)); + int headerIdx = info.getParentHeader(level - 1, + static_cast(col)); levelHeaders[headerIdx] += lastLevelHeaders[col]; if (lastUpdatedHeader == headerIdx) { @@ -94,11 +96,14 @@ int TableUtil::printTable(bsl::ostream& stream, const TableInfoProvider& info) int mod = excess % numSubHeaders; levelHeaders[lastUpdatedHeader] = headerSize; - for (size_t hIdx = 0; static_cast(hIdx) < numSubHeaders; ++hIdx) { + for (size_t hIdx = 0; + static_cast(hIdx) < numSubHeaders; + ++hIdx) { // Add 'excessPerSubHeader' to each subHeader, and an // extra '1' to 'mod' of them lastLevelHeaders[col - hIdx - 1] += - excessPerSubHeader + (static_cast(hIdx) < mod ? 1 : 0); + excessPerSubHeader + + (static_cast(hIdx) < mod ? 1 : 0); } } @@ -131,7 +136,8 @@ int TableUtil::printTable(bsl::ostream& stream, const TableInfoProvider& info) stream << bsl::setfill(' '); // Print the header rows - for (int level = static_cast(columnWidths.size()) - 1; level >= 0; --level) { + for (int level = static_cast(columnWidths.size()) - 1; level >= 0; + --level) { stream << bsl::endl; for (size_t i = 0; i < columnWidths[level].size(); ++i) { @@ -169,7 +175,10 @@ int TableUtil::printTable(bsl::ostream& stream, const TableInfoProvider& info) } stream << bsl::setw(columnWidths[0][col]); - info.printValue(stream, row, static_cast(col), columnWidths[0][col]); + info.printValue(stream, + row, + static_cast(col), + columnWidths[0][col]); } stream << bsl::endl; }