Skip to content

Commit 53f1397

Browse files
committed
storage component: update astyle
1 parent b18c819 commit 53f1397

File tree

12 files changed

+328
-336
lines changed

12 files changed

+328
-336
lines changed

components/storage/blockdevice/COMPONENT_DATAFLASH/DataFlashBlockDevice.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,11 @@ enum dummy {
131131
};
132132

133133
DataFlashBlockDevice::DataFlashBlockDevice(PinName mosi,
134-
PinName miso,
135-
PinName sclk,
136-
PinName cs,
137-
int freq,
138-
PinName nwp)
134+
PinName miso,
135+
PinName sclk,
136+
PinName cs,
137+
int freq,
138+
PinName nwp)
139139
: _spi(mosi, miso, sclk),
140140
_cs(cs, 1),
141141
_nwp(nwp),

components/storage/blockdevice/COMPONENT_FLASHIAP/TESTS/filesystem/fopen/fopen.cpp

Lines changed: 226 additions & 235 deletions
Large diffs are not rendered by default.

components/storage/blockdevice/COMPONENT_FLASHIAP/util/fslittle_test.c

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ const uint8_t fslittle_test_byte_data_table[FSLITTLE_TEST_BYTE_DATA_TABLE_SIZE]
6161

6262
/* @brief test utility function to delete the file identified by filename
6363
*/
64-
int32_t fslittle_test_delete(const char* filename)
64+
int32_t fslittle_test_delete(const char *filename)
6565
{
6666
FSLITTLE_FENTRYLOG("%s:entered.\r\n", __func__);
6767
return remove(filename);
@@ -74,18 +74,18 @@ int32_t fslittle_test_delete(const char* filename)
7474
* @param data data to store in file
7575
* @param len number of bytes of data present in the data buffer.
7676
*/
77-
int32_t fslittle_test_create(const char* filename, const char* data, size_t len)
77+
int32_t fslittle_test_create(const char *filename, const char *data, size_t len)
7878
{
7979
int32_t ret = -1;
8080
FILE *fp = NULL;
8181

8282
FSLITTLE_FENTRYLOG("%s:entered (filename=%s, len=%d).\n", __func__, filename, (int) len);
8383
fp = fopen(filename, "w+");
84-
if(fp == NULL){
84+
if (fp == NULL) {
8585
return ret;
8686
}
87-
ret = fwrite((const void*) data, len, 1, fp);
88-
if(ret < 0){
87+
ret = fwrite((const void *) data, len, 1, fp);
88+
if (ret < 0) {
8989
fclose(fp);
9090
return ret;
9191
}
@@ -99,16 +99,15 @@ int32_t fslittle_test_create(const char* filename, const char* data, size_t len)
9999
* @param len length of kv name to generate
100100
*
101101
*/
102-
int32_t fslittle_test_filename_gen(char* name, const size_t len)
102+
int32_t fslittle_test_filename_gen(char *name, const size_t len)
103103
{
104104
size_t i;
105105
uint32_t pos = 0;
106106

107-
const char* buf = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!$-_@";
107+
const char *buf = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!$-_@";
108108
const int buf_len = strlen(buf);
109109
FSLITTLE_FENTRYLOG("%s:entered\n", __func__);
110-
for(i = 0; i < len; i++)
111-
{
110+
for (i = 0; i < len; i++) {
112111
pos = rand() % (buf_len);
113112
name[i] = buf[pos];
114113
}

components/storage/blockdevice/COMPONENT_SD/TESTS/filesystem/dirs/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ void dir_file_check(char *list[], uint32_t elements)
171171
TEST_ASSERT(1);
172172
}
173173
break;
174-
} else if ( i == elements) {
174+
} else if (i == elements) {
175175
TEST_ASSERT_EQUAL(0, res);
176176
}
177177
}

components/storage/blockdevice/COMPONENT_SD/TESTS/filesystem/files/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ void test_dir_check()
294294
TEST_ASSERT(1);
295295
}
296296
break;
297-
} else if ( i == numFiles) {
297+
} else if (i == numFiles) {
298298
TEST_ASSERT_EQUAL(0, res);
299299
}
300300
}

components/storage/blockdevice/COMPONENT_SD/TESTS/filesystem/fopen/fopen.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ using namespace utest::v1;
6565
* "DEVICE_SPI": 1,
6666
* "FSFAT_SDCARD_INSTALLED": 1
6767
* },
68-
* <<< lines removed >>>
68+
* <<< lines removed >>>
6969
*/
7070

7171
#if defined(DEVICE_SPI) && ( defined(MBED_CONF_APP_FSFAT_SDCARD_INSTALLED) || (MBED_CONF_SD_FSFAT_SDCARD_INSTALLED))
@@ -155,7 +155,7 @@ static int32_t fsfat_filepath_split(char *filepath, char *parts[], uint32_t num)
155155
char *z = filepath;
156156

