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: I07372e75f12f406bd0555dd27e249bc7dd0958d4
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/include/cryptsetupInterface.hpp b/include/cryptsetupInterface.hpp
index fb03a8b..4f824cd 100644
--- a/include/cryptsetupInterface.hpp
+++ b/include/cryptsetupInterface.hpp
@@ -63,12 +63,10 @@
*
* @returns allocated key slot number or negative errno otherwise.
*/
- virtual int cryptKeyslotChangeByPassphrase(struct crypt_device* cd,
- int keyslotOld, int keyslotNew,
- const char* passphrase,
- size_t passphraseSize,
- const char* newPassphrase,
- size_t newPassphraseSize) = 0;
+ virtual int cryptKeyslotChangeByPassphrase(
+ struct crypt_device* cd, int keyslotOld, int keyslotNew,
+ const char* passphrase, size_t passphraseSize,
+ const char* newPassphrase, size_t newPassphraseSize) = 0;
/** @brief Wrapper around crypt_keyslot_add_by_volume_key.
* @details Used for mocking purposes.
@@ -83,11 +81,10 @@
*
* @returns allocated key slot number or negative errno otherwise.
*/
- virtual int cryptKeyslotAddByVolumeKey(struct crypt_device* cd, int keyslot,
- const char* volumeKey,
- size_t volumeKeySize,
- const char* passphrase,
- size_t passphraseSize) = 0;
+ virtual int cryptKeyslotAddByVolumeKey(
+ struct crypt_device* cd, int keyslot, const char* volumeKey,
+ size_t volumeKeySize, const char* passphrase,
+ size_t passphraseSize) = 0;
/** @brief Wrapper around crypt_load.
* @details Used for mocking purposes.
@@ -114,11 +111,9 @@
*
* @returns unlocked key slot number or negative errno otherwise.
*/
- virtual int cryptActivateByPassphrase(struct crypt_device* cd,
- const char* name, int keyslot,
- const char* passphrase,
- size_t passphraseSize,
- uint32_t flags) = 0;
+ virtual int cryptActivateByPassphrase(
+ struct crypt_device* cd, const char* name, int keyslot,
+ const char* passphrase, size_t passphraseSize, uint32_t flags) = 0;
/** @brief Wrapper around crypt_deactivate.
* @details Used for mocking purposes.
@@ -159,8 +154,8 @@
*
* @return value defined by crypt_keyslot_info
*/
- virtual crypt_keyslot_info cryptKeySlotStatus(struct crypt_device* cd,
- int keyslot) = 0;
+ virtual crypt_keyslot_info
+ cryptKeySlotStatus(struct crypt_device* cd, int keyslot) = 0;
/** @brief Wrapper around crypt_get_dir.
* @details Used for mocking purposes.
@@ -193,11 +188,10 @@
volumeKeySize, params);
}
- int cryptKeyslotChangeByPassphrase(struct crypt_device* cd, int keyslotOld,
- int keyslotNew, const char* passphrase,
- size_t passphraseSize,
- const char* newPassphrase,
- size_t newPassphraseSize) override
+ int cryptKeyslotChangeByPassphrase(
+ struct crypt_device* cd, int keyslotOld, int keyslotNew,
+ const char* passphrase, size_t passphraseSize,
+ const char* newPassphrase, size_t newPassphraseSize) override
{
return crypt_keyslot_change_by_passphrase(
cd, keyslotOld, keyslotNew, passphrase, passphraseSize,
@@ -219,10 +213,9 @@
return crypt_load(cd, requestedType, params);
}
- int cryptActivateByPassphrase(struct crypt_device* cd, const char* name,
- int keyslot, const char* passphrase,
- size_t passphraseSize,
- uint32_t flags) override
+ int cryptActivateByPassphrase(
+ struct crypt_device* cd, const char* name, int keyslot,
+ const char* passphrase, size_t passphraseSize, uint32_t flags) override
{
return crypt_activate_by_passphrase(cd, name, keyslot, passphrase,
passphraseSize, flags);
diff --git a/include/getConfig.hpp b/include/getConfig.hpp
index 077cdb6..bcb7950 100644
--- a/include/getConfig.hpp
+++ b/include/getConfig.hpp
@@ -39,8 +39,7 @@
GetStorageConfiguration(
std::shared_ptr<sdbusplus::asio::connection> connection,
std::function<void(ManagedStorageType& resp)>&& callbackFunc) :
- dbusConnection(std::move(connection)),
- callback(std::move(callbackFunc))
+ dbusConnection(std::move(connection)), callback(std::move(callbackFunc))
{}
GetStorageConfiguration& operator=(const GetStorageConfiguration&) = delete;
diff --git a/include/sanitize.hpp b/include/sanitize.hpp
index a9ba8e8..48b49aa 100644
--- a/include/sanitize.hpp
+++ b/include/sanitize.hpp
@@ -79,8 +79,7 @@
Sanitize(std::string_view inDevPath,
std::unique_ptr<IOCTLWrapperInterface> inIOCTL =
std::make_unique<IOCTLWrapperImpl>()) :
- Erase(inDevPath),
- ioctlWrapper(std::move(inIOCTL))
+ Erase(inDevPath), ioctlWrapper(std::move(inIOCTL))
{}
/** @brief sanitize the drive, using eMMC specified erase commands
diff --git a/include/util.hpp b/include/util.hpp
index 5f96c0d..a719720 100644
--- a/include/util.hpp
+++ b/include/util.hpp
@@ -26,10 +26,10 @@
std::string& locationCode, uint64_t eraseMaxGeometry,
uint64_t eraseMinGeometry, std::string& driveType,
std::string& driveProtocol) :
- deviceFile(deviceFile),
- sysfsDir(sysfsDir), luksName(luksName), locationCode(locationCode),
- eraseMaxGeometry(eraseMaxGeometry), eraseMinGeometry(eraseMinGeometry),
- driveType(driveType), driveProtocol(driveProtocol)
+ deviceFile(deviceFile), sysfsDir(sysfsDir), luksName(luksName),
+ locationCode(locationCode), eraseMaxGeometry(eraseMaxGeometry),
+ eraseMinGeometry(eraseMinGeometry), driveType(driveType),
+ driveProtocol(driveProtocol)
{}
};