Skip to content
Snippets Groups Projects
Verified Commit 4c977d6a authored by rahix's avatar rahix
Browse files

fix(fatfs): Remove typedef for epic_stat


Signed-off-by: default avatarRahix <rahix@rahix.de>
parent b7e210c9
No related branches found
No related tags found
No related merge requests found
...@@ -620,8 +620,8 @@ enum epic_stat_type { ...@@ -620,8 +620,8 @@ enum epic_stat_type {
}; };
/** */ /** */
typedef struct epic_stat_t { struct epic_stat {
/** type: file, directory or none */ /** Entity Type: file, directory or none */
enum epic_stat_type type; enum epic_stat_type type;
/* note about padding & placement of uint32_t size: /* note about padding & placement of uint32_t size:
* to accomodate for future expansion, we want padding at the end of * to accomodate for future expansion, we want padding at the end of
...@@ -636,11 +636,11 @@ typedef struct epic_stat_t { ...@@ -636,11 +636,11 @@ typedef struct epic_stat_t {
* between system and user volume)*/ * between system and user volume)*/
uint8_t volume; uint8_t volume;
uint8_t _reserved[9]; uint8_t _reserved[9];
} epic_stat_t; };
#ifndef __cplusplus #ifndef __cplusplus
#if defined(__GNUC__) && ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) #if defined(__GNUC__) && ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
_Static_assert(sizeof(epic_stat_t) == 20, ""); _Static_assert(sizeof(struct epic_stat) == 20, "");
#endif #endif
#endif #endif
...@@ -648,11 +648,13 @@ _Static_assert(sizeof(epic_stat_t) == 20, ""); ...@@ -648,11 +648,13 @@ _Static_assert(sizeof(epic_stat_t) == 20, "");
* stat path * stat path
* *
* :param const char* filename: path to stat * :param const char* filename: path to stat
* :param epic_stat_t* stat: pointer to result * :param epic_stat* stat: pointer to result
* *
* :return: `0` on success, negative on error * :return: `0` on success, negative on error
*/ */
API(API_FILE_STAT, int epic_file_stat(const char* path, epic_stat_t* stat)); API(API_FILE_STAT, int epic_file_stat(
const char* path, struct epic_stat* stat
));
/** /**
* RTC * RTC
......
...@@ -280,7 +280,7 @@ int epic_file_tell(int fd) ...@@ -280,7 +280,7 @@ int epic_file_tell(int fd)
return f_tell(&o->file); return f_tell(&o->file);
} }
int epic_file_stat(const char *filename, epic_stat_t *stat) int epic_file_stat(const char *filename, struct epic_stat *stat)
{ {
int res; int res;
FILINFO finfo; FILINFO finfo;
......
...@@ -69,7 +69,7 @@ mp_lexer_t *mp_lexer_new_from_file(const char *filename) ...@@ -69,7 +69,7 @@ mp_lexer_t *mp_lexer_new_from_file(const char *filename)
mp_import_stat_t mp_import_stat(const char *path) mp_import_stat_t mp_import_stat(const char *path)
{ {
struct epic_stat_t stat; struct epic_stat stat;
if (epic_file_stat(path, &stat) == 0) { if (epic_file_stat(path, &stat) == 0) {
if (stat.type == EPICSTAT_FILE) { if (stat.type == EPICSTAT_FILE) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment