Reformat with Never-AlignTrailingComments style
clang-format currently formats the codes to align the trailing comments
of the consecutive lines via `AlignTrailingComments/Kind` as `Always` in
`.clang-format` file.
This could shift the comment lines by the neighboring code changes and
also potentially mislead the `diff` of code changes.
This commit is to keep the existing trailing comments as they were.
Tested:
- Check whitespace only
- Code compiles & CI passes.
Change-Id: I1c64d53572a81d5012aa748fe44478f80c271c5f
Signed-off-by: Myung Bae <myungbae@us.ibm.com>
diff --git a/.clang-format b/.clang-format
index 28e3328..39dcdb7 100644
--- a/.clang-format
+++ b/.clang-format
@@ -8,7 +8,7 @@
AlignEscapedNewlines: Right
AlignOperands: Align
AlignTrailingComments:
- Kind: Always
+ Kind: Never
OverEmptyLines: 1
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: Empty
diff --git a/http/utility.hpp b/http/utility.hpp
index f2ac6e4..494b734 100644
--- a/http/utility.hpp
+++ b/http/utility.hpp
@@ -256,17 +256,19 @@
base64code0 = getCodeValue(input[i]);
if (base64code0 == nop)
- { // non base64 character
+ {
+ // non base64 character
return false;
}
if (!(++i < inputLength))
- { // we need at least two input bytes for first
- // byte output
+ {
+ // we need at least two input bytes for first byte output
return false;
}
base64code1 = getCodeValue(input[i]);
if (base64code1 == nop)
- { // non base64 character
+ {
+ // non base64 character
return false;
}
output +=
@@ -276,12 +278,14 @@
{
char c = input[i];
if (c == '=')
- { // padding , end of input
+ {
+ // padding , end of input
return (base64code1 & 0x0f) == 0;
}
base64code2 = getCodeValue(input[i]);
if (base64code2 == nop)
- { // non base64 character
+ {
+ // non base64 character
return false;
}
output += static_cast<char>(
@@ -292,12 +296,14 @@
{
char c = input[i];
if (c == '=')
- { // padding , end of input
+ {
+ // padding , end of input
return (base64code2 & 0x03) == 0;
}
char base64code3 = getCodeValue(input[i]);
if (base64code3 == nop)
- { // non base64 character
+ {
+ // non base64 character
return false;
}
output +=
diff --git a/include/authentication.hpp b/include/authentication.hpp
index 1a05efd..b423af2 100644
--- a/include/authentication.hpp
+++ b/include/authentication.hpp
@@ -208,8 +208,8 @@
}
if (boost::beast::http::verb::get == method)
{
- if ((url == "/redfish") || //
- (url == "/redfish/v1") || //
+ if ((url == "/redfish") || //
+ (url == "/redfish/v1") || //
(url == "/redfish/v1/odata") || //
(url == "/redfish/v1/$metadata"))
{
diff --git a/include/ibm/management_console_rest.hpp b/include/ibm/management_console_rest.hpp
index ce8e573..9d6f690 100644
--- a/include/ibm/management_console_rest.hpp
+++ b/include/ibm/management_console_rest.hpp
@@ -28,11 +28,11 @@
constexpr size_t maxSaveareaDirSize =
25000000; // Allow save area dir size to be max 25MB
constexpr size_t minSaveareaFileSize =
- 100; // Allow save area file size of minimum 100B
+ 100; // Allow save area file size of minimum 100B
constexpr size_t maxSaveareaFileSize =
- 500000; // Allow save area file size upto 500KB
+ 500000; // Allow save area file size upto 500KB
constexpr size_t maxBroadcastMsgSize =
- 1000; // Allow Broadcast message size upto 1KB
+ 1000; // Allow Broadcast message size upto 1KB
inline void handleFilePut(const crow::Request& req,
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
diff --git a/redfish-core/include/utils/time_utils.hpp b/redfish-core/include/utils/time_utils.hpp
index a962695..a6781b5 100644
--- a/redfish-core/include/utils/time_utils.hpp
+++ b/redfish-core/include/utils/time_utils.hpp
@@ -234,12 +234,12 @@
IntType era = (z >= 0 ? z : z - 146096) / 146097;
unsigned doe = static_cast<unsigned>(z - era * 146097); // [0, 146096]
unsigned yoe = (doe - doe / 1460 + doe / 36524 - doe / 146096) /
- 365; // [0, 399]
+ 365; // [0, 399]
IntType y = static_cast<IntType>(yoe) + era * 400;
unsigned doy = doe - (365 * yoe + yoe / 4 - yoe / 100); // [0, 365]
- unsigned mp = (5 * doy + 2) / 153; // [0, 11]
- unsigned d = doy - (153 * mp + 2) / 5 + 1; // [1, 31]
- unsigned m = mp < 10 ? mp + 3 : mp - 9; // [1, 12]
+ unsigned mp = (5 * doy + 2) / 153; // [0, 11]
+ unsigned d = doy - (153 * mp + 2) / 5 + 1; // [1, 31]
+ unsigned m = mp < 10 ? mp + 3 : mp - 9; // [1, 12]
return std::tuple<IntType, unsigned, unsigned>(y + (m <= 2), m, d);
}