Skip to content

Commit eb570f4

Browse files
committed
extmod/vfs_fat: Make fat_vfs_open_obj wrapper public, not its function.
This patch just moves the definition of the wrapper object fat_vfs_open_obj to the location of the definition of its function, which matches how it's done in most other places in the code base.
1 parent 638b860 commit eb570f4

3 files changed

Lines changed: 3 additions & 4 deletions

File tree

extmod/vfs_fat.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,6 @@ STATIC mp_obj_t fat_vfs_mkfs(mp_obj_t bdev_in) {
121121
STATIC MP_DEFINE_CONST_FUN_OBJ_1(fat_vfs_mkfs_fun_obj, fat_vfs_mkfs);
122122
STATIC MP_DEFINE_CONST_STATICMETHOD_OBJ(fat_vfs_mkfs_obj, MP_ROM_PTR(&fat_vfs_mkfs_fun_obj));
123123

124-
STATIC MP_DEFINE_CONST_FUN_OBJ_3(fat_vfs_open_obj, fatfs_builtin_open_self);
125-
126124
typedef struct _mp_vfs_fat_ilistdir_it_t {
127125
mp_obj_base_t base;
128126
mp_fun_1_t iternext;

extmod/vfs_fat.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ extern const byte fresult_to_errno_table[20];
5757
extern const mp_obj_type_t mp_fat_vfs_type;
5858

5959
mp_import_stat_t fat_vfs_import_stat(struct _fs_user_mount_t *vfs, const char *path);
60-
mp_obj_t fatfs_builtin_open_self(mp_obj_t self_in, mp_obj_t path, mp_obj_t mode);
60+
MP_DECLARE_CONST_FUN_OBJ_3(fat_vfs_open_obj);
6161
MP_DECLARE_CONST_FUN_OBJ_KW(mp_builtin_open_obj);
6262

6363
#endif // MICROPY_INCLUDED_EXTMOD_VFS_FAT_H

extmod/vfs_fat_file.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ const mp_obj_type_t mp_type_textio = {
282282
};
283283

284284
// Factory function for I/O stream classes
285-
mp_obj_t fatfs_builtin_open_self(mp_obj_t self_in, mp_obj_t path, mp_obj_t mode) {
285+
STATIC mp_obj_t fatfs_builtin_open_self(mp_obj_t self_in, mp_obj_t path, mp_obj_t mode) {
286286
// TODO: analyze buffering args and instantiate appropriate type
287287
fs_user_mount_t *self = MP_OBJ_TO_PTR(self_in);
288288
mp_arg_val_t arg_vals[FILE_OPEN_NUM_ARGS];
@@ -291,5 +291,6 @@ mp_obj_t fatfs_builtin_open_self(mp_obj_t self_in, mp_obj_t path, mp_obj_t mode)
291291
arg_vals[2].u_obj = mp_const_none;
292292
return file_open(self, &mp_type_textio, arg_vals);
293293
}
294+
MP_DEFINE_CONST_FUN_OBJ_3(fat_vfs_open_obj, fatfs_builtin_open_self);
294295

295296
#endif // MICROPY_VFS && MICROPY_VFS_FAT

0 commit comments

Comments
 (0)