Update to v106r81 release.

byuu says:

First 32 instructions implemented in the TLCS900H disassembler. Only 992
to go!

I removed the use of anonymous namespaces in nall. It was something I
rarely used, because it rarely did what I wanted.

I updated all nested namespaces to use C++17-style namespace Foo::Bar {}
syntax instead of classic C++-style namespace Foo { namespace Bar {}}.

I updated ruby::Video::acquire() to return a struct, so we can use C++17
structured bindings. Long term, I want to get away from all functions
that take references for output only. Even though C++ botched structured
bindings by not allowing you to bind to existing variables, it's even
worse to have function calls that take arguments by reference and then
write to them. From the caller side, you can't tell the value is being
written, nor that the value passed in doesn't matter, which is terrible.
This commit is contained in:
Tim Allen
2019-01-16 11:46:42 +11:00
parent 25145f59cc
commit 559a6585ef
94 changed files with 371 additions and 224 deletions

View File

@@ -2,7 +2,7 @@
#include <nall/arithmetic.hpp>
namespace nall { namespace Decode {
namespace nall::Decode {
template<uint Bits, typename T> inline auto Base(const string& value) -> T {
static const string format =
@@ -34,4 +34,4 @@ template<uint Bits, typename T> inline auto Base(const string& value) -> T {
return result;
}
}}
}

View File

@@ -1,6 +1,6 @@
#pragma once
namespace nall { namespace Decode {
namespace nall::Decode {
inline auto Base64(const string& text) -> vector<uint8_t> {
static bool initialized = false;
@@ -44,4 +44,4 @@ inline auto Base64(const string& text) -> vector<uint8_t> {
return result;
}
}}
}

View File

@@ -1,6 +1,6 @@
#pragma once
namespace nall { namespace Decode {
namespace nall::Decode {
struct BMP {
BMP() = default;
@@ -73,4 +73,4 @@ private:
}
};
}}
}

View File

@@ -4,7 +4,7 @@
#include <nall/suffix-array.hpp>
namespace nall { namespace Decode {
namespace nall::Decode {
inline auto BWT(array_view<uint8_t> input) -> vector<uint8_t> {
vector<uint8_t> output;
@@ -44,4 +44,4 @@ inline auto BWT(array_view<uint8_t> input) -> vector<uint8_t> {
return output;
}
}}
}

View File

@@ -3,7 +3,7 @@
#include <nall/file.hpp>
#include <nall/decode/inflate.hpp>
namespace nall { namespace Decode {
namespace nall::Decode {
struct GZIP {
inline ~GZIP();
@@ -75,4 +75,4 @@ auto GZIP::decompress(const uint8_t* data, uint size) -> bool {
return inflate(this->data, this->size, data + p, size - p - 8);
}
}}
}

View File

@@ -1,6 +1,6 @@
#pragma once
namespace nall { namespace Decode {
namespace nall::Decode {
inline auto HTML(const string& input) -> string {
string output;
@@ -37,4 +37,4 @@ inline auto HTML(const string& input) -> string {
return output;
}
}}
}

View File

@@ -1,6 +1,6 @@
#pragma once
namespace nall { namespace Decode {
namespace nall::Decode {
inline auto Huffman(array_view<uint8_t> input) -> vector<uint8_t> {
vector<uint8_t> output;
@@ -33,4 +33,4 @@ inline auto Huffman(array_view<uint8_t> input) -> vector<uint8_t> {
return output;
}
}}
}

View File

@@ -1,8 +1,11 @@
#pragma once
//a bad implementation of inflate from zlib/minizip
//todo: replace with Talarubi's version
#include <setjmp.h>
namespace nall { namespace Decode {
namespace nall::Decode {
namespace puff {
inline auto puff(
@@ -343,4 +346,4 @@ inline auto puff(
}
}}
}

View File

@@ -2,7 +2,7 @@
#include <nall/decode/huffman.hpp>
namespace nall { namespace Decode {
namespace nall::Decode {
inline auto LZSA(array_view<uint8_t> input) -> vector<uint8_t> {
vector<uint8_t> output;
@@ -69,4 +69,4 @@ inline auto LZSA(array_view<uint8_t> input) -> vector<uint8_t> {
return output;
}
}}
}

View File

@@ -2,7 +2,7 @@
//move to front
namespace nall { namespace Decode {
namespace nall::Decode {
inline auto MTF(array_view<uint8_t> input) -> vector<uint8_t> {
vector<uint8_t> output;
@@ -22,4 +22,4 @@ inline auto MTF(array_view<uint8_t> input) -> vector<uint8_t> {
return output;
}
}}
}

View File

@@ -3,7 +3,7 @@
#include <nall/string.hpp>
#include <nall/decode/inflate.hpp>
namespace nall { namespace Decode {
namespace nall::Decode {
struct PNG {
inline PNG();
@@ -329,4 +329,4 @@ auto PNG::readbits(const uint8_t*& data) -> uint {
return result;
}
}}
}

View File

@@ -1,6 +1,6 @@
#pragma once
namespace nall { namespace Decode {
namespace nall::Decode {
template<uint S = 1, uint M = 4 / S> //S = word size; M = match length
inline auto RLE(array_view<uint8_t> input) -> vector<uint8_t> {
@@ -41,4 +41,4 @@ inline auto RLE(array_view<uint8_t> input) -> vector<uint8_t> {
return output;
}
}}
}

View File

@@ -1,6 +1,6 @@
#pragma once
namespace nall { namespace Decode {
namespace nall::Decode {
//returns empty string on malformed content
inline auto URL(string_view input) -> string {
@@ -36,4 +36,4 @@ inline auto URL(string_view input) -> string {
return output;
}
}}
}

View File

@@ -5,7 +5,7 @@
#include <nall/vector.hpp>
#include <nall/decode/inflate.hpp>
namespace nall { namespace Decode {
namespace nall::Decode {
struct ZIP {
struct File {
@@ -133,4 +133,4 @@ public:
vector<File> file;
};
}}
}