clang-format: re-format for clang-18

clang-format-18 isn't compatible with the clang-format-17 output, so we
need to reformat the code with the latest version.  The way clang-18
handles lambda formatting also changed, so we have made changes to the
organization default style format to better handle lambda formatting.

See I5e08687e696dd240402a2780158664b7113def0e for updated style.
See Iea0776aaa7edd483fa395e23de25ebf5a6288f71 for clang-18 enablement.

Change-Id: I133f4f43d4955ba1b86b924fc741aa5a56f34239
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/src/bej_decoder_core.c b/src/bej_decoder_core.c
index fe6dad6..09a9430 100644
--- a/src/bej_decoder_core.c
+++ b/src/bej_decoder_core.c
@@ -75,8 +75,8 @@
     // Number of bytes need to represent the value length.
     const uint8_t valueLengthSize = *(enSegment + valueLenNnintOffset);
     // Start of the Value.
-    const uint32_t valueOffset = valueLenNnintOffset + sizeof(uint8_t) +
-                                 valueLengthSize;
+    const uint32_t valueOffset =
+        valueLenNnintOffset + sizeof(uint8_t) + valueLengthSize;
 
     offsets->formatOffset = formatOffset;
     offsets->valueLenNnintOffset = valueLenNnintOffset;
@@ -150,11 +150,10 @@
  * property in a dictionary.
  * @return 0 if successful.
  */
-static int
-    bejGetDictionaryAndProperty(const struct BejHandleTypeFuncParam* params,
-                                uint8_t schemaType, uint32_t sequenceNumber,
-                                const uint8_t** dictionary,
-                                const struct BejDictionaryProperty** prop)
+static int bejGetDictionaryAndProperty(
+    const struct BejHandleTypeFuncParam* params, uint8_t schemaType,
+    uint32_t sequenceNumber, const uint8_t** dictionary,
+    const struct BejDictionaryProperty** prop)
 {
     uint16_t dictPropOffset;
     // We need to pick the correct dictionary.
@@ -175,8 +174,8 @@
         return bejErrorInvalidSchemaType;
     }
 
-    int ret = bejDictGetProperty(*dictionary, dictPropOffset, sequenceNumber,
-                                 prop);
+    int ret =
+        bejDictGetProperty(*dictionary, dictPropOffset, sequenceNumber, prop);
     if (ret != 0)
     {
         fprintf(stderr, "Failed to get dictionary property for offset: %u\n",
@@ -580,11 +579,11 @@
         // nnint      - Length of exp
         // bejInteger - exp (includes sign for the exponent)
         uint8_t wholeByteLen = (uint8_t)bejGetNnint(params->sflv.value);
-        const uint8_t* wholeBejInt = params->sflv.value +
-                                     bejGetNnintSize(params->sflv.value);
+        const uint8_t* wholeBejInt =
+            params->sflv.value + bejGetNnintSize(params->sflv.value);
         const uint8_t* fractZeroCountNnint = wholeBejInt + wholeByteLen;
-        const uint8_t* fractNnint = fractZeroCountNnint +
-                                    bejGetNnintSize(fractZeroCountNnint);
+        const uint8_t* fractNnint =
+            fractZeroCountNnint + bejGetNnintSize(fractZeroCountNnint);
         const uint8_t* lenExpNnint = fractNnint + bejGetNnintSize(fractNnint);
         const uint8_t* expBejInt = lenExpNnint + bejGetNnintSize(lenExpNnint);
 
@@ -669,8 +668,8 @@
     // We might have to change this for nested annotations.
     params->state.mainDictPropOffset = outerProp->childPointerOffset;
     // Point to the start of the value for next decoding.
-    params->state.encodedStreamOffset = params->sflv.valueEndOffset -
-                                        params->sflv.valueLength;
+    params->state.encodedStreamOffset =
+        params->sflv.valueEndOffset - params->sflv.valueLength;
     return 0;
 }
 
@@ -723,8 +722,8 @@
     while (params.state.encodedStreamOffset < streamLen)
     {
         // Go to the next encoded segment in the encoded stream.
-        params.state.encodedSubStream = enStream +
-                                        params.state.encodedStreamOffset;
+        params.state.encodedSubStream =
+            enStream + params.state.encodedStreamOffset;
         bejInitSFLVStruct(&params);
 
         if (params.sflv.format.readOnlyProperty)
diff --git a/src/bej_decoder_json.cpp b/src/bej_decoder_json.cpp
index f6624c7..5f8ddac 100644
--- a/src/bej_decoder_json.cpp
+++ b/src/bej_decoder_json.cpp
@@ -367,10 +367,10 @@
         .output = &output,
     };
 
-    return bejDecodePldmBlock(&dictionaries, encodedPldmBlock.data(),
-                              encodedPldmBlock.size_bytes(), &stackCallback,
-                              &decodedCallback, (void*)(&callbackData),
-                              (void*)(&stack));
+    return bejDecodePldmBlock(
+        &dictionaries, encodedPldmBlock.data(), encodedPldmBlock.size_bytes(),
+        &stackCallback, &decodedCallback, (void*)(&callbackData),
+        (void*)(&stack));
 }
 
 std::string BejDecoderJson::getOutput()
diff --git a/src/bej_dictionary.c b/src/bej_dictionary.c
index b4d99ae..c0481b3 100644
--- a/src/bej_dictionary.c
+++ b/src/bej_dictionary.c
@@ -114,11 +114,10 @@
     return (const char*)(dictionary + nameOffset);
 }
 
-int bejDictGetPropertyByName(const uint8_t* dictionary,
-                             uint16_t startingPropertyOffset,
-                             const char* propertyName,
-                             const struct BejDictionaryProperty** property,
-                             uint16_t* propertyOffset)
+int bejDictGetPropertyByName(
+    const uint8_t* dictionary, uint16_t startingPropertyOffset,
+    const char* propertyName, const struct BejDictionaryProperty** property,
+    uint16_t* propertyOffset)
 {
     NULL_CHECK(property, "property in bejDictGetPropertyByName");
 
diff --git a/src/bej_encoder_metadata.c b/src/bej_encoder_metadata.c
index 5e5ce23..76f78c3 100644
--- a/src/bej_encoder_metadata.c
+++ b/src/bej_encoder_metadata.c
@@ -58,10 +58,9 @@
  * doesn't have a name.
  * @return a pointer to the dictionary to be used.
  */
-static const uint8_t*
-    bejGetRelatedDictionary(const struct BejDictionaries* dictionaries,
-                            const uint8_t* parentDictionary,
-                            const char* nodeName)
+static const uint8_t* bejGetRelatedDictionary(
+    const struct BejDictionaries* dictionaries, const uint8_t* parentDictionary,
+    const char* nodeName)
 {
     // If the node name is NULL, we have to use parent dictionary.
     if (nodeName == NULL)
@@ -206,11 +205,10 @@
     return 0;
 }
 
-static int bejUpdateStringMetaData(const struct BejDictionaries* dictionaries,
-                                   const uint8_t* parentDictionary,
-                                   struct RedfishPropertyLeafString* node,
-                                   uint16_t nodeIndex,
-                                   uint16_t dictStartingOffset)
+static int bejUpdateStringMetaData(
+    const struct BejDictionaries* dictionaries, const uint8_t* parentDictionary,
+    struct RedfishPropertyLeafString* node, uint16_t nodeIndex,
+    uint16_t dictStartingOffset)
 {
     uint32_t sequenceNumber;
     RETURN_IF_IERROR(bejFindSeqNumAndChildDictOffset(
@@ -232,11 +230,10 @@
     return 0;
 }
 
-static int bejUpdateRealMetaData(const struct BejDictionaries* dictionaries,
-                                 const uint8_t* parentDictionary,
-                                 struct RedfishPropertyLeafReal* node,
-                                 uint16_t nodeIndex,
-                                 uint16_t dictStartingOffset)
+static int bejUpdateRealMetaData(
+    const struct BejDictionaries* dictionaries, const uint8_t* parentDictionary,
+    struct RedfishPropertyLeafReal* node, uint16_t nodeIndex,
+    uint16_t dictStartingOffset)
 {
     uint32_t sequenceNumber;
     RETURN_IF_IERROR(bejFindSeqNumAndChildDictOffset(
@@ -313,11 +310,10 @@
     return 0;
 }
 
-static int bejUpdateEnumMetaData(const struct BejDictionaries* dictionaries,
-                                 const uint8_t* parentDictionary,
-                                 struct RedfishPropertyLeafEnum* node,
-                                 uint16_t nodeIndex,
-                                 uint16_t dictStartingOffset)
+static int bejUpdateEnumMetaData(
+    const struct BejDictionaries* dictionaries, const uint8_t* parentDictionary,
+    struct RedfishPropertyLeafEnum* node, uint16_t nodeIndex,
+    uint16_t dictStartingOffset)
 {
     const uint8_t* nodeDictionary;
     uint16_t childEntryOffset;
@@ -366,11 +362,10 @@
     return 0;
 }
 
-static int bejUpdateBoolMetaData(const struct BejDictionaries* dictionaries,
-                                 const uint8_t* parentDictionary,
-                                 struct RedfishPropertyLeafBool* node,
-                                 uint16_t nodeIndex,
-                                 uint16_t dictStartingOffset)
+static int bejUpdateBoolMetaData(
+    const struct BejDictionaries* dictionaries, const uint8_t* parentDictionary,
+    struct RedfishPropertyLeafBool* node, uint16_t nodeIndex,
+    uint16_t dictStartingOffset)
 {
     uint32_t sequenceNumber;
     RETURN_IF_IERROR(bejFindSeqNumAndChildDictOffset(
@@ -390,11 +385,10 @@
     return 0;
 }
 
-static int bejUpdateNullMetaData(const struct BejDictionaries* dictionaries,
-                                 const uint8_t* parentDictionary,
-                                 struct RedfishPropertyLeafNull* node,
-                                 uint16_t nodeIndex,
-                                 uint16_t dictStartingOffset)
+static int bejUpdateNullMetaData(
+    const struct BejDictionaries* dictionaries, const uint8_t* parentDictionary,
+    struct RedfishPropertyLeafNull* node, uint16_t nodeIndex,
+    uint16_t dictStartingOffset)
 {
     uint32_t sequenceNumber;
     RETURN_IF_IERROR(bejFindSeqNumAndChildDictOffset(
@@ -426,10 +420,9 @@
  * node's parent.
  * @return 0 if successful.
  */
-static int bejUpdateLeafNodeMetaData(const struct BejDictionaries* dictionaries,
-                                     const uint8_t* parentDictionary,
-                                     void* childPtr, uint16_t childIndex,
-                                     uint16_t dictStartingOffset)
+static int bejUpdateLeafNodeMetaData(
+    const struct BejDictionaries* dictionaries, const uint8_t* parentDictionary,
+    void* childPtr, uint16_t childIndex, uint16_t dictStartingOffset)
 {
     struct RedfishPropertyLeaf* chNode = childPtr;
 
@@ -484,11 +477,10 @@
  * @param nodeIndex - If this node is an array element, this is the array index.
  * @return 0 if successful.
  */
-static int bejUpdateParentMetaData(const struct BejDictionaries* dictionaries,
-                                   const uint8_t* parentDictionary,
-                                   uint16_t dictStartingOffset,
-                                   struct RedfishPropertyParent* node,
-                                   uint16_t nodeIndex)
+static int bejUpdateParentMetaData(
+    const struct BejDictionaries* dictionaries, const uint8_t* parentDictionary,
+    uint16_t dictStartingOffset, struct RedfishPropertyParent* node,
+    uint16_t nodeIndex)
 {
     const uint8_t* nodeDictionary;
     uint16_t childEntryOffset;
@@ -557,10 +549,10 @@
             return 0;
         }
 
-        RETURN_IF_IERROR(
-            bejUpdateLeafNodeMetaData(dictionaries, parent->metaData.dictionary,
-                                      childPtr, parent->metaData.nextChildIndex,
-                                      parent->metaData.childrenDictPropOffset));
+        RETURN_IF_IERROR(bejUpdateLeafNodeMetaData(
+            dictionaries, parent->metaData.dictionary, childPtr,
+            parent->metaData.nextChildIndex,
+            parent->metaData.childrenDictPropOffset));
         // Use the child value size to update the parent value size.
         struct RedfishPropertyLeaf* leafChild = childPtr;
         // V: Include the child size in parent's value size.