diff --git a/src/ox/clargs/clargs.cpp b/src/ox/clargs/clargs.cpp index 999f47de6..c028e308c 100644 --- a/src/ox/clargs/clargs.cpp +++ b/src/ox/clargs/clargs.cpp @@ -10,7 +10,6 @@ #include "clargs.hpp" namespace ox { -namespace clargs { using namespace ::std; @@ -52,4 +51,3 @@ int ClArgs::getInt(const char *arg) { } } -} diff --git a/src/ox/clargs/clargs.hpp b/src/ox/clargs/clargs.hpp index 42acd120e..4b7b740f8 100644 --- a/src/ox/clargs/clargs.hpp +++ b/src/ox/clargs/clargs.hpp @@ -12,7 +12,6 @@ #include namespace ox { -namespace clargs { class ClArgs { private: @@ -31,4 +30,3 @@ class ClArgs { }; } -} diff --git a/src/ox/fs/filestore.hpp b/src/ox/fs/filestore.hpp index aaa380d49..20b261a5b 100644 --- a/src/ox/fs/filestore.hpp +++ b/src/ox/fs/filestore.hpp @@ -11,7 +11,6 @@ #include namespace ox { -namespace fs { template struct __attribute__((packed)) FileStoreHeader { @@ -46,52 +45,52 @@ struct __attribute__((packed)) FileStoreHeader { template void FileStoreHeader::setVersion(uint16_t version) { - m_version = std::bigEndianAdapt(version); + m_version = bigEndianAdapt(version); } template uint16_t FileStoreHeader::getVersion() { - return std::bigEndianAdapt(m_version); + return bigEndianAdapt(m_version); } template void FileStoreHeader::setFsType(uint16_t fsType) { - m_fsType = std::bigEndianAdapt(fsType); + m_fsType = bigEndianAdapt(fsType); } template uint16_t FileStoreHeader::getFsType() { - return std::bigEndianAdapt(m_fsType); + return bigEndianAdapt(m_fsType); } template void FileStoreHeader::setSize(FsSize_t size) { - m_size = std::bigEndianAdapt(size); + m_size = bigEndianAdapt(size); } template FsSize_t FileStoreHeader::getSize() { - return std::bigEndianAdapt(m_size); + return bigEndianAdapt(m_size); } template void FileStoreHeader::setMemUsed(FsSize_t memUsed) { - m_memUsed = std::bigEndianAdapt(memUsed); + m_memUsed = bigEndianAdapt(memUsed); } template FsSize_t FileStoreHeader::getMemUsed() { - return std::bigEndianAdapt(m_memUsed); + return bigEndianAdapt(m_memUsed); } template void FileStoreHeader::setRootInode(FsSize_t rootInode) { - m_rootInode = std::bigEndianAdapt(rootInode); + m_rootInode = bigEndianAdapt(rootInode); } template FsSize_t FileStoreHeader::getRootInode() { - return std::bigEndianAdapt(m_rootInode); + return bigEndianAdapt(m_rootInode); } template @@ -368,72 +367,72 @@ typename Header::FsSize_t FileStore
::Inode::size() { template void FileStore
::Inode::setDataLen(typename Header::FsSize_t dataLen) { - this->m_dataLen = std::bigEndianAdapt(dataLen); + this->m_dataLen = bigEndianAdapt(dataLen); } template typename Header::FsSize_t FileStore
::Inode::getDataLen() { - return std::bigEndianAdapt(m_dataLen); + return bigEndianAdapt(m_dataLen); } template void FileStore
::Inode::setPrev(typename Header::FsSize_t prev) { - this->m_prev = std::bigEndianAdapt(prev); + this->m_prev = bigEndianAdapt(prev); } template typename Header::FsSize_t FileStore
::Inode::getPrev() { - return std::bigEndianAdapt(m_prev); + return bigEndianAdapt(m_prev); } template void FileStore
::Inode::setNext(typename Header::FsSize_t next) { - this->m_next = std::bigEndianAdapt(next); + this->m_next = bigEndianAdapt(next); } template typename Header::FsSize_t FileStore
::Inode::getNext() { - return std::bigEndianAdapt(m_next); + return bigEndianAdapt(m_next); } template void FileStore
::Inode::setId(InodeId_t id) { - this->m_id = std::bigEndianAdapt(id); + this->m_id = bigEndianAdapt(id); } template typename Header::InodeId_t FileStore
::Inode::getId() { - return std::bigEndianAdapt(m_id); + return bigEndianAdapt(m_id); } template void FileStore
::Inode::setFileType(uint8_t fileType) { - this->m_fileType = std::bigEndianAdapt(fileType); + this->m_fileType = bigEndianAdapt(fileType); } template uint8_t FileStore
::Inode::getFileType() { - return std::bigEndianAdapt(m_fileType); + return bigEndianAdapt(m_fileType); } template void FileStore
::Inode::setLeft(typename Header::FsSize_t left) { - this->m_left = std::bigEndianAdapt(left); + this->m_left = bigEndianAdapt(left); } template typename Header::FsSize_t FileStore
::Inode::getLeft() { - return std::bigEndianAdapt(m_left); + return bigEndianAdapt(m_left); } template void FileStore
::Inode::setRight(typename Header::FsSize_t right) { - this->m_right = std::bigEndianAdapt(right); + this->m_right = bigEndianAdapt(right); } template typename Header::FsSize_t FileStore
::Inode::getRight() { - return std::bigEndianAdapt(m_right); + return bigEndianAdapt(m_right); } template @@ -852,4 +851,3 @@ typedef FileStore> FileStore32; typedef FileStore> FileStore64; } -} diff --git a/src/ox/fs/filesystem.cpp b/src/ox/fs/filesystem.cpp index 2fef1603a..1f649c92c 100644 --- a/src/ox/fs/filesystem.cpp +++ b/src/ox/fs/filesystem.cpp @@ -9,7 +9,6 @@ #include "filesystem.hpp" namespace ox { -namespace fs { FileSystem *createFileSystem(void *buff, size_t buffSize) { auto version = ((FileStore16*) buff)->version(); @@ -19,13 +18,13 @@ FileSystem *createFileSystem(void *buff, size_t buffSize) { switch (version) { case 5: switch (type) { - case ox::fs::OxFS_16: + case ox::OxFS_16: fs = new FileSystem16(buff); break; - case ox::fs::OxFS_32: + case ox::OxFS_32: fs = new FileSystem32(buff); break; - case ox::fs::OxFS_64: + case ox::OxFS_64: fs = new FileSystem64(buff); break; } @@ -72,4 +71,3 @@ FileSystem *expandCopyCleanup(FileSystem *fs, size_t size) { } } -} diff --git a/src/ox/fs/filesystem.hpp b/src/ox/fs/filesystem.hpp index fd3e4619a..31b47096b 100644 --- a/src/ox/fs/filesystem.hpp +++ b/src/ox/fs/filesystem.hpp @@ -12,7 +12,6 @@ #include "filestore.hpp" namespace ox { -namespace fs { enum FsType { OxFS_16 = 1, @@ -693,4 +692,3 @@ typedef FileSystemTemplate FileSystem32; typedef FileSystemTemplate FileSystem64; } -} diff --git a/src/ox/fs/oxfstool.cpp b/src/ox/fs/oxfstool.cpp index b96fad28b..fd40e82a2 100644 --- a/src/ox/fs/oxfstool.cpp +++ b/src/ox/fs/oxfstool.cpp @@ -17,7 +17,7 @@ #pragma warning(disable:4996) #endif -using namespace ox::fs; +using namespace ox; using namespace std; const static auto oxfstoolVersion = "1.3.0"; diff --git a/src/ox/fs/pathiterator.cpp b/src/ox/fs/pathiterator.cpp index f82cd8bee..4c14a0a3e 100644 --- a/src/ox/fs/pathiterator.cpp +++ b/src/ox/fs/pathiterator.cpp @@ -11,7 +11,6 @@ #include "pathiterator.hpp" namespace ox { -namespace fs { PathIterator::PathIterator(const char *path, size_t maxSize) { m_path = path; @@ -97,4 +96,3 @@ bool PathIterator::hasNext() { } } -} diff --git a/src/ox/fs/pathiterator.hpp b/src/ox/fs/pathiterator.hpp index 789e8ac8d..4d55f7f0e 100644 --- a/src/ox/fs/pathiterator.hpp +++ b/src/ox/fs/pathiterator.hpp @@ -11,7 +11,6 @@ #include namespace ox { -namespace fs { class PathIterator { private: @@ -41,4 +40,3 @@ class PathIterator { }; } -} diff --git a/src/ox/fs/test/filestore_format.cpp b/src/ox/fs/test/filestore_format.cpp index 81fb9974b..68e761ef2 100644 --- a/src/ox/fs/test/filestore_format.cpp +++ b/src/ox/fs/test/filestore_format.cpp @@ -7,7 +7,7 @@ */ #include -using namespace ox::fs; +using namespace ox; int main() { const auto size = 65535; diff --git a/src/ox/fs/test/filestoreio.cpp b/src/ox/fs/test/filestoreio.cpp index 2a73c33e5..26c1b6417 100644 --- a/src/ox/fs/test/filestoreio.cpp +++ b/src/ox/fs/test/filestoreio.cpp @@ -9,8 +9,7 @@ #include #include -using namespace ox::fs; -using namespace ox::std; +using namespace ox; template int test() { diff --git a/src/ox/fs/test/filesystem_format.cpp b/src/ox/fs/test/filesystem_format.cpp index 7e82514c6..ff4f020a6 100644 --- a/src/ox/fs/test/filesystem_format.cpp +++ b/src/ox/fs/test/filesystem_format.cpp @@ -8,8 +8,7 @@ #include -using namespace ox::fs; -using namespace ox::std; +using namespace ox; template int test() { diff --git a/src/ox/fs/test/tests.cpp b/src/ox/fs/test/tests.cpp index 45810d2c2..8646730c0 100644 --- a/src/ox/fs/test/tests.cpp +++ b/src/ox/fs/test/tests.cpp @@ -16,7 +16,7 @@ #include using namespace std; -using namespace ox::fs; +using namespace ox; map tests = { { diff --git a/src/ox/mc/read.hpp b/src/ox/mc/read.hpp index e718ae423..11b392878 100644 --- a/src/ox/mc/read.hpp +++ b/src/ox/mc/read.hpp @@ -74,7 +74,7 @@ int MetalClawReader::op(const char*, ox::bstring *val) { typedef uint32_t StringLength; size_t size = 0; if (m_buffIt + sizeof(StringLength) < m_buffLen) { - size = ox::std::bigEndianAdapt(*((StringLength*) &m_buff[m_buffIt])); + size = ox::bigEndianAdapt(*((StringLength*) &m_buff[m_buffIt])); m_buffIt += sizeof(StringLength); } else { err |= MC_BUFFENDED; @@ -103,7 +103,7 @@ int MetalClawReader::readInteger(I *val) { int err = 0; if (m_fieldPresence.get(m_field)) { if (m_buffIt + sizeof(I) < m_buffLen) { - *val = ox::std::bigEndianAdapt(*((I*) &m_buff[m_buffIt])); + *val = ox::bigEndianAdapt(*((I*) &m_buff[m_buffIt])); m_buffIt += sizeof(I); } else { err = MC_BUFFENDED; @@ -123,7 +123,7 @@ int MetalClawReader::op(const char*, T *val, size_t valLen) { typedef uint32_t ArrayLength; size_t len = 0; if (m_buffIt + sizeof(ArrayLength) < m_buffLen) { - len = ox::std::bigEndianAdapt(*((T*) &m_buff[m_buffIt])); + len = ox::bigEndianAdapt(*((T*) &m_buff[m_buffIt])); m_buffIt += sizeof(ArrayLength); } else { err = MC_BUFFENDED; diff --git a/src/ox/mc/write.hpp b/src/ox/mc/write.hpp index a68a994e7..8380b3c71 100644 --- a/src/ox/mc/write.hpp +++ b/src/ox/mc/write.hpp @@ -62,7 +62,7 @@ int MetalClawWriter::op(const char*, ox::bstring *val) { // write the length typedef uint32_t StringLength; if (m_buffIt + sizeof(StringLength) + val->size() < m_buffLen) { - *((StringLength*) &m_buff[m_buffIt]) = ox::std::bigEndianAdapt((StringLength) val->size()); + *((StringLength*) &m_buff[m_buffIt]) = ox::bigEndianAdapt((StringLength) val->size()); m_buffIt += sizeof(StringLength); // write the string @@ -99,7 +99,7 @@ int MetalClawWriter::appendInteger(I val) { bool fieldSet = false; if (val) { if (m_buffIt + sizeof(I) < m_buffLen) { - *((I*) &m_buff[m_buffIt]) = ox::std::bigEndianAdapt(val); + *((I*) &m_buff[m_buffIt]) = ox::bigEndianAdapt(val); fieldSet = true; m_buffIt += sizeof(I); } else { @@ -120,7 +120,7 @@ int MetalClawWriter::op(const char*, T *val, size_t len) { // write the length typedef uint32_t ArrayLength; if (m_buffIt + sizeof(ArrayLength) < m_buffLen) { - *((T*) &m_buff[m_buffIt]) = ox::std::bigEndianAdapt((ArrayLength) len); + *((T*) &m_buff[m_buffIt]) = ox::bigEndianAdapt((ArrayLength) len); m_buffIt += sizeof(ArrayLength); } else { err = MC_BUFFENDED; diff --git a/src/ox/std/byteswap.hpp b/src/ox/std/byteswap.hpp index 22e405667..9bb199eeb 100644 --- a/src/ox/std/byteswap.hpp +++ b/src/ox/std/byteswap.hpp @@ -11,8 +11,6 @@ #include "types.hpp" namespace ox { -namespace std { - inline int16_t byteSwap(int16_t i) { return (i << 8) | (i >> 8); @@ -140,6 +138,4 @@ inline uint64_t bigEndianAdapt(uint64_t i) { #endif } - -} } diff --git a/src/ox/std/test/byteswap_test.cpp b/src/ox/std/test/byteswap_test.cpp index 6bad03536..ff05de995 100644 --- a/src/ox/std/test/byteswap_test.cpp +++ b/src/ox/std/test/byteswap_test.cpp @@ -10,7 +10,7 @@ #include using namespace std; -using namespace ox::std; +using namespace ox; template int testBigEndianAdapt(string str) {