stratosphere: remove trailing whitespace
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#pragma once
|
||||
#include <switch.h>
|
||||
#include <stratosphere.hpp>
|
||||
|
||||
@@ -15,12 +15,12 @@
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
enum OpenMode {
|
||||
OpenMode_Read = (1 << 0),
|
||||
OpenMode_Write = (1 << 1),
|
||||
OpenMode_Append = (1 << 2),
|
||||
|
||||
|
||||
OpenMode_ReadWrite = OpenMode_Read | OpenMode_Write,
|
||||
OpenMode_All = OpenMode_ReadWrite | OpenMode_Append,
|
||||
};
|
||||
@@ -28,7 +28,7 @@ enum OpenMode {
|
||||
enum DirectoryOpenMode {
|
||||
DirectoryOpenMode_Directories = (1 << 0),
|
||||
DirectoryOpenMode_Files = (1 << 1),
|
||||
|
||||
|
||||
DirectoryOpenMode_All = (DirectoryOpenMode_Directories | DirectoryOpenMode_Files),
|
||||
};
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#pragma once
|
||||
#include <switch.h>
|
||||
#include <stratosphere.hpp>
|
||||
@@ -57,7 +57,7 @@ class IStorageInterface : public IServiceObject {
|
||||
~IStorageInterface() {
|
||||
delete base_storage;
|
||||
};
|
||||
|
||||
|
||||
private:
|
||||
/* Actual command API. */
|
||||
virtual Result Read(OutBuffer<u8, BufferType_Type1> buffer, u64 offset, u64 size) final {
|
||||
@@ -86,7 +86,7 @@ class IStorageInterface : public IServiceObject {
|
||||
MakeServiceCommandMeta<FsIStorageCmd_Flush, &IStorageInterface::Flush>(),
|
||||
MakeServiceCommandMeta<FsIStorageCmd_SetSize, &IStorageInterface::SetSize>(),
|
||||
MakeServiceCommandMeta<FsIStorageCmd_GetSize, &IStorageInterface::GetSize>(),
|
||||
|
||||
|
||||
/* 4.0.0- */
|
||||
MakeServiceCommandMeta<FsIStorageCmd_OperateRange, &IStorageInterface::OperateRange, FirmwareVersion_400>(),
|
||||
};
|
||||
|
||||
@@ -49,22 +49,22 @@ class FsPathUtils {
|
||||
public:
|
||||
static Result VerifyPath(const char *path, size_t max_path_len, size_t max_name_len);
|
||||
static Result ConvertPathForServiceObject(FsPath *out, const char *path);
|
||||
|
||||
|
||||
static Result IsNormalized(bool *out, const char *path);
|
||||
static Result Normalize(char *out, size_t max_out_size, const char *src, size_t *out_size);
|
||||
|
||||
static bool IsWindowsDriveLetter(const char c) {
|
||||
return ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z');
|
||||
}
|
||||
|
||||
|
||||
static bool IsCurrentDirectory(const char *path) {
|
||||
return path[0] == '.' && (path[1] == 0 || path[1] == '/');
|
||||
}
|
||||
|
||||
|
||||
static bool IsParentDirectory(const char *path) {
|
||||
return path[0] == '.' && path[1] == '.' && (path[2] == 0 || path[2] == '/');
|
||||
}
|
||||
|
||||
|
||||
static bool IsWindowsAbsolutePath(const char *path) {
|
||||
/* Nintendo uses this in path comparisons... */
|
||||
return IsWindowsDriveLetter(path[0]) && path[1] == ':';
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#include <switch.h>
|
||||
#include <string.h>
|
||||
#include "fs_shim.h"
|
||||
@@ -79,7 +79,7 @@ Result fsOpenDataStorageByCurrentProcessFwd(Service* s, FsStorage* out) {
|
||||
u64 magic;
|
||||
u64 result;
|
||||
} *resp;
|
||||
|
||||
|
||||
serviceIpcParse(s, &r, sizeof(*resp));
|
||||
resp = r.Raw;
|
||||
|
||||
@@ -119,7 +119,7 @@ Result fsOpenDataStorageByDataIdFwd(Service* s, FsStorageId storage_id, u64 data
|
||||
u64 magic;
|
||||
u64 result;
|
||||
} *resp;
|
||||
|
||||
|
||||
serviceIpcParse(s, &r, sizeof(*resp));
|
||||
resp = r.Raw;
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#pragma once
|
||||
#include <switch.h>
|
||||
#include <stratosphere.hpp>
|
||||
@@ -32,11 +32,11 @@ class LayeredRomFS : public IROStorage {
|
||||
/* Information about the merged RomFS. */
|
||||
u64 title_id;
|
||||
std::shared_ptr<std::vector<RomFSSourceInfo>> p_source_infos;
|
||||
|
||||
|
||||
public:
|
||||
LayeredRomFS(std::shared_ptr<IROStorage> s_r, std::shared_ptr<IROStorage> f_r, u64 tid);
|
||||
virtual ~LayeredRomFS() = default;
|
||||
|
||||
|
||||
virtual Result Read(void *buffer, size_t size, u64 offset) override;
|
||||
virtual Result GetSize(u64 *out_size) override;
|
||||
virtual Result OperateRange(FsOperationId operation_type, u64 offset, u64 size, FsRangeInfo *out_range_info) override;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#include <cstdlib>
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
@@ -35,16 +35,16 @@ struct FsMitmManagerOptions {
|
||||
};
|
||||
using FsMitmManager = WaitableManager<FsMitmManagerOptions>;
|
||||
|
||||
void FsMitmMain(void *arg) {
|
||||
void FsMitmMain(void *arg) {
|
||||
/* Create server manager. */
|
||||
auto server_manager = new FsMitmManager(5);
|
||||
|
||||
/* Create fsp-srv mitm. */
|
||||
AddMitmServerToManager<FsMitmService>(server_manager, "fsp-srv", 61);
|
||||
|
||||
|
||||
/* Loop forever, servicing our services. */
|
||||
server_manager->Process();
|
||||
|
||||
|
||||
delete server_manager;
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#include <cstdlib>
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#pragma once
|
||||
#include <cstdlib>
|
||||
#include <switch.h>
|
||||
@@ -67,7 +67,7 @@ struct RomFSSourceInfo {
|
||||
RomFSMetaDataSourceInfo metadata_source_info;
|
||||
};
|
||||
RomFSDataSource type;
|
||||
|
||||
|
||||
RomFSSourceInfo(u64 v_o, u64 s, u64 offset, RomFSDataSource t) : virtual_offset(v_o), size(s), type(t) {
|
||||
switch (this->type) {
|
||||
case RomFSDataSource::BaseRomFS:
|
||||
@@ -85,7 +85,7 @@ struct RomFSSourceInfo {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
RomFSSourceInfo(u64 v_o, u64 s, const void *arg, RomFSDataSource t) : virtual_offset(v_o), size(s), type(t) {
|
||||
switch (this->type) {
|
||||
case RomFSDataSource::LooseFile:
|
||||
@@ -103,7 +103,7 @@ struct RomFSSourceInfo {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
RomFSSourceInfo(u64 v_o, u64 s, RomFSDataSource t) : virtual_offset(v_o), size(s), type(t) {
|
||||
switch (this->type) {
|
||||
case RomFSDataSource::MetaData:
|
||||
@@ -118,7 +118,7 @@ struct RomFSSourceInfo {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Cleanup() {
|
||||
switch (this->type) {
|
||||
case RomFSDataSource::BaseRomFS:
|
||||
@@ -137,7 +137,7 @@ struct RomFSSourceInfo {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static bool Compare(RomFSSourceInfo *a, RomFSSourceInfo *b) {
|
||||
return (a->virtual_offset < b->virtual_offset);
|
||||
}
|
||||
@@ -229,13 +229,13 @@ class RomFSBuildContext {
|
||||
u64 dir_hash_table_size = 0;
|
||||
u64 file_hash_table_size = 0;
|
||||
u64 file_partition_size = 0;
|
||||
|
||||
|
||||
FsDirectoryEntry dir_entry;
|
||||
RomFSDataSource cur_source_type;
|
||||
|
||||
|
||||
void VisitDirectory(FsFileSystem *filesys, RomFSBuildDirectoryContext *parent);
|
||||
void VisitDirectory(RomFSBuildDirectoryContext *parent, u32 parent_offset, void *dir_table, size_t dir_table_size, void *file_table, size_t file_table_size);
|
||||
|
||||
|
||||
bool AddDirectory(RomFSBuildDirectoryContext *parent_dir_ctx, RomFSBuildDirectoryContext *dir_ctx, RomFSBuildDirectoryContext **out_dir_ctx);
|
||||
bool AddFile(RomFSBuildDirectoryContext *parent_dir_ctx, RomFSBuildFileContext *file_ctx);
|
||||
public:
|
||||
@@ -247,10 +247,10 @@ class RomFSBuildContext {
|
||||
this->num_dirs = 1;
|
||||
this->dir_table_size = 0x18;
|
||||
}
|
||||
|
||||
|
||||
void MergeSdFiles();
|
||||
void MergeRomStorage(IROStorage *storage, RomFSDataSource source);
|
||||
|
||||
|
||||
/* This finalizes the context. */
|
||||
void Build(std::vector<RomFSSourceInfo> *out_infos);
|
||||
};
|
||||
@@ -270,7 +270,7 @@ static inline uint32_t romfs_calc_path_hash(uint32_t parent, const unsigned char
|
||||
hash = (hash >> 5) | (hash << 27);
|
||||
hash ^= path[start + i];
|
||||
}
|
||||
|
||||
|
||||
return hash;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user