From 73ab28bdf58f126b0db3d9f6f29c96e467452348 Mon Sep 17 00:00:00 2001 From: ITotalJustice <47043333+ITotalJustice@users.noreply.github.com> Date: Mon, 30 Dec 2024 17:28:13 +0000 Subject: [PATCH] remove "[static FS_MAX_PATH]" in place of "[FS_MAX_PATH]" to be c++ compatible. --- src/platform/nx/vfs/vfs_nx_fs.c | 20 ++++++++++---------- src/platform/nx/vfs/vfs_nx_fs.h | 18 +++++++++--------- src/platform/nx/vfs/vfs_nx_gc.c | 2 +- src/platform/nx/vfs/vfs_nx_save.c | 2 +- src/platform/nx/vfs/vfs_nx_stdio.c | 2 +- 5 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/platform/nx/vfs/vfs_nx_fs.c b/src/platform/nx/vfs/vfs_nx_fs.c index 1502e0c..26baa53 100644 --- a/src/platform/nx/vfs/vfs_nx_fs.c +++ b/src/platform/nx/vfs/vfs_nx_fs.c @@ -328,7 +328,7 @@ static Result flush_buffered_write(struct VfsFsFile* f) { } #endif -static int fstat_internal(FsFileSystem* fs, FsFile* file, const char nxpath[static FS_MAX_PATH], struct stat* st) { +static int fstat_internal(FsFileSystem* fs, FsFile* file, const char nxpath[FS_MAX_PATH], struct stat* st) { memset(st, 0, sizeof(*st)); Result rc; @@ -352,7 +352,7 @@ static int fstat_internal(FsFileSystem* fs, FsFile* file, const char nxpath[stat return 0; } -int vfs_fs_internal_open(FsFileSystem* fs, struct VfsFsFile* f, const char nxpath[static FS_MAX_PATH], enum FtpVfsOpenMode mode) { +int vfs_fs_internal_open(FsFileSystem* fs, struct VfsFsFile* f, const char nxpath[FS_MAX_PATH], enum FtpVfsOpenMode mode) { u32 open_mode; if (mode == FtpVfsOpenMode_READ) { open_mode = FsOpenMode_Read; @@ -503,7 +503,7 @@ int vfs_fs_internal_isfile_open(struct VfsFsFile* f) { return f->is_valid; } -int vfs_fs_internal_opendir(FsFileSystem* fs, struct VfsFsDir* f, const char nxpath[static FS_MAX_PATH]) { +int vfs_fs_internal_opendir(FsFileSystem* fs, struct VfsFsDir* f, const char nxpath[FS_MAX_PATH]) { Result rc; if (R_FAILED(rc = fsFsOpenDirectory(fs, nxpath, FsDirOpenMode_ReadDirs | FsDirOpenMode_ReadFiles, &f->dir))) { return vfs_fs_set_errno(rc); @@ -528,7 +528,7 @@ const char* vfs_fs_internal_readdir(struct VfsFsDir* f, struct VfsFsDirEntry* en return entry->buf.name; } -int vfs_fs_internal_dirlstat(FsFileSystem* fs, struct VfsFsDir* f, const struct VfsFsDirEntry* entry, const char nxpath[static FS_MAX_PATH], struct stat* st) { +int vfs_fs_internal_dirlstat(FsFileSystem* fs, struct VfsFsDir* f, const struct VfsFsDirEntry* entry, const char nxpath[FS_MAX_PATH], struct stat* st) { memset(st, 0, sizeof(*st)); st->st_nlink = 1; @@ -564,7 +564,7 @@ int vfs_fs_internal_isdir_open(struct VfsFsDir* f) { return f->is_valid; } -int vfs_fs_internal_stat(FsFileSystem* fs, const char nxpath[static FS_MAX_PATH], struct stat* st) { +int vfs_fs_internal_stat(FsFileSystem* fs, const char nxpath[FS_MAX_PATH], struct stat* st) { memset(st, 0, sizeof(*st)); Result rc; @@ -590,11 +590,11 @@ int vfs_fs_internal_stat(FsFileSystem* fs, const char nxpath[static FS_MAX_PATH] return 0; } -int vfs_fs_internal_lstat(FsFileSystem* fs, const char nxpath[static FS_MAX_PATH], struct stat* st) { +int vfs_fs_internal_lstat(FsFileSystem* fs, const char nxpath[FS_MAX_PATH], struct stat* st) { return vfs_fs_internal_stat(fs, nxpath, st); } -int vfs_fs_internal_mkdir(FsFileSystem* fs, const char nxpath[static FS_MAX_PATH]) { +int vfs_fs_internal_mkdir(FsFileSystem* fs, const char nxpath[FS_MAX_PATH]) { Result rc; if (R_FAILED(rc = fsFsCreateDirectory(fs, nxpath))) { return vfs_fs_set_errno(rc); @@ -603,7 +603,7 @@ int vfs_fs_internal_mkdir(FsFileSystem* fs, const char nxpath[static FS_MAX_PATH return 0; } -int vfs_fs_internal_unlink(FsFileSystem* fs, const char nxpath[static FS_MAX_PATH]) { +int vfs_fs_internal_unlink(FsFileSystem* fs, const char nxpath[FS_MAX_PATH]) { Result rc; if (R_FAILED(rc = fsFsDeleteFile(fs, nxpath))) { return vfs_fs_set_errno(rc); @@ -612,7 +612,7 @@ int vfs_fs_internal_unlink(FsFileSystem* fs, const char nxpath[static FS_MAX_PAT return 0; } -int vfs_fs_internal_rmdir(FsFileSystem* fs, const char nxpath[static FS_MAX_PATH]) { +int vfs_fs_internal_rmdir(FsFileSystem* fs, const char nxpath[FS_MAX_PATH]) { Result rc; if (R_FAILED(rc = fsFsDeleteDirectory(fs, nxpath))) { return vfs_fs_set_errno(rc); @@ -621,7 +621,7 @@ int vfs_fs_internal_rmdir(FsFileSystem* fs, const char nxpath[static FS_MAX_PATH return 0; } -int vfs_fs_internal_rename(FsFileSystem* fs, const char nxpath_src[static FS_MAX_PATH], const char nxpath_dst[static FS_MAX_PATH]) { +int vfs_fs_internal_rename(FsFileSystem* fs, const char nxpath_src[FS_MAX_PATH], const char nxpath_dst[FS_MAX_PATH]) { Result rc; FsDirEntryType type; if (R_FAILED(rc = fsFsGetEntryType(fs, nxpath_src, &type))) { diff --git a/src/platform/nx/vfs/vfs_nx_fs.h b/src/platform/nx/vfs/vfs_nx_fs.h index f322bbb..0f121d2 100644 --- a/src/platform/nx/vfs/vfs_nx_fs.h +++ b/src/platform/nx/vfs/vfs_nx_fs.h @@ -33,25 +33,25 @@ struct VfsFsDirEntry { }; int vfs_fs_set_errno(Result rc); -int vfs_fs_internal_open(FsFileSystem* fs, struct VfsFsFile* f, const char nxpath[static FS_MAX_PATH], enum FtpVfsOpenMode mode); +int vfs_fs_internal_open(FsFileSystem* fs, struct VfsFsFile* f, const char nxpath[FS_MAX_PATH], enum FtpVfsOpenMode mode); int vfs_fs_internal_read(struct VfsFsFile* f, void* buf, size_t size); int vfs_fs_internal_write(struct VfsFsFile* f, const void* buf, size_t size); int vfs_fs_internal_seek(struct VfsFsFile* f, size_t off); int vfs_fs_internal_close(struct VfsFsFile* f); int vfs_fs_internal_isfile_open(struct VfsFsFile* f); -int vfs_fs_internal_opendir(FsFileSystem* fs, struct VfsFsDir* f, const char nxpath[static FS_MAX_PATH]); +int vfs_fs_internal_opendir(FsFileSystem* fs, struct VfsFsDir* f, const char nxpath[FS_MAX_PATH]); const char* vfs_fs_internal_readdir(struct VfsFsDir* f, struct VfsFsDirEntry* entry); -int vfs_fs_internal_dirlstat(FsFileSystem* fs, struct VfsFsDir* f, const struct VfsFsDirEntry* entry, const char nxpath[static FS_MAX_PATH], struct stat* st); +int vfs_fs_internal_dirlstat(FsFileSystem* fs, struct VfsFsDir* f, const struct VfsFsDirEntry* entry, const char nxpath[FS_MAX_PATH], struct stat* st); int vfs_fs_internal_closedir(struct VfsFsDir* f); int vfs_fs_internal_isdir_open(struct VfsFsDir* f); -int vfs_fs_internal_stat(FsFileSystem* fs, const char nxpath[static FS_MAX_PATH], struct stat* st); -int vfs_fs_internal_lstat(FsFileSystem* fs, const char nxpath[static FS_MAX_PATH], struct stat* st); -int vfs_fs_internal_mkdir(FsFileSystem* fs, const char nxpath[static FS_MAX_PATH]); -int vfs_fs_internal_unlink(FsFileSystem* fs, const char nxpath[static FS_MAX_PATH]); -int vfs_fs_internal_rmdir(FsFileSystem* fs, const char nxpath[static FS_MAX_PATH]); -int vfs_fs_internal_rename(FsFileSystem* fs, const char nxpath_src[static FS_MAX_PATH], const char nxpath_dst[static FS_MAX_PATH]); +int vfs_fs_internal_stat(FsFileSystem* fs, const char nxpath[FS_MAX_PATH], struct stat* st); +int vfs_fs_internal_lstat(FsFileSystem* fs, const char nxpath[FS_MAX_PATH], struct stat* st); +int vfs_fs_internal_mkdir(FsFileSystem* fs, const char nxpath[FS_MAX_PATH]); +int vfs_fs_internal_unlink(FsFileSystem* fs, const char nxpath[FS_MAX_PATH]); +int vfs_fs_internal_rmdir(FsFileSystem* fs, const char nxpath[FS_MAX_PATH]); +int vfs_fs_internal_rename(FsFileSystem* fs, const char nxpath_src[FS_MAX_PATH], const char nxpath_dst[FS_MAX_PATH]); struct FtpVfs; const extern struct FtpVfs g_vfs_fs; diff --git a/src/platform/nx/vfs/vfs_nx_gc.c b/src/platform/nx/vfs/vfs_nx_gc.c index 4abb328..49fdde6 100644 --- a/src/platform/nx/vfs/vfs_nx_gc.c +++ b/src/platform/nx/vfs/vfs_nx_gc.c @@ -129,7 +129,7 @@ static enum GcDirType get_type(const char* path) { return GcDirType_Invalid; } -static void build_native_path(char out[static FS_MAX_PATH], const char* path) { +static void build_native_path(char out[FS_MAX_PATH], const char* path) { const char* dilem = strchr(path, ']'); if (dilem && strlen(dilem + 1)) { diff --git a/src/platform/nx/vfs/vfs_nx_save.c b/src/platform/nx/vfs/vfs_nx_save.c index c1e19fe..ac38c4a 100644 --- a/src/platform/nx/vfs/vfs_nx_save.c +++ b/src/platform/nx/vfs/vfs_nx_save.c @@ -604,7 +604,7 @@ static struct SavePathData get_type(const char* path) { return data; } -static void build_native_path(char out[static FS_MAX_PATH], const char* path, const struct SavePathData* data) { +static void build_native_path(char out[FS_MAX_PATH], const char* path, const struct SavePathData* data) { if (strlen(path + data->path_off)) { snprintf(out, FS_MAX_PATH, "%s", path + data->path_off); } else { diff --git a/src/platform/nx/vfs/vfs_nx_stdio.c b/src/platform/nx/vfs/vfs_nx_stdio.c index 4839552..3c82573 100644 --- a/src/platform/nx/vfs/vfs_nx_stdio.c +++ b/src/platform/nx/vfs/vfs_nx_stdio.c @@ -12,7 +12,7 @@ #include #include -static void build_native_path(char out[static FS_MAX_PATH], const char* path) { +static void build_native_path(char out[FS_MAX_PATH], const char* path) { const char* dilem = strchr(path, ':'); if (dilem && strlen(dilem + 1)) {