compat fixes for libnx master

This commit is contained in:
Michael Scire 2019-11-28 22:19:39 -08:00 committed by SciresM
parent 4f9838df3c
commit b1a9e8d0df
6 changed files with 20 additions and 20 deletions

View file

@ -123,12 +123,12 @@ namespace ams::dmnt {
Result TargetIO_FileOpen(sf::Out<TargetIOFileHandle> out_hnd, const sf::InBuffer &path, int open_mode, u32 create_mode);
Result TargetIO_FileClose(TargetIOFileHandle hnd);
Result TargetIO_FileRead(TargetIOFileHandle hnd, const sf::OutNonSecureBuffer &out_data, sf::Out<u32> out_read, u64 offset);
Result TargetIO_FileWrite(TargetIOFileHandle hnd, const sf::InNonSecureBuffer &data, sf::Out<u32> out_written, u64 offset);
Result TargetIO_FileRead(TargetIOFileHandle hnd, const sf::OutNonSecureBuffer &out_data, sf::Out<u32> out_read, s64 offset);
Result TargetIO_FileWrite(TargetIOFileHandle hnd, const sf::InNonSecureBuffer &data, sf::Out<u32> out_written, s64 offset);
Result TargetIO_FileSetAttributes(const sf::InBuffer &path, const sf::InBuffer &attributes);
Result TargetIO_FileGetInformation(const sf::InBuffer &path, const sf::OutArray<u64> &out_info, sf::Out<int> is_directory);
Result TargetIO_FileSetTime(const sf::InBuffer &path, u64 create, u64 access, u64 modify);
Result TargetIO_FileSetSize(const sf::InBuffer &input, u64 size);
Result TargetIO_FileSetSize(const sf::InBuffer &input, s64 size);
Result TargetIO_FileDelete(const sf::InBuffer &path);
Result TargetIO_FileMove(const sf::InBuffer &src_path, const sf::InBuffer &dst_path);
public:

View file

@ -153,7 +153,7 @@ namespace ams::dmnt {
return CloseFileByHandle(hnd);
}
Result DebugMonitorService::TargetIO_FileRead(TargetIOFileHandle hnd, const sf::OutNonSecureBuffer &out_data, sf::Out<u32> out_read, u64 offset) {
Result DebugMonitorService::TargetIO_FileRead(TargetIOFileHandle hnd, const sf::OutNonSecureBuffer &out_data, sf::Out<u32> out_read, s64 offset) {
FsFile f;
size_t read = 0;
@ -164,7 +164,7 @@ namespace ams::dmnt {
return ResultSuccess();
}
Result DebugMonitorService::TargetIO_FileWrite(TargetIOFileHandle hnd, const sf::InNonSecureBuffer &data, sf::Out<u32> out_written, u64 offset) {
Result DebugMonitorService::TargetIO_FileWrite(TargetIOFileHandle hnd, const sf::InNonSecureBuffer &data, sf::Out<u32> out_written, s64 offset) {
FsFile f;
R_TRY(GetFileByHandle(&f, hnd));
@ -197,7 +197,7 @@ namespace ams::dmnt {
/* N doesn't check this return code. */
if (out_info.GetSize() > 0) {
fsFileGetSize(&f, &out_info[0]);
fsFileGetSize(&f, reinterpret_cast<s64 *>(&out_info[0]));
}
/* TODO: N does not call fsFsGetFileTimestampRaw here, but we possibly could. */
@ -216,7 +216,7 @@ namespace ams::dmnt {
return ResultSuccess();
}
Result DebugMonitorService::TargetIO_FileSetSize(const sf::InBuffer &input, u64 size) {
Result DebugMonitorService::TargetIO_FileSetSize(const sf::InBuffer &input, s64 size) {
/* Why does this function take in a path and not a file handle? */
R_TRY(EnsureSdInitialized());

View file

@ -38,7 +38,7 @@ namespace ams::fs {
}
virtual Result GetSizeImpl(s64 *out) override final {
return fsFileGetSize(this->base_file.get(), reinterpret_cast<u64 *>(out));
return fsFileGetSize(this->base_file.get(), out);
}
virtual Result FlushImpl() override final {
@ -72,11 +72,11 @@ namespace ams::fs {
virtual ~RemoteDirectory() { fsDirClose(this->base_dir.get()); }
public:
virtual Result ReadImpl(s64 *out_count, DirectoryEntry *out_entries, s64 max_entries) override final {
return fsDirRead(this->base_dir.get(), 0, reinterpret_cast<u64 *>(out_count), max_entries, out_entries);
return fsDirRead(this->base_dir.get(), out_count, max_entries, out_entries);
}
virtual Result GetEntryCountImpl(s64 *out) override final {
return fsDirGetEntryCount(this->base_dir.get(), reinterpret_cast<u64 *>(out));
return fsDirGetEntryCount(this->base_dir.get(), out);
}
};
@ -147,11 +147,11 @@ namespace ams::fs {
virtual Result GetFreeSpaceSizeImpl(s64 *out, const char *path) {
return fsFsGetFreeSpace(this->base_fs.get(), path, reinterpret_cast<u64 *>(out));
return fsFsGetFreeSpace(this->base_fs.get(), path, out);
}
virtual Result GetTotalSpaceSizeImpl(s64 *out, const char *path) {
return fsFsGetTotalSpace(this->base_fs.get(), path, reinterpret_cast<u64 *>(out));
return fsFsGetTotalSpace(this->base_fs.get(), path, out);
}
virtual Result CleanDirectoryRecursivelyImpl(const char *path) {
@ -163,8 +163,8 @@ namespace ams::fs {
return fsFsGetFileTimeStampRaw(this->base_fs.get(), path, reinterpret_cast<::FsTimeStampRaw *>(out));
}
virtual Result QueryEntryImpl(char *dst, size_t dst_size, const char *src, size_t src_size, fsa::QueryType query, const char *path) {
return fsFsQueryEntry(this->base_fs.get(), dst, dst_size, src, src_size, path, static_cast<FsFileSystemQueryType>(query));
virtual Result QueryEntryImpl(char *dst, size_t dst_size, const char *src, size_t src_size, fsa::QueryId query, const char *path) {
return fsFsQueryEntry(this->base_fs.get(), dst, dst_size, src, src_size, path, static_cast<FsFileSystemQueryId>(query));
}
};

View file

@ -44,7 +44,7 @@ namespace ams::fs {
};
virtual Result GetSize(s64 *out_size) override {
return fsStorageGetSize(this->base_storage.get(), reinterpret_cast<u64 *>(out_size));
return fsStorageGetSize(this->base_storage.get(), out_size);
};
virtual Result SetSize(s64 size) override {

View file

@ -23,8 +23,8 @@ namespace ams::fs::fsa {
class IFile;
class IDirectory;
enum class QueryType {
SetArchiveBit = FsFileSystemQueryType_SetArchiveBit
enum class QueryId {
SetConcatenationFileAttribute = FsFileSystemQueryId_SetConcatenationFileAttribute
};
class IFileSystem {
@ -122,7 +122,7 @@ namespace ams::fs::fsa {
return this->GetFileTimeStampRawImpl(out, path);
}
Result QueryEntry(char *dst, size_t dst_size, const char *src, size_t src_size, QueryType query, const char *path) {
Result QueryEntry(char *dst, size_t dst_size, const char *src, size_t src_size, QueryId query, const char *path) {
R_UNLESS(path != nullptr, fs::ResultInvalidPath());
return this->QueryEntryImpl(dst, dst_size, src, src_size, query, path);
}
@ -170,7 +170,7 @@ namespace ams::fs::fsa {
return fs::ResultNotImplemented();
}
virtual Result QueryEntryImpl(char *dst, size_t dst_size, const char *src, size_t src_size, QueryType query, const char *path) {
virtual Result QueryEntryImpl(char *dst, size_t dst_size, const char *src, size_t src_size, QueryId query, const char *path) {
return fs::ResultNotImplemented();
}

View file

@ -30,7 +30,7 @@ namespace ams::util::ini {
size_t num_left;
explicit FsFileContext(FsFile *f) : f(f), offset(0) {
u64 size;
s64 size;
R_ASSERT(fsFileGetSize(this->f, &size));
this->num_left = size_t(size);
}