diff --git a/atdna/main.cpp b/atdna/main.cpp index be92d09..85cedf9 100644 --- a/atdna/main.cpp +++ b/atdna/main.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include "clang/AST/ASTConsumer.h" #include "clang/AST/RecursiveASTVisitor.h" diff --git a/include/aes.hpp b/include/aes.hpp index 4b6c514..9eff64a 100644 --- a/include/aes.hpp +++ b/include/aes.hpp @@ -1,8 +1,8 @@ #ifndef __AES_HPP__ #define __AES_HPP__ -#include -#include +#include +#include #include namespace athena diff --git a/include/athena/Checksums.hpp b/include/athena/Checksums.hpp index 9a79207..bd7f7c9 100644 --- a/include/athena/Checksums.hpp +++ b/include/athena/Checksums.hpp @@ -3,13 +3,10 @@ #include "athena/Global.hpp" -namespace athena -{ -namespace Checksums +namespace athena::Checksums { atUint32 crc32(const atUint8* data, atUint64 length, atUint32 mask = 0xFFFFFFFF, atUint32 seed = 0xFFFFFFFF); atUint16 crc16CCITT(const atUint8* data, atUint64 length, atUint16 seed = 0xFFFF, atUint16 final = 0); atUint16 crc16(const atUint8* data, atUint64 length); } -} #endif // CHECKSUMS_HPP diff --git a/include/athena/Compression.hpp b/include/athena/Compression.hpp index ce5b29e..ac2a9a2 100644 --- a/include/athena/Compression.hpp +++ b/include/athena/Compression.hpp @@ -3,11 +3,7 @@ #include "athena/Global.hpp" -namespace athena -{ -namespace io -{ -namespace Compression +namespace athena::io::Compression { // Zlib compression atInt32 decompressZlib(const atUint8* src, atUint32 srcLen, atUint8* dst, atUint32 dstLen); @@ -23,6 +19,4 @@ atUint32 yaz0Encode(const atUint8* src, atUint32 srcSize, atUint8* data); atUint32 decompressLZ77(const atUint8* src, atUint32 srcLen, atUint8** dst); atUint32 compressLZ77(const atUint8* src, atUint32 srcLen, atUint8** dst, bool extended = false); } -} -} #endif // COMPRESSION_HPP diff --git a/include/athena/DNA.hpp b/include/athena/DNA.hpp index 3a137be..a79bf0d 100644 --- a/include/athena/DNA.hpp +++ b/include/athena/DNA.hpp @@ -13,9 +13,7 @@ #include #include -namespace athena -{ -namespace io +namespace athena::io { /* forward-declaration dance for recursively-derived types */ @@ -250,7 +248,6 @@ struct WStringAsString : public DNA, public std::string #define DNA_COUNT(cnt) 0 #endif -} } #endif // DNA_HPP diff --git a/include/athena/DNAYaml.hpp b/include/athena/DNAYaml.hpp index 33fecab..3c05bb5 100644 --- a/include/athena/DNAYaml.hpp +++ b/include/athena/DNAYaml.hpp @@ -7,15 +7,13 @@ * Any changes to the types or namespacing must be reflected in 'atdna/main.cpp' */ -#include +#include #include #include #include "DNA.hpp" #include "FileReader.hpp" -namespace athena -{ -namespace io +namespace athena::io { struct YAMLNode @@ -680,6 +678,5 @@ struct WStringAsStringYaml : public DNAYaml, public std::string const char* DNATypeV() const {return DNAType();} \ } -} #endif // DNAYAML_HPP diff --git a/include/athena/Dir.hpp b/include/athena/Dir.hpp index bc884cb..bbd4549 100644 --- a/include/athena/Dir.hpp +++ b/include/athena/Dir.hpp @@ -2,7 +2,7 @@ #define DIR_HPP #include "athena/FileInfo.hpp" -#include +#include #if _WIN32 typedef int mode_t; diff --git a/include/athena/FileReader.hpp b/include/athena/FileReader.hpp index 44281f9..4549c09 100644 --- a/include/athena/FileReader.hpp +++ b/include/athena/FileReader.hpp @@ -7,16 +7,14 @@ #endif #include #else -#include +#include #endif #include #include #include "athena/IStreamReader.hpp" -namespace athena -{ -namespace io +namespace athena::io { class FileReader : public IStreamReader { @@ -75,7 +73,6 @@ protected: atUint64 m_offset; bool m_globalErr; }; -} // io } // Athena #ifndef FILEREADER_BASE diff --git a/include/athena/FileWriter.hpp b/include/athena/FileWriter.hpp index f26ad4f..907f970 100644 --- a/include/athena/FileWriter.hpp +++ b/include/athena/FileWriter.hpp @@ -7,13 +7,11 @@ #endif #include #else -#include +#include #endif #include "athena/IStreamWriter.hpp" -namespace athena -{ -namespace io +namespace athena::io { class FileWriter : public IStreamWriter { @@ -116,7 +114,6 @@ public: ~TransactionalFileWriter() { flush(); } }; -} } // Athena #ifndef FILEWRITER_BASE diff --git a/include/athena/IStream.hpp b/include/athena/IStream.hpp index 5247866..b0195a3 100644 --- a/include/athena/IStream.hpp +++ b/include/athena/IStream.hpp @@ -3,9 +3,7 @@ #include "Global.hpp" -namespace athena -{ -namespace io +namespace athena::io { std::ostream& operator<<(std::ostream& os, Endian& endian); @@ -34,5 +32,4 @@ protected: #endif }; } -} #endif // STREAM_HPP diff --git a/include/athena/IStreamReader.hpp b/include/athena/IStreamReader.hpp index a99be2f..ab9d74f 100644 --- a/include/athena/IStreamReader.hpp +++ b/include/athena/IStreamReader.hpp @@ -6,9 +6,7 @@ #include "utf8proc.h" #include "IStream.hpp" -namespace athena -{ -namespace io +namespace athena::io { /** @brief The IStreamReader class defines a basic API for reading from streams, Implementors are provided with one pure virtual * function that must be implemented in order to interact with the stream. @@ -1304,6 +1302,5 @@ IStreamReader& operator>>(IStreamReader& lhs, T& rhs) return lhs; } } -} #endif // ISTREAMREADER diff --git a/include/athena/IStreamWriter.hpp b/include/athena/IStreamWriter.hpp index ad04eba..7c811a8 100644 --- a/include/athena/IStreamWriter.hpp +++ b/include/athena/IStreamWriter.hpp @@ -5,9 +5,7 @@ #include "IStream.hpp" #include -namespace athena -{ -namespace io +namespace athena::io { class IStreamWriter : public IStream { @@ -1176,6 +1174,5 @@ IStreamWriter& operator<<(IStreamWriter& lhs, const T& rhs) return lhs; } } -} #endif // STREAMWRITER_HPP diff --git a/include/athena/MemoryReader.hpp b/include/athena/MemoryReader.hpp index 2390cc9..be1b862 100644 --- a/include/athena/MemoryReader.hpp +++ b/include/athena/MemoryReader.hpp @@ -6,9 +6,7 @@ #include #include "athena/IStreamReader.hpp" -namespace athena -{ -namespace io +namespace athena::io { /*! \class MemoryReader * \brief A Stream class for reading data from a memory position @@ -118,7 +116,6 @@ protected: std::string m_filepath; //!< Path to the target file }; -} // io } // Athena diff --git a/include/athena/MemoryWriter.hpp b/include/athena/MemoryWriter.hpp index 158f1e1..9c43d92 100644 --- a/include/athena/MemoryWriter.hpp +++ b/include/athena/MemoryWriter.hpp @@ -6,9 +6,7 @@ #include #include "athena/IStreamWriter.hpp" -namespace athena -{ -namespace io +namespace athena::io { /*! @class MemoryWriter @@ -158,7 +156,6 @@ private: void resize(atUint64 newSize); }; -} } #endif // MEMORYWRITER_HPP diff --git a/include/athena/PHYSFSFileReader.hpp b/include/athena/PHYSFSFileReader.hpp index 4a139c2..9f7d07e 100644 --- a/include/athena/PHYSFSFileReader.hpp +++ b/include/athena/PHYSFSFileReader.hpp @@ -5,9 +5,7 @@ #include "athena/Stream.hpp" #include -namespace athena -{ -namespace io +namespace athena::io { class PHYSFSFileReader : public Stream { @@ -51,7 +49,6 @@ private: PHYSFS_File* m_handle; }; } -} #ifndef PHYSFSFILEREADER_BASE #define PHYSFSFILEREADER_BASE() \ diff --git a/include/athena/SakuraGlobal.hpp b/include/athena/SakuraGlobal.hpp index afe440a..20c58bb 100644 --- a/include/athena/SakuraGlobal.hpp +++ b/include/athena/SakuraGlobal.hpp @@ -3,9 +3,7 @@ #include "athena/Global.hpp" -namespace athena -{ -namespace Sakura +namespace athena::Sakura { template class Vector2D @@ -30,6 +28,5 @@ public: typedef Vector2D Vector2Di; typedef Vector2D Vector2Df; } // Sakura -} // Athena #endif // SAKURAGLOBAL_HPP diff --git a/include/athena/Socket.hpp b/include/athena/Socket.hpp index 0622260..4b76c88 100644 --- a/include/athena/Socket.hpp +++ b/include/athena/Socket.hpp @@ -8,7 +8,7 @@ #include #include #include -#include +#include #else #include #include @@ -21,9 +21,7 @@ #include "Global.hpp" -namespace athena -{ -namespace net +namespace athena::net { /* Define the low-level send/receive flags, which depend on the OS */ @@ -371,7 +369,6 @@ public: SocketTp GetInternalSocket() const { return m_socket; } }; -} } #endif // ATHENA_SOCKET_HPP diff --git a/include/athena/Sprite.hpp b/include/athena/Sprite.hpp index fa494fd..6420feb 100644 --- a/include/athena/Sprite.hpp +++ b/include/athena/Sprite.hpp @@ -5,9 +5,7 @@ #include #include "athena/SakuraGlobal.hpp" -namespace athena -{ -namespace Sakura +namespace athena::Sakura { class SpriteFile; class SpriteFrame; @@ -69,7 +67,6 @@ private: atUint32 m_currentFrame; }; -} // Sakura } // zelda #endif // SSPRITE_HPP diff --git a/include/athena/SpriteFile.hpp b/include/athena/SpriteFile.hpp index bf8ffe7..dd2e9eb 100644 --- a/include/athena/SpriteFile.hpp +++ b/include/athena/SpriteFile.hpp @@ -7,9 +7,7 @@ #include #include "athena/SakuraGlobal.hpp" -namespace athena -{ -namespace Sakura +namespace athena::Sakura { struct STexture { @@ -191,7 +189,6 @@ private: Vector2Df m_origin; std::unordered_map m_sprites; }; -} // Sakura } // Zelda #endif // SSPRITE_HPP diff --git a/include/athena/SpriteFileReader.hpp b/include/athena/SpriteFileReader.hpp index c98adab..627a5c6 100644 --- a/include/athena/SpriteFileReader.hpp +++ b/include/athena/SpriteFileReader.hpp @@ -3,9 +3,7 @@ #include "athena/MemoryReader.hpp" -namespace athena -{ -namespace Sakura +namespace athena::Sakura { class SpriteFile; } // Sakura @@ -21,7 +19,6 @@ public: Sakura::SpriteFile* readFile(); }; -} // io } // zelda diff --git a/include/athena/SpriteFrame.hpp b/include/athena/SpriteFrame.hpp index c22d605..b0feec9 100644 --- a/include/athena/SpriteFrame.hpp +++ b/include/athena/SpriteFrame.hpp @@ -5,9 +5,7 @@ #include "athena/SakuraGlobal.hpp" #include -namespace athena -{ -namespace Sakura +namespace athena::Sakura { class Sprite; @@ -48,7 +46,6 @@ private: std::vector m_parts; }; -} // Sakura } // zelda #endif // SSPRITEFRAME_HPP diff --git a/include/athena/SpritePart.hpp b/include/athena/SpritePart.hpp index 93aa34a..1b8d08a 100644 --- a/include/athena/SpritePart.hpp +++ b/include/athena/SpritePart.hpp @@ -6,9 +6,7 @@ #include -namespace athena -{ -namespace Sakura +namespace athena::Sakura { class SpriteFrame; @@ -114,6 +112,5 @@ private: atUint32 m_frameIndex; }; } -} #endif // SSPRITEPART_HPP diff --git a/include/athena/Types.hpp b/include/athena/Types.hpp index 72b15c8..b6456cf 100644 --- a/include/athena/Types.hpp +++ b/include/athena/Types.hpp @@ -1,7 +1,7 @@ #ifndef TYPES_HPP #define TYPES_HPP -#include -#include +#include +#include using atInt8 = int8_t; using atUint8 = uint8_t; diff --git a/include/athena/Utility.hpp b/include/athena/Utility.hpp index f58f837..5f71ca5 100644 --- a/include/athena/Utility.hpp +++ b/include/athena/Utility.hpp @@ -4,14 +4,12 @@ #include #include #include -#include -#include +#include +#include #include "athena/Global.hpp" #include "athena/Types.hpp" -namespace athena -{ -namespace utility +namespace athena::utility { inline bool isEmpty(atInt8* buf, atUint32 size) {return !memcmp(buf, buf + 1, size - 1);} inline bool isSystemBigEndian() {return (*(atUint16*)"\xFE\xFF" == 0xFEFF);} @@ -217,6 +215,5 @@ std::string wideToUtf8(std::wstring_view src); std::wstring utf8ToWide(std::string_view src); -} // utility } // Athena #endif diff --git a/include/utf8proc.h b/include/utf8proc.h index 29e1515..9ca5980 100644 --- a/include/utf8proc.h +++ b/include/utf8proc.h @@ -97,8 +97,13 @@ enum {false, true}; typedef bool utf8proc_bool; # endif #else +#ifdef __cplusplus +# include +# include +#else # include # include +#endif typedef int8_t utf8proc_int8_t; typedef uint8_t utf8proc_uint8_t; typedef int16_t utf8proc_int16_t; @@ -109,7 +114,11 @@ typedef size_t utf8proc_size_t; typedef ssize_t utf8proc_ssize_t; typedef bool utf8proc_bool; #endif -#include +#ifdef __cplusplus +# include +#else +# include +#endif /** @name Error codes * Error codes being returned by almost all functions. diff --git a/src/LZ77/LZType10.cpp b/src/LZ77/LZType10.cpp index 3f2c70d..b3c59f5 100644 --- a/src/LZ77/LZType10.cpp +++ b/src/LZ77/LZType10.cpp @@ -1,7 +1,7 @@ #include "LZ77/LZLookupTable.hpp" #include "LZ77/LZType10.hpp" #include -#include +#include LZType10::LZType10(atInt32 MinimumOffset, atInt32 SlidingWindow, atInt32 MinimumMatch, atInt32 BlockSize) : LZBase(MinimumOffset, SlidingWindow, MinimumMatch, BlockSize) diff --git a/src/LZ77/LZType11.cpp b/src/LZ77/LZType11.cpp index 6223d05..774a056 100644 --- a/src/LZ77/LZType11.cpp +++ b/src/LZ77/LZType11.cpp @@ -1,7 +1,7 @@ #include "LZ77/LZLookupTable.hpp" #include "LZ77/LZType11.hpp" #include -#include +#include LZType11::LZType11(atInt32 minimumOffset, atInt32 slidingWindow, atInt32 minimumMatch, atInt32 blockSize) diff --git a/src/aes.cpp b/src/aes.cpp index 119e7fe..2fcfcba 100644 --- a/src/aes.cpp +++ b/src/aes.cpp @@ -1,6 +1,6 @@ #include "aes.hpp" -#include -#include +#include +#include #if _WIN32 #include #elif !GEKKO diff --git a/src/athena/ALTTPFileReader.cpp b/src/athena/ALTTPFileReader.cpp index f8a1cc8..2091e5c 100644 --- a/src/athena/ALTTPFileReader.cpp +++ b/src/athena/ALTTPFileReader.cpp @@ -4,9 +4,7 @@ #include #include "athena/Global.hpp" -namespace athena -{ -namespace io +namespace athena::io { ALTTPFileReader::ALTTPFileReader(atUint8* data, atUint64 length) @@ -236,4 +234,3 @@ ALTTPDungeonItemFlags ALTTPFileReader::readDungeonFlags() } } // io -} // zelda diff --git a/src/athena/Checksums.cpp b/src/athena/Checksums.cpp index eea6c75..2fc1c9c 100644 --- a/src/athena/Checksums.cpp +++ b/src/athena/Checksums.cpp @@ -3,9 +3,7 @@ #include #include -namespace athena -{ -namespace Checksums +namespace athena::Checksums { atUint32 crc32(const atUint8* data, atUint64 length, atUint32 mask, atUint32 seed) @@ -150,4 +148,3 @@ atUint16 crc16(const atUint8* data, atUint64 length) } } // Checksums -} // zelda diff --git a/src/athena/Compression.cpp b/src/athena/Compression.cpp index 55b4e99..54380e2 100644 --- a/src/athena/Compression.cpp +++ b/src/athena/Compression.cpp @@ -5,11 +5,7 @@ #include "LZ77/LZType10.hpp" #include "LZ77/LZType11.hpp" -namespace athena -{ -namespace io -{ -namespace Compression +namespace athena::io::Compression { atInt32 decompressZlib(const atUint8* src, atUint32 srcLen, atUint8* dst, atUint32 dstLen) @@ -357,5 +353,3 @@ atUint32 compressLZ77(const atUint8* src, atUint32 srcLen, atUint8** dst, bool e } } // Compression -} // io -} // zelda diff --git a/src/athena/DNAYaml.cpp b/src/athena/DNAYaml.cpp index d1e4354..868727b 100644 --- a/src/athena/DNAYaml.cpp +++ b/src/athena/DNAYaml.cpp @@ -1,8 +1,6 @@ #include "athena/DNAYaml.hpp" -namespace athena -{ -namespace io +namespace athena::io { template <> @@ -1406,4 +1404,3 @@ std::unique_ptr base64_decode(std::string_view encoded_string) } } -} diff --git a/src/athena/Dir.cpp b/src/athena/Dir.cpp index e721859..7dba45a 100644 --- a/src/athena/Dir.cpp +++ b/src/athena/Dir.cpp @@ -1,15 +1,15 @@ #include "athena/Dir.hpp" #include -#include +#include #include #define __STDC_FORMAT_MACROS -#include +#include #ifndef _WIN32 #include #include #else -#include +#include #include #endif diff --git a/src/athena/FileInfo.cpp b/src/athena/FileInfo.cpp index 44fda4f..96eabcb 100644 --- a/src/athena/FileInfo.cpp +++ b/src/athena/FileInfo.cpp @@ -2,10 +2,10 @@ #include "athena/Utility.hpp" #include "athena/FileWriter.hpp" #include "athena/FileReader.hpp" -#include -#include +#include +#include #include -#include +#include #ifndef _WIN32 #include @@ -20,7 +20,7 @@ #ifdef _WIN32 #include -#include +#include #endif #ifdef _MSC_VER diff --git a/src/athena/FileReader.cpp b/src/athena/FileReader.cpp index 90f0968..ecff39e 100644 --- a/src/athena/FileReader.cpp +++ b/src/athena/FileReader.cpp @@ -7,9 +7,7 @@ #include "osx_largefilewrapper.h" #endif -namespace athena -{ -namespace io +namespace athena::io { FileReader::FileReader(std::string_view filename, atInt32 cacheSize, bool globalErr) : m_fileHandle(nullptr), @@ -206,5 +204,4 @@ void FileReader::setCacheSize(const atInt32 blockSize) m_cacheData.reset(new atUint8[m_blockSize]); } -} // io } // Athena diff --git a/src/athena/FileReaderWin32.cpp b/src/athena/FileReaderWin32.cpp index 7fe71c4..904eb78 100644 --- a/src/athena/FileReaderWin32.cpp +++ b/src/athena/FileReaderWin32.cpp @@ -1,9 +1,7 @@ #include "athena/FileReader.hpp" #include "win32_largefilewrapper.h" -namespace athena -{ -namespace io +namespace athena::io { FileReader::FileReader(std::string_view filename, atInt32 cacheSize, bool globalErr) : m_fileHandle(nullptr), @@ -232,5 +230,4 @@ void FileReader::setCacheSize(const atInt32 blockSize) m_cacheData.reset(new atUint8[m_blockSize]); } -} // io } // Athena diff --git a/src/athena/FileWriterGeneric.cpp b/src/athena/FileWriterGeneric.cpp index b771c6c..384e203 100644 --- a/src/athena/FileWriterGeneric.cpp +++ b/src/athena/FileWriterGeneric.cpp @@ -1,8 +1,6 @@ #include "athena/FileWriter.hpp" -namespace athena -{ -namespace io +namespace athena::io { void TransactionalFileWriter::seek(atInt64 pos, SeekOrigin origin) { @@ -32,4 +30,3 @@ void TransactionalFileWriter::writeUBytes(const atUint8* data, atUint64 len) m_position += len; } } -} diff --git a/src/athena/FileWriterNix.cpp b/src/athena/FileWriterNix.cpp index ed9e453..e3dd8c5 100644 --- a/src/athena/FileWriterNix.cpp +++ b/src/athena/FileWriterNix.cpp @@ -7,9 +7,7 @@ #include "osx_largefilewrapper.h" #endif -namespace athena -{ -namespace io +namespace athena::io { FileWriter::FileWriter(std::string_view filename, bool overwrite, bool globalErr) : m_fileHandle(NULL), @@ -134,5 +132,4 @@ void FileWriter::writeUBytes(const atUint8* data, atUint64 len) setError(); } } -} } // Athena diff --git a/src/athena/FileWriterWin32.cpp b/src/athena/FileWriterWin32.cpp index e280859..d5e0023 100644 --- a/src/athena/FileWriterWin32.cpp +++ b/src/athena/FileWriterWin32.cpp @@ -1,9 +1,7 @@ #include "athena/FileWriter.hpp" #include "win32_largefilewrapper.h" -namespace athena -{ -namespace io +namespace athena::io { FileWriter::FileWriter(std::string_view filename, bool overwrite, bool globalErr) : m_fileHandle(0), @@ -141,5 +139,4 @@ void FileWriter::writeUBytes(const atUint8* data, atUint64 len) } } -} } // Athena diff --git a/src/athena/Global.cpp b/src/athena/Global.cpp index 6626b86..e314f39 100644 --- a/src/athena/Global.cpp +++ b/src/athena/Global.cpp @@ -1,7 +1,7 @@ #include "athena/Global.hpp" -#include -#include -#include +#include +#include +#include std::ostream& operator<<(std::ostream& os, const athena::SeekOrigin& origin) { diff --git a/src/athena/MCFileWriter.cpp b/src/athena/MCFileWriter.cpp index d579daa..c282ca6 100644 --- a/src/athena/MCFileWriter.cpp +++ b/src/athena/MCFileWriter.cpp @@ -1,8 +1,6 @@ #include "athena/MCFileWriter.hpp" -namespace athena -{ -namespace io +namespace athena::io { MCFileWriter::MCFileWriter(atUint8* data, atUint64 length) @@ -48,5 +46,4 @@ atUint16 MCFileWriter::calculateChecksum(atUint8* data, atUint32 length) return sum; } -} // io } // zelda diff --git a/src/athena/MemoryReader.cpp b/src/athena/MemoryReader.cpp index 346cdbc..1633a3c 100644 --- a/src/athena/MemoryReader.cpp +++ b/src/athena/MemoryReader.cpp @@ -1,7 +1,7 @@ #include "athena/MemoryReader.hpp" -#include -#include +#include +#include #include #include #include @@ -14,9 +14,7 @@ #undef min #undef max -namespace athena -{ -namespace io +namespace athena::io { MemoryReader::MemoryReader(const void* data, atUint64 length, bool takeOwnership, bool globalErr) : m_data(data), @@ -213,4 +211,3 @@ void MemoryCopyReader::loadData() } } -} diff --git a/src/athena/MemoryWriter.cpp b/src/athena/MemoryWriter.cpp index eee0734..1fd106b 100644 --- a/src/athena/MemoryWriter.cpp +++ b/src/athena/MemoryWriter.cpp @@ -1,7 +1,7 @@ #include "athena/MemoryWriter.hpp" -#include -#include +#include +#include #include #include @@ -9,9 +9,7 @@ #include #endif // HW_RVL -namespace athena -{ -namespace io +namespace athena::io { MemoryWriter::MemoryWriter(atUint8* data, atUint64 length, bool takeOwnership) @@ -316,5 +314,4 @@ void MemoryCopyWriter::resize(atUint64 newSize) m_length = newSize; } -} // io } // Athena diff --git a/src/athena/PHYSFSFileReader.cpp b/src/athena/PHYSFSFileReader.cpp index b39ab63..edbb1b7 100644 --- a/src/athena/PHYSFSFileReader.cpp +++ b/src/athena/PHYSFSFileReader.cpp @@ -3,9 +3,7 @@ #include "athena/FileNotFoundException.hpp" #include "athena/IOException.hpp" -namespace athena -{ -namespace io +namespace athena::io { PHYSFSFileReader::PHYSFSFileReader(const std::string& path) @@ -199,7 +197,6 @@ bool PHYSFSFileReader::isLittleEndian() const return m_endian == Endian::LittleEndian; } -} } #endif diff --git a/src/athena/SkywardSwordFileReader.cpp b/src/athena/SkywardSwordFileReader.cpp index 1727ae3..a9a1d1c 100644 --- a/src/athena/SkywardSwordFileReader.cpp +++ b/src/athena/SkywardSwordFileReader.cpp @@ -3,9 +3,7 @@ #include "athena/SkywardSwordQuest.hpp" #include -namespace athena -{ -namespace io +namespace athena::io { SkywardSwordFileReader::SkywardSwordFileReader(atUint8* data, atUint64 length) @@ -65,5 +63,4 @@ SkywardSwordFile* SkywardSwordFileReader::read() return file; } -} // io } // zelda diff --git a/src/athena/SkywardSwordFileWriter.cpp b/src/athena/SkywardSwordFileWriter.cpp index aefdf09..d4dc58f 100644 --- a/src/athena/SkywardSwordFileWriter.cpp +++ b/src/athena/SkywardSwordFileWriter.cpp @@ -2,9 +2,7 @@ #include "athena/SkywardSwordFile.hpp" #include "athena/SkywardSwordQuest.hpp" -namespace athena -{ -namespace io +namespace athena::io { SkywardSwordFileWriter::SkywardSwordFileWriter(atUint8* data, atUint64 len) @@ -62,5 +60,4 @@ void SkywardSwordFileWriter::write(SkywardSwordFile* file) save(); } -} // io } // zelda diff --git a/src/athena/Sprite.cpp b/src/athena/Sprite.cpp index d48844f..370f38c 100644 --- a/src/athena/Sprite.cpp +++ b/src/athena/Sprite.cpp @@ -7,9 +7,7 @@ #include #endif -namespace athena -{ -namespace Sakura +namespace athena::Sakura { Sprite::Sprite(SpriteFile* root) : m_root(root), @@ -232,4 +230,3 @@ SpriteFile* Sprite::root() const return m_root; } } -} diff --git a/src/athena/SpriteFile.cpp b/src/athena/SpriteFile.cpp index 8df907c..31f54fb 100644 --- a/src/athena/SpriteFile.cpp +++ b/src/athena/SpriteFile.cpp @@ -3,9 +3,7 @@ #include "athena/Utility.hpp" #include -namespace athena -{ -namespace Sakura +namespace athena::Sakura { const atUint32 SpriteFile::Major = 1; const atUint32 SpriteFile::Minor = 0; @@ -216,5 +214,4 @@ void SpriteFile::setTextures(std::vector textures) m_textures = textures; } -} // Sakura } // zelda diff --git a/src/athena/SpriteFileReader.cpp b/src/athena/SpriteFileReader.cpp index d88f2c5..db1982c 100644 --- a/src/athena/SpriteFileReader.cpp +++ b/src/athena/SpriteFileReader.cpp @@ -5,9 +5,7 @@ #include "athena/SpriteFrame.hpp" #include "athena/Utility.hpp" -namespace athena -{ -namespace io +namespace athena::io { SpriteFileReader::SpriteFileReader(atUint8* data, atUint64 length) : MemoryCopyReader(data, length) @@ -204,5 +202,4 @@ Sakura::SpriteFile* SpriteFileReader::readFile() return ret; } -} // io } // zelda diff --git a/src/athena/SpriteFileWriter.cpp b/src/athena/SpriteFileWriter.cpp index fb28c32..d76dec7 100644 --- a/src/athena/SpriteFileWriter.cpp +++ b/src/athena/SpriteFileWriter.cpp @@ -4,9 +4,7 @@ #include "athena/SpritePart.hpp" #include "athena/SpriteFrame.hpp" -namespace athena -{ -namespace io +namespace athena::io { SpriteFileWriter::SpriteFileWriter(atUint8* data, atUint64 length) : MemoryCopyWriter(data, length) @@ -78,5 +76,4 @@ void SpriteFileWriter::writeFile(Sakura::SpriteFile* file) save(); } -} // io } // zelda diff --git a/src/athena/SpriteFrame.cpp b/src/athena/SpriteFrame.cpp index 1b2e4c3..4cbef44 100644 --- a/src/athena/SpriteFrame.cpp +++ b/src/athena/SpriteFrame.cpp @@ -2,9 +2,7 @@ #include "athena/SpritePart.hpp" #include "athena/Sprite.hpp" -namespace athena -{ -namespace Sakura +namespace athena::Sakura { SpriteFrame::SpriteFrame() @@ -52,5 +50,4 @@ Sprite* SpriteFrame::root() const return m_root; } -} // Sakura } // zelda diff --git a/src/athena/SpritePart.cpp b/src/athena/SpritePart.cpp index f9a2e04..a514918 100644 --- a/src/athena/SpritePart.cpp +++ b/src/athena/SpritePart.cpp @@ -3,9 +3,7 @@ #include "athena/Sprite.hpp" #include -namespace athena -{ -namespace Sakura +namespace athena::Sakura { SpritePart::SpritePart(SpriteFrame* root) @@ -115,4 +113,3 @@ SpriteFrame* SpritePart::root() const return m_root; } } -} diff --git a/src/athena/Utility.cpp b/src/athena/Utility.cpp index 3f75a8f..5d06897 100644 --- a/src/athena/Utility.cpp +++ b/src/athena/Utility.cpp @@ -1,10 +1,10 @@ #include "athena/Utility.hpp" #include -#include -#include +#include +#include #include #include -#include +#include #include #include #include @@ -17,9 +17,7 @@ #include #endif -namespace athena -{ -namespace utility +namespace athena::utility { void fillRandom(atUint8* rndArea, atUint64 count) @@ -255,5 +253,4 @@ std::wstring utf8ToWide(std::string_view src) return retval; } -} // utility } // Athena diff --git a/src/athena/WiiBanner.cpp b/src/athena/WiiBanner.cpp index 875edf3..3f531f2 100644 --- a/src/athena/WiiBanner.cpp +++ b/src/athena/WiiBanner.cpp @@ -2,7 +2,7 @@ #include "athena/WiiImage.hpp" #include "athena/Utility.hpp" -#include +#include namespace athena { diff --git a/src/athena/WiiImage.cpp b/src/athena/WiiImage.cpp index 4630f9c..c6d51f0 100644 --- a/src/athena/WiiImage.cpp +++ b/src/athena/WiiImage.cpp @@ -1,7 +1,7 @@ #include "athena/WiiImage.hpp" #include "athena/Utility.hpp" -#include -#include +#include +#include namespace athena { diff --git a/src/athena/WiiSave.cpp b/src/athena/WiiSave.cpp index 5584f48..7ab4d8a 100644 --- a/src/athena/WiiSave.cpp +++ b/src/athena/WiiSave.cpp @@ -5,9 +5,9 @@ #include "athena/MemoryWriter.hpp" #include "athena/Utility.hpp" -#include +#include #include -#include +#include #include #include #include diff --git a/src/athena/WiiSaveReader.cpp b/src/athena/WiiSaveReader.cpp index eea3300..f30f571 100644 --- a/src/athena/WiiSaveReader.cpp +++ b/src/athena/WiiSaveReader.cpp @@ -11,7 +11,7 @@ #include "sha1.h" #include #include -#include +#include namespace athena { diff --git a/src/athena/WiiSaveWriter.cpp b/src/athena/WiiSaveWriter.cpp index 00af417..bb85c05 100644 --- a/src/athena/WiiSaveWriter.cpp +++ b/src/athena/WiiSaveWriter.cpp @@ -14,9 +14,9 @@ #include "md5.h" #include "sha1.h" -#include +#include #include -#include +#include #include #include #include diff --git a/src/athena/ZQuestFile.cpp b/src/athena/ZQuestFile.cpp index 6c133c9..12f42e9 100644 --- a/src/athena/ZQuestFile.cpp +++ b/src/athena/ZQuestFile.cpp @@ -1,6 +1,6 @@ #include "athena/ZQuestFile.hpp" -#include +#include namespace athena { diff --git a/src/athena/ZQuestFileReader.cpp b/src/athena/ZQuestFileReader.cpp index 47fb1f9..277fb00 100644 --- a/src/athena/ZQuestFileReader.cpp +++ b/src/athena/ZQuestFileReader.cpp @@ -7,9 +7,7 @@ #include #include -namespace athena -{ -namespace io +namespace athena::io { ZQuestFileReader::ZQuestFileReader(atUint8* data, atUint64 length) @@ -107,5 +105,4 @@ ZQuestFile* ZQuestFileReader::read() return new ZQuestFile(game, BOM == 0xFEFF ? Endian::BigEndian : Endian::LittleEndian, std::move(data), uncompressedLen, gameString); } -} // io } // zelda diff --git a/src/athena/ZQuestFileWriter.cpp b/src/athena/ZQuestFileWriter.cpp index 212d3c1..c0eb7de 100644 --- a/src/athena/ZQuestFileWriter.cpp +++ b/src/athena/ZQuestFileWriter.cpp @@ -3,9 +3,7 @@ #include "athena/Compression.hpp" #include "athena/Checksums.hpp" -namespace athena -{ -namespace io +namespace athena::io { ZQuestFileWriter::ZQuestFileWriter(atUint8* data, atUint64 length) @@ -75,5 +73,4 @@ void ZQuestFileWriter::write(ZQuestFile* quest, bool compress) } } -} // io } // zelda diff --git a/src/bn.cpp b/src/bn.cpp index a4d0a62..37a9c89 100644 --- a/src/bn.cpp +++ b/src/bn.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include "bn.hpp" diff --git a/src/ec.cpp b/src/ec.cpp index 7241827..3ff4159 100644 --- a/src/ec.cpp +++ b/src/ec.cpp @@ -1,4 +1,4 @@ -#include +#include #include "athena/Utility.hpp" #include "bn.hpp" diff --git a/src/md5.cpp b/src/md5.cpp index 213c647..0277181 100644 --- a/src/md5.cpp +++ b/src/md5.cpp @@ -78,9 +78,9 @@ #include #include -#include +#include #include -#include +#include #ifndef __APPLE__ #include #endif diff --git a/src/sha1.cpp b/src/sha1.cpp index 5ad04b1..050d779 100644 --- a/src/sha1.cpp +++ b/src/sha1.cpp @@ -39,7 +39,7 @@ */ #include "sha1.h" -#include +#include #include "athena/Utility.hpp" /*