Remove superfluous casts in FS_Path usage

This commit is contained in:
fincs 2020-07-02 16:34:37 +02:00
parent 818931b51c
commit 83e1f97b5b
No known key found for this signature in database
GPG Key ID: 62C7609ADA219C60
3 changed files with 9 additions and 10 deletions

View File

@ -296,7 +296,7 @@ static int _archiveMountDevice(FS_Archive archive,
device = archiveFindDevice(NULL);
if(device==NULL)
goto _fail;
device->archive = archive;
memset(device->name, 0, sizeof(device->name));
strncpy(device->name, deviceName, sizeof(device->name)-1);
@ -356,7 +356,7 @@ Result archiveMountSdmc(void)
ssize_t units;
uint32_t code;
char *p;
FS_Path sdmcPath = { PATH_EMPTY, 1, (u8*)"" };
FS_Path sdmcPath = { PATH_EMPTY, 1, "" };
FS_Archive sdmcArchive;
Result rc = 0;
@ -465,7 +465,7 @@ Result archiveUnmount(const char *deviceName)
Result archiveUnmountAll(void)
{
u32 total = sizeof(archive_devices) / sizeof(archive_fsdevice);
if(!archive_initialized) return 0;
for(u32 i = 0; i < total; i++)

View File

@ -472,8 +472,8 @@ static bool ndspFindAndLoadComponent(void)
do
{
static const char dsp_filename[] = "/3ds/dspfirm.cdc";
FS_Path archPath = { PATH_EMPTY, 1, (u8*)"" };
FS_Path filePath = { PATH_ASCII, sizeof(dsp_filename), (u8*)dsp_filename };
FS_Path archPath = { PATH_EMPTY, 1, "" };
FS_Path filePath = { PATH_ASCII, sizeof(dsp_filename), dsp_filename };
rc = FSUSER_OpenFileDirectly(&rsrc, ARCHIVE_SDMC, archPath, filePath, FS_OPEN_READ, 0);
if (R_FAILED(rc)) break;

View File

@ -216,8 +216,8 @@ Result romfsMount(struct romfs_mount **p)
}
__utf16path[units] = 0;
FS_Path archPath = { PATH_EMPTY, 1, (u8*)"" };
FS_Path filePath = { PATH_UTF16, (units+1)*2, (u8*)__utf16path };
FS_Path archPath = { PATH_EMPTY, 1, "" };
FS_Path filePath = { PATH_UTF16, (units+1)*2, __utf16path };
Result rc = FSUSER_OpenFileDirectly(&mount->fd, ARCHIVE_SDMC, archPath, filePath, FS_OPEN_READ, 0);
if (R_FAILED(rc))
@ -238,10 +238,9 @@ Result romfsMount(struct romfs_mount **p)
else
{
// Regular RomFS
u8 zeros[0xC];
memset(zeros, 0, sizeof(zeros));
u8 zeros[0xC] = {0};
FS_Path archPath = { PATH_EMPTY, 1, (u8*)"" };
FS_Path archPath = { PATH_EMPTY, 1, "" };
FS_Path filePath = { PATH_BINARY, sizeof(zeros), zeros };
Result rc = FSUSER_OpenFileDirectly(&mount->fd, ARCHIVE_ROMFS, archPath, filePath, FS_OPEN_READ, 0);