Skip to content

Commit f1a9815

Browse files
committed
Moved squiggly bracket placement per mbed style
1 parent 7a90be0 commit f1a9815

File tree

1 file changed

+50
-25
lines changed

1 file changed

+50
-25
lines changed

features/filesystem/fat/FATFileSystem.cpp

Lines changed: 50 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -275,12 +275,14 @@ FATFileSystem::~FATFileSystem()
275275
unmount();
276276
}
277277

278-
int FATFileSystem::mount(BlockDevice *bd) {
278+
int FATFileSystem::mount(BlockDevice *bd)
279+
{
279280
// requires duplicate definition to allow virtual overload to work
280281
return mount(bd, true);
281282
}
282283

283-
int FATFileSystem::mount(BlockDevice *bd, bool mount) {
284+
int FATFileSystem::mount(BlockDevice *bd, bool mount)
285+
{
284286
lock();
285287
if (_id != -1) {
286288
unlock();
@@ -322,7 +324,8 @@ int FATFileSystem::unmount()
322324

323325
/* See http://elm-chan.org/fsw/ff/en/mkfs.html for details of f_mkfs() and
324326
* associated arguments. */
325-
int FATFileSystem::format(BlockDevice *bd, bd_size_t cluster_size) {
327+
int FATFileSystem::format(BlockDevice *bd, bd_size_t cluster_size)
328+
{
326329
FATFileSystem fs;
327330
int err = fs.mount(bd, false);
328331
if (err) {
@@ -345,7 +348,8 @@ int FATFileSystem::format(BlockDevice *bd, bd_size_t cluster_size) {
345348
return 0;
346349
}
347350

348-
int FATFileSystem::reformat(BlockDevice *bd, int allocation_unit) {
351+
int FATFileSystem::reformat(BlockDevice *bd, int allocation_unit)
352+
{
349353
lock();
350354
if (_id != -1) {
351355
if (!bd) {
@@ -375,7 +379,8 @@ int FATFileSystem::reformat(BlockDevice *bd, int allocation_unit) {
375379
return err;
376380
}
377381

378-
int FATFileSystem::remove(const char *path) {
382+
int FATFileSystem::remove(const char *path)
383+
{
379384
Deferred<const char*> fpath = fat_path_prefix(_id, path);
380385

381386
lock();
@@ -388,7 +393,8 @@ int FATFileSystem::remove(const char *path) {
388393
return fat_error_remap(res);
389394
}
390395

391-
int FATFileSystem::rename(const char *oldpath, const char *newpath) {
396+
int FATFileSystem::rename(const char *oldpath, const char *newpath)
397+
{
392398
Deferred<const char*> oldfpath = fat_path_prefix(_id, oldpath);
393399
Deferred<const char*> newfpath = fat_path_prefix(_id, newpath);
394400

@@ -402,7 +408,8 @@ int FATFileSystem::rename(const char *oldpath, const char *newpath) {
402408
return fat_error_remap(res);
403409
}
404410

405-
int FATFileSystem::mkdir(const char *path, mode_t mode) {
411+
int FATFileSystem::mkdir(const char *path, mode_t mode)
412+
{
406413
Deferred<const char*> fpath = fat_path_prefix(_id, path);
407414

408415
lock();
@@ -415,7 +422,8 @@ int FATFileSystem::mkdir(const char *path, mode_t mode) {
415422
return fat_error_remap(res);
416423
}
417424

418-
int FATFileSystem::stat(const char *path, struct stat *st) {
425+
int FATFileSystem::stat(const char *path, struct stat *st)
426+
{
419427
Deferred<const char*> fpath = fat_path_prefix(_id, path);
420428

421429
lock();
@@ -442,7 +450,8 @@ int FATFileSystem::stat(const char *path, struct stat *st) {
442450
return 0;
443451
}
444452

445-
int FATFileSystem::statvfs(const char *path, struct statvfs *buf) {
453+
int FATFileSystem::statvfs(const char *path, struct statvfs *buf)
454+
{
446455

447456
memset(buf, 0, sizeof(struct statvfs));
448457
FATFS *fs;
@@ -470,17 +479,20 @@ int FATFileSystem::statvfs(const char *path, struct statvfs *buf) {
470479
return 0;
471480
}
472481

473-
void FATFileSystem::lock() {
482+
void FATFileSystem::lock()
483+
{
474484
_ffs_mutex->lock();
475485
}
476486

477-
void FATFileSystem::unlock() {
487+
void FATFileSystem::unlock()
488+
{
478489
_ffs_mutex->unlock();
479490
}
480491

481492

482493
////// File operations //////
483-
int FATFileSystem::file_open(fs_file_t *file, const char *path, int flags) {
494+
int FATFileSystem::file_open(fs_file_t *file, const char *path, int flags)
495+
{
484496
debug_if(FFS_DBG, "open(%s) on filesystem [%s], drv [%s]\n", path, getName(), _id);
485497

486498
FIL *fh = new FIL;
@@ -524,7 +536,8 @@ int FATFileSystem::file_open(fs_file_t *file, const char *path, int flags) {
524536
return 0;
525537
}
526538

527-
int FATFileSystem::file_close(fs_file_t file) {
539+
int FATFileSystem::file_close(fs_file_t file)
540+
{
528541
FIL *fh = static_cast<FIL*>(file);
529542

530543
lock();
@@ -535,7 +548,8 @@ int FATFileSystem::file_close(fs_file_t file) {
535548
return fat_error_remap(res);
536549
}
537550

538-
ssize_t FATFileSystem::file_read(fs_file_t file, void *buffer, size_t len) {
551+
ssize_t FATFileSystem::file_read(fs_file_t file, void *buffer, size_t len)
552+
{
539553
FIL *fh = static_cast<FIL*>(file);
540554

541555
lock();
@@ -551,7 +565,8 @@ ssize_t FATFileSystem::file_read(fs_file_t file, void *buffer, size_t len) {
551565
}
552566
}
553567

554-
ssize_t FATFileSystem::file_write(fs_file_t file, const void *buffer, size_t len) {
568+
ssize_t FATFileSystem::file_write(fs_file_t file, const void *buffer, size_t len)
569+
{
555570
FIL *fh = static_cast<FIL*>(file);
556571

557572
lock();
@@ -567,7 +582,8 @@ ssize_t FATFileSystem::file_write(fs_file_t file, const void *buffer, size_t len
567582
}
568583
}
569584

570-
int FATFileSystem::file_sync(fs_file_t file) {
585+
int FATFileSystem::file_sync(fs_file_t file)
586+
{
571587
FIL *fh = static_cast<FIL*>(file);
572588

573589
lock();
@@ -580,7 +596,8 @@ int FATFileSystem::file_sync(fs_file_t file) {
580596
return fat_error_remap(res);
581597
}
582598

583-
off_t FATFileSystem::file_seek(fs_file_t file, off_t offset, int whence) {
599+
off_t FATFileSystem::file_seek(fs_file_t file, off_t offset, int whence)
600+
{
584601
FIL *fh = static_cast<FIL*>(file);
585602

586603
lock();
@@ -602,7 +619,8 @@ off_t FATFileSystem::file_seek(fs_file_t file, off_t offset, int whence) {
602619
}
603620
}
604621

605-
off_t FATFileSystem::file_tell(fs_file_t file) {
622+
off_t FATFileSystem::file_tell(fs_file_t file)
623+
{
606624
FIL *fh = static_cast<FIL*>(file);
607625

608626
lock();
@@ -612,7 +630,8 @@ off_t FATFileSystem::file_tell(fs_file_t file) {
612630
return res;
613631
}
614632

615-
off_t FATFileSystem::file_size(fs_file_t file) {
633+
off_t FATFileSystem::file_size(fs_file_t file)
634+
{
616635
FIL *fh = static_cast<FIL*>(file);
617636

618637
lock();
@@ -624,7 +643,8 @@ off_t FATFileSystem::file_size(fs_file_t file) {
624643

625644

626645
////// Dir operations //////
627-
int FATFileSystem::dir_open(fs_dir_t *dir, const char *path) {
646+
int FATFileSystem::dir_open(fs_dir_t *dir, const char *path)
647+
{
628648
FATFS_DIR *dh = new FATFS_DIR;
629649
Deferred<const char*> fpath = fat_path_prefix(_id, path);
630650

@@ -642,7 +662,8 @@ int FATFileSystem::dir_open(fs_dir_t *dir, const char *path) {
642662
return 0;
643663
}
644664

645-
int FATFileSystem::dir_close(fs_dir_t dir) {
665+
int FATFileSystem::dir_close(fs_dir_t dir)
666+
{
646667
FATFS_DIR *dh = static_cast<FATFS_DIR*>(dir);
647668

648669
lock();
@@ -653,7 +674,8 @@ int FATFileSystem::dir_close(fs_dir_t dir) {
653674
return fat_error_remap(res);
654675
}
655676

656-
ssize_t FATFileSystem::dir_read(fs_dir_t dir, struct dirent *ent) {
677+
ssize_t FATFileSystem::dir_read(fs_dir_t dir, struct dirent *ent)
678+
{
657679
FATFS_DIR *dh = static_cast<FATFS_DIR*>(dir);
658680
FILINFO finfo;
659681

@@ -681,7 +703,8 @@ ssize_t FATFileSystem::dir_read(fs_dir_t dir, struct dirent *ent) {
681703
return 1;
682704
}
683705

684-
void FATFileSystem::dir_seek(fs_dir_t dir, off_t offset) {
706+
void FATFileSystem::dir_seek(fs_dir_t dir, off_t offset)
707+
{
685708
FATFS_DIR *dh = static_cast<FATFS_DIR*>(dir);
686709

687710
lock();
@@ -703,7 +726,8 @@ void FATFileSystem::dir_seek(fs_dir_t dir, off_t offset) {
703726
unlock();
704727
}
705728

706-
off_t FATFileSystem::dir_tell(fs_dir_t dir) {
729+
off_t FATFileSystem::dir_tell(fs_dir_t dir)
730+
{
707731
FATFS_DIR *dh = static_cast<FATFS_DIR*>(dir);
708732

709733
lock();
@@ -713,7 +737,8 @@ off_t FATFileSystem::dir_tell(fs_dir_t dir) {
713737
return offset;
714738
}
715739

716-
void FATFileSystem::dir_rewind(fs_dir_t dir) {
740+
void FATFileSystem::dir_rewind(fs_dir_t dir)
741+
{
717742
FATFS_DIR *dh = static_cast<FATFS_DIR*>(dir);
718743

719744
lock();

0 commit comments

Comments
 (0)