Skip to content

Commit 56c1f90

Browse files
committed
Astyle fixes
1 parent 7b6acc6 commit 56c1f90

File tree

11 files changed

+32
-28
lines changed

11 files changed

+32
-28
lines changed

features/storage/TESTS/kvstore/filesystemstore_tests/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ void test_file_system_store_functionality_unit_test()
106106

107107
err = fsst->init(InitModeFlags::ExclusiveCreation | InitModeFlags::ReadWrite);
108108
TEST_ASSER_EQUAL_ERROR_CODE(MBED_ERROR_INITIALIZATION_FAILED, err);
109-
109+
110110
err = fsst->init();
111111
TEST_ASSERT_EQUAL_ERROR_CODE(0, err);
112112

features/storage/kvstore/filesystemstore/FileSystemStore.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ int FileSystemStore::init(InitModeFlags flags)
7777
return MBED_ERROR_INVALID_ARGUMENT;
7878
}
7979
if (!((flags & InitModeFlags::Append) == InitModeFlags::Append ||
80-
(flags & InitModeFlags::ExclusiveCreation) == InitModeFlags::ExclusiveCreation)) {
80+
(flags & InitModeFlags::ExclusiveCreation) == InitModeFlags::ExclusiveCreation)) {
8181
return MBED_ERROR_UNSUPPORTED;
8282
}
8383

@@ -520,7 +520,7 @@ int FileSystemStore::iterator_open(iterator_t *it, const char *prefix)
520520
if (!KVStore::_has_flags_any(InitModeFlags::Read | InitModeFlags::WriteOnlyAllowKeyRead)) {
521521
return MBED_ERROR_INVALID_OPERATION;
522522
}
523-
523+
524524
if (it == NULL) {
525525
return MBED_ERROR_INVALID_ARGUMENT;
526526
}

