From dc8479928c5aee4c6ad6fe4f59006fb604cee701 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Sun, 18 Sep 2016 09:38:01 +0900 Subject: Sources: Run clang-format on everything. --- src/core/file_sys/archive_backend.h | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) (limited to 'src/core/file_sys/archive_backend.h') diff --git a/src/core/file_sys/archive_backend.h b/src/core/file_sys/archive_backend.h index 5d91e47f3..79fde9710 100644 --- a/src/core/file_sys/archive_backend.h +++ b/src/core/file_sys/archive_backend.h @@ -15,20 +15,13 @@ #include "core/hle/result.h" - namespace FileSys { class FileBackend; class DirectoryBackend; // Path string type -enum LowPathType : u32 { - Invalid = 0, - Empty = 1, - Binary = 2, - Char = 3, - Wchar = 4 -}; +enum LowPathType : u32 { Invalid = 0, Empty = 1, Binary = 2, Char = 3, Wchar = 4 }; union Mode { u32 hex; @@ -39,12 +32,17 @@ union Mode { class Path { public: - Path() : type(Invalid) {} - Path(const char* path) : type(Char), string(path) {} - Path(std::vector binary_data) : type(Binary), binary(std::move(binary_data)) {} + Path() : type(Invalid) { + } + Path(const char* path) : type(Char), string(path) { + } + Path(std::vector binary_data) : type(Binary), binary(std::move(binary_data)) { + } Path(LowPathType type, u32 size, u32 pointer); - LowPathType GetType() const { return type; } + LowPathType GetType() const { + return type; + } /** * Gets the string representation of the path for debugging @@ -64,10 +62,14 @@ private: }; struct ArchiveFormatInfo { - u32_le total_size; ///< The pre-defined size of the archive, as specified in the Create or Format call - u32_le number_directories; ///< The pre-defined number of directories in the archive, as specified in the Create or Format call - u32_le number_files; ///< The pre-defined number of files in the archive, as specified in the Create or Format call - u8 duplicate_data; ///< Whether the archive should duplicate the data, as specified in the Create or Format call + u32_le total_size; ///< The pre-defined size of the archive, as specified in the Create or + /// Format call + u32_le number_directories; ///< The pre-defined number of directories in the archive, as + /// specified in the Create or Format call + u32_le number_files; ///< The pre-defined number of files in the archive, as specified in the + /// Create or Format call + u8 duplicate_data; ///< Whether the archive should duplicate the data, as specified in the + /// Create or Format call }; static_assert(std::is_pod::value, "ArchiveFormatInfo is not POD"); @@ -87,7 +89,8 @@ public: * @param mode Mode to open the file with * @return Opened file, or error code */ - virtual ResultVal> OpenFile(const Path& path, const Mode mode) const = 0; + virtual ResultVal> OpenFile(const Path& path, + const Mode mode) const = 0; /** * Delete a file specified by its path -- cgit v1.2.3 From 396a8d91a4423d9c793eeff0798d544613647511 Mon Sep 17 00:00:00 2001 From: Yuri Kunde Schlesner Date: Sun, 18 Sep 2016 18:01:46 -0700 Subject: Manually tweak source formatting and then re-run clang-format --- src/core/file_sys/archive_backend.h | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) (limited to 'src/core/file_sys/archive_backend.h') diff --git a/src/core/file_sys/archive_backend.h b/src/core/file_sys/archive_backend.h index 79fde9710..7f64fe4e2 100644 --- a/src/core/file_sys/archive_backend.h +++ b/src/core/file_sys/archive_backend.h @@ -21,7 +21,13 @@ class FileBackend; class DirectoryBackend; // Path string type -enum LowPathType : u32 { Invalid = 0, Empty = 1, Binary = 2, Char = 3, Wchar = 4 }; +enum LowPathType : u32 { + Invalid = 0, + Empty = 1, + Binary = 2, + Char = 3, + Wchar = 4, +}; union Mode { u32 hex; @@ -32,12 +38,9 @@ union Mode { class Path { public: - Path() : type(Invalid) { - } - Path(const char* path) : type(Char), string(path) { - } - Path(std::vector binary_data) : type(Binary), binary(std::move(binary_data)) { - } + Path() : type(Invalid) {} + Path(const char* path) : type(Char), string(path) {} + Path(std::vector binary_data) : type(Binary), binary(std::move(binary_data)) {} Path(LowPathType type, u32 size, u32 pointer); LowPathType GetType() const { @@ -61,22 +64,18 @@ private: std::u16string u16str; }; +/// Parameters of the archive, as specified in the Create or Format call. struct ArchiveFormatInfo { - u32_le total_size; ///< The pre-defined size of the archive, as specified in the Create or - /// Format call - u32_le number_directories; ///< The pre-defined number of directories in the archive, as - /// specified in the Create or Format call - u32_le number_files; ///< The pre-defined number of files in the archive, as specified in the - /// Create or Format call - u8 duplicate_data; ///< Whether the archive should duplicate the data, as specified in the - /// Create or Format call + u32_le total_size; ///< The pre-defined size of the archive. + u32_le number_directories; ///< The pre-defined number of directories in the archive. + u32_le number_files; ///< The pre-defined number of files in the archive. + u8 duplicate_data; ///< Whether the archive should duplicate the data. }; static_assert(std::is_pod::value, "ArchiveFormatInfo is not POD"); class ArchiveBackend : NonCopyable { public: - virtual ~ArchiveBackend() { - } + virtual ~ArchiveBackend() {} /** * Get a descriptive name for the archive (e.g. "RomFS", "SaveData", etc.) @@ -153,8 +152,7 @@ public: class ArchiveFactory : NonCopyable { public: - virtual ~ArchiveFactory() { - } + virtual ~ArchiveFactory() {} /** * Get a descriptive name for the archive (e.g. "RomFS", "SaveData", etc.) -- cgit v1.2.3 From ebdae19fd226104baec712b9da9939ff82ef3c3a Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Wed, 21 Sep 2016 00:21:23 +0900 Subject: Remove empty newlines in #include blocks. This makes clang-format useful on those. Also add a bunch of forgotten transitive includes, which otherwise prevented compilation. --- src/core/file_sys/archive_backend.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/core/file_sys/archive_backend.h') diff --git a/src/core/file_sys/archive_backend.h b/src/core/file_sys/archive_backend.h index 7f64fe4e2..d69c3c785 100644 --- a/src/core/file_sys/archive_backend.h +++ b/src/core/file_sys/archive_backend.h @@ -8,11 +8,9 @@ #include #include #include - #include "common/bit_field.h" #include "common/common_types.h" #include "common/swap.h" - #include "core/hle/result.h" namespace FileSys { -- cgit v1.2.3