Skip to content

Commit

Permalink
remove "[static FS_MAX_PATH]" in place of "[FS_MAX_PATH]" to be c++ c…
Browse files Browse the repository at this point in the history
…ompatible.
  • Loading branch information
ITotalJustice committed Dec 30, 2024
1 parent 617fda5 commit 73ab28b
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 22 deletions.
20 changes: 10 additions & 10 deletions src/platform/nx/vfs/vfs_nx_fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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);
Expand All @@ -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;

Expand Down Expand Up @@ -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;
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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))) {
Expand Down
18 changes: 9 additions & 9 deletions src/platform/nx/vfs/vfs_nx_fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/platform/nx/vfs/vfs_nx_gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
2 changes: 1 addition & 1 deletion src/platform/nx/vfs/vfs_nx_save.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/platform/nx/vfs/vfs_nx_stdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <stdio.h>
#include <unistd.h>

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)) {
Expand Down

0 comments on commit 73ab28b

Please sign in to comment.