features/storage/kvstore/filesystemstore/FileSystemStore.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ class FileSystemStore : public KVStore {
5252
*
5353
* @param[in] flags Flags that determine how the FileSystemStore allows KV
5454
* read/write and store creation.
55-
*
55+
*
5656
* @returns MBED_SUCCESS Success.
57-
* MBED_ERROR_INITIALIZATION_FAILED No valid FileSystemStore found on the device.
57+
* MBED_ERROR_INITIALIZATION_FAILED No valid FileSystemStore found on the device.
5858
* MBED_ERROR_FAILED_OPERATION Underlying file system failed operation.
5959
*/
6060
virtual int init(InitModeFlags flags = DEFAULT_INIT_FLAGS);

features/storage/kvstore/include/InitModeFlags.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,19 @@ namespace mbed {
88

99
/**
1010
* @brief A set of creation flags for the KVStore instance.
11-
*
11+
*
1212
* The Read, Write, and ReadWrite flags may be OR-ed to produce the correct initialization
1313
* sequence. This is similar to how a file is opened.
14-
*
14+
*
1515
* By default, the init mode opens in ReadWrite and Append mode as the default argument.
16-
*
16+
*
1717
* At least one of Read, Write, or ReadWrite must be specified. Additionally, at least one
1818
* of the following must be specified with write access: Append, Truncate, CreateNewOnly, or
1919
* ExclusiveCreation.
20-
*
20+
*
2121
*/
22-
MBED_SCOPED_ENUM_FLAGS(InitModeFlags) {
22+
MBED_SCOPED_ENUM_FLAGS(InitModeFlags)
23+
{
2324
Read = (1 << 0), //!< Enable read access from the KVStore
2425
Write = (1 << 1), //!< Enable write access to the KVStore
2526
ReadWrite = ((1 << 0) | (1 << 1)), //!< Enable read and write access to the KVSTore. This is the default.

features/storage/kvstore/include/KVStore.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
namespace mbed {
2121

2222

23-
bool KVStore::is_valid_key(const char *key) const {
23+
bool KVStore::is_valid_key(const char *key) const
24+
{
2425
if (!key || !strlen(key) || (strlen(key) > MAX_KEY_SIZE)) {
2526
return false;
2627
}
@@ -31,12 +32,13 @@ bool KVStore::is_valid_key(const char *key) const {
3132
return true;
3233
}
3334

34-
bool KVStore::_is_valid_flags(InitModeFlags flags) {
35+
bool KVStore::_is_valid_flags(InitModeFlags flags)
36+
{
3537
// Check that only valid bits are here at all
3638
if ((~(InitModeFlags::AllFlags) & flags) == InitModeFlags::NoFlags) {
3739
return false;
3840
}
39-
41+
4042
// Need at least one of the Read or Write bits set
4143
if ((flags & InitModeFlags::ReadWrite) == InitModeFlags::NoFlags) {
4244
return false;
@@ -56,7 +58,8 @@ bool KVStore::_is_valid_flags(InitModeFlags flags) {
5658
return true;
5759
}
5860

59-
bool KVStore::_has_flags_any(InitModeFlags flags) const {
61+
bool KVStore::_has_flags_any(InitModeFlags flags) const
62+
{
6063
return !(((_flags & flags)) == InitModeFlags::NoFlags);
6164
}
6265

features/storage/kvstore/include/KVStore.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class KVStore {
3737
REQUIRE_REPLAY_PROTECTION_FLAG = (1 << 3),
3838
};
3939

40-
40+
4141

4242
static const InitModeFlags DEFAULT_INIT_FLAGS = InitModeFlags::ReadWrite | InitModeFlags::Append;
4343

@@ -76,8 +76,8 @@ class KVStore {
7676
*
7777
* @param[in] flags Flags that determine how the FileSystemStore allows KV
7878
* read/write and store creation.
79-
*
80-
*
79+
*
80+
*
8181
* @returns MBED_ERROR_INITIALIZATION_FAILED No valid KVStore in the storage.
8282
* MBED_SUCCESS on success or an error code on other failure
8383
*/
@@ -219,7 +219,7 @@ class KVStore {
219219
InitModeFlags _flags;
220220

221221
bool _has_flags_any(InitModeFlags flags) const;
222-
222+
223223
static bool _is_valid_flags(InitModeFlags flags);
224224
};
225225
#endif // DOXYGEN_ONLY

features/storage/kvstore/securestore/SecureStore.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -737,7 +737,7 @@ int SecureStore::get(const char *key, void *buffer, size_t buffer_size, size_t *
737737
if (!KVStore::_has_flags_any(InitModeFlags::Read)) {
738738
return MBED_ERROR_INVALID_OPERATION;
739739
}
740-
740+
741741
_mutex.lock();
742742
int ret = do_get(key, buffer, buffer_size, actual_size, offset);
743743
_mutex.unlock();
@@ -750,7 +750,7 @@ int SecureStore::get_info(const char *key, info_t *info)
750750
if (!KVStore::_has_flags_any(InitModeFlags::Read)) {
751751
return MBED_ERROR_INVALID_OPERATION;
752752
}
753-
753+
754754
_mutex.lock();
755755
int ret = do_get(key, 0, 0, 0, 0, info);
756756
_mutex.unlock();
@@ -764,7 +764,7 @@ int SecureStore::init(InitModeFlags flags)
764764
if (!KVStore::_is_valid_flags(flags)) {
765765
return MBED_ERROR_INVALID_ARGUMENT;
766766
}
767-
767+
768768
int ret = MBED_SUCCESS;
769769

770770
MBED_ASSERT(!(scratch_buf_size % enc_block_size));

features/storage/kvstore/securestore/SecureStore.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class SecureStore : public KVStore {
7474
* @brief Initialize SecureStore class. It will also initialize
7575
* the underlying KVStore and the rollback protection KVStore by default.
7676
* If other init modes are needed, set the flags as necessary.
77-
*
77+
*
7878
* @param[in] flags Flags that determine how the FileSystemStore allows KV
7979
* read/write and store creation.
8080
*

features/storage/kvstore/tdbstore/TDBStore.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,7 @@ int TDBStore::remove(const char *key)
722722
if (!KVStore::_has_flags_any(InitModeFlags::Write)) {
723723
return MBED_ERROR_INVALID_OPERATION;
724724
}
725-
725+
726726
return set(key, 0, 0, delete_flag);
727727
}
728728

@@ -1011,10 +1011,10 @@ int TDBStore::init(InitModeFlags flags)
10111011
return MBED_ERROR_INVALID_ARGUMENT;
10121012
}
10131013
if (!((flags & InitModeFlags::Append) == InitModeFlags::Append ||
1014-
(flags & InitModeFlags::ExclusiveCreation) == InitModeFlags::ExclusiveCreation)) {
1014+
(flags & InitModeFlags::ExclusiveCreation) == InitModeFlags::ExclusiveCreation)) {
10151015
return MBED_ERROR_UNSUPPORTED;
10161016
}
1017-
1017+
10181018
ram_table_entry_t *ram_table;
10191019
area_state_e area_state[_num_areas];
10201020
uint32_t next_offset;
@@ -1475,7 +1475,7 @@ int TDBStore::reserved_data_get(void *reserved_data, size_t reserved_data_buf_si
14751475
if (!KVStore::_has_flags_any(InitModeFlags::Read)) {
14761476
return MBED_ERROR_INVALID_OPERATION;
14771477
}
1478-
1478+
14791479
_mutex.lock();
14801480
int ret = do_reserved_data_get(reserved_data, reserved_data_buf_size, actual_data_size);
14811481
_mutex.unlock();

features/storage/kvstore/tdbstore/TDBStore.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class TDBStore : public KVStore {
6565
*
6666
* @param[in] flags Flags that determine how the FileSystemStore allows KV
6767
* read/write and store creation.
68-
*
68+
*
6969
* @returns MBED_SUCCESS Success.
7070
* MBED_ERROR_INITIALIZATION_FAILED No valid TBD store found in the BlockDevice.
7171
* @returns Negative error code on other failure.

platform/mbed_enum_flags.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ ENUM_FLAG_OPERATOR(T, &)\
4545
ENUM_FLAG_OPERATOR_LHS_REFERNCE(T, |=) \
4646
ENUM_FLAG_OPERATOR_LHS_REFERNCE(T, ^=) \
4747
ENUM_FLAG_OPERATOR_LHS_REFERNCE(T, &=) \
48-
enum class T
48+
enum class T
4949

5050
#endif // __cplusplus
5151

0 commit comments

Comments
 (0)