157157
while (i < num && *z != '\0') {
158-
if (*z == '/' ) {
158+
if (*z == '/') {
159159
*z = '\0';
160160
parts[i] = ++z;
161161
i++;
@@ -200,7 +200,7 @@ int32_t fsfat_filepath_remove_all(char *filepath)
200200
while (pos != fpathbuf) {
201201
/* If the remaining file path is the mount point path then finish as the mount point cannot be removed */
202202
if (strlen(fpathbuf) == strlen(FSFAT_FOPEN_TEST_MOUNT_PT_PATH)) {
203-
if ( strncmp(fpathbuf, FSFAT_FOPEN_TEST_MOUNT_PT_PATH, strlen(fpathbuf)) == 0) {
203+
if (strncmp(fpathbuf, FSFAT_FOPEN_TEST_MOUNT_PT_PATH, strlen(fpathbuf)) == 0) {
204204
break;
205205
}
206206
}
@@ -621,7 +621,7 @@ control_t fsfat_fopen_test_05(const size_t call_count)
621621
while (node->code != fsfat_fopen_kv_name_ascii_table_code_sentinel_g) {
622622
/* loop over range */
623623
for (j = node->code; j < (node + 1)->code; j++) {
624-
if ( (j >= 48 && j <= 57) || (j >= 65 && j <= 90) || (j >= 97 && j <= 122)) {
624+
if ((j >= 48 && j <= 57) || (j >= 65 && j <= 90) || (j >= 97 && j <= 122)) {
625625
FSFAT_DBGLOG("%s: skipping alpha-numeric ascii character code %d (%c).\n", __func__, (int) j, (char) j);
626626
continue;
627627
}
@@ -775,10 +775,10 @@ control_t fsfat_fopen_test_06(const size_t call_count)
775775

776776
/** @brief test for errno reporting on a failed fopen()call
777777
*
778-
* This test does the following:
779-
* - tries to open a file that does not exist for reading, and checks that a NULL pointer is returned.
780-
* - checks that errno is not 0 as there is an error.
781-
* - checks that ferror() returns 1 indicating an error exists.
778+
* This test does the following:
779+
* - tries to open a file that does not exist for reading, and checks that a NULL pointer is returned.
780+
* - checks that errno is not 0 as there is an error.
781+
* - checks that ferror() returns 1 indicating an error exists.
782782
*
783783
* Note: see NOTE_1 below.
784784
*

components/storage/blockdevice/COMPONENT_SD/TESTS/filesystem/parallel/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ void test_file_tests()
9797
TEST_ASSERT_EQUAL(0, res);
9898
}
9999

100-
void write_file_data (char count)
100+
void write_file_data(char count)
101101
{
102102

103103
char filename[10];
@@ -125,7 +125,7 @@ void write_file_data (char count)
125125
TEST_ASSERT_EQUAL(0, res);
126126
}
127127

128-
void read_file_data (char count)
128+
void read_file_data(char count)
129129
{
130130
char filename[10];
131131
uint8_t rbuffer[MBED_TEST_BUFFER];

components/storage/blockdevice/COMPONENT_SD/util/fsfat_test.c

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ const uint8_t fsfat_test_byte_data_table[FSFAT_TEST_BYTE_DATA_TABLE_SIZE] = {
6161

6262
/* @brief test utility function to delete the file identified by filename
6363
*/
64-
int32_t fsfat_test_delete(const char* filename)
64+
int32_t fsfat_test_delete(const char *filename)
6565
{
6666
FSFAT_FENTRYLOG("%s:entered.\r\n", __func__);
6767
return remove(filename);
@@ -74,18 +74,18 @@ int32_t fsfat_test_delete(const char* filename)
7474
* @param data data to store in file
7575
* @param len number of bytes of data present in the data buffer.
7676
*/
77-
int32_t fsfat_test_create(const char* filename, const char* data, size_t len)
77+
int32_t fsfat_test_create(const char *filename, const char *data, size_t len)
7878
{
7979
int32_t ret = -1;
8080
FILE *fp = NULL;
8181

8282
FSFAT_FENTRYLOG("%s:entered (filename=%s, len=%d).\n", __func__, filename, (int) len);
8383
fp = fopen(filename, "w+");
84-
if(fp == NULL){
84+
if (fp == NULL) {
8585
return ret;
8686
}
87-
ret = fwrite((const void*) data, len, 1, fp);
88-
if(ret < 0){
87+
ret = fwrite((const void *) data, len, 1, fp);
88+
if (ret < 0) {
8989
fclose(fp);
9090
return ret;
9191
}
@@ -99,16 +99,15 @@ int32_t fsfat_test_create(const char* filename, const char* data, size_t len)
9999
* @param len length of kv name to generate
100100
*
101101
*/
102-
int32_t fsfat_test_filename_gen(char* name, const size_t len)
102+
int32_t fsfat_test_filename_gen(char *name, const size_t len)
103103
{
104104
size_t i;
105105
uint32_t pos = 0;
106106

107-
const char* buf = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!$-_@";
107+
const char *buf = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!$-_@";
108108
const int buf_len = strlen(buf);
109109
FSFAT_FENTRYLOG("%s:entered\n", __func__);
110-
for(i = 0; i < len; i++)
111-
{
110+
for (i = 0; i < len; i++) {
112111
pos = rand() % (buf_len);
113112
name[i] = buf[pos];
114113
}

components/storage/blockdevice/COMPONENT_SD/util/fsfat_test.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,16 +57,16 @@ extern "C" {
5757

5858
/* kv data for test */
5959
typedef struct fsfat_kv_data_t {
60-
const char* filename;
61-
const char* value;
60+
const char *filename;
61+
const char *value;
6262
} fsfat_kv_data_t;
6363

6464

6565
extern const uint8_t fsfat_test_byte_data_table[FSFAT_TEST_BYTE_DATA_TABLE_SIZE];
6666

67-
int32_t fsfat_test_create(const char* filename, const char* data, size_t len);
68-
int32_t fsfat_test_delete(const char* key_name);
69-
int32_t fsfat_test_filename_gen(char* name, const size_t len);
67+
int32_t fsfat_test_create(const char *filename, const char *data, size_t len);
68+
int32_t fsfat_test_delete(const char *key_name);
69+
int32_t fsfat_test_filename_gen(char *name, const size_t len);
7070
#ifdef __cplusplus
7171
}
7272
#endif

0 commit comments

Comments
 (0)