Removed unused files IsBigEndian.hpp and rangealgorithm.hpp (#3776)

util/IsBigEndian.hpp and util/rangealgorithm.hpp have been unused for a long time, removing them from the codebase because git keeps the history forever anyway!
This commit is contained in:
Kasia
2022-05-29 12:19:26 +02:00
committed by GitHub
parent 74ec310228
commit 8b98f0e142
5 changed files with 0 additions and 51 deletions
-13
View File
@@ -58,19 +58,6 @@ namespace {
auto size = *reinterpret_cast<uint32_t *>(size_c);
#if 0
bool bigEndian = isBigEndian();
// To avoid breaking strict-aliasing rules and potentially inducing undefined behaviour, the following code can be run instead
uint32_t size = 0;
if (bigEndian) {
size = size_c[3] | static_cast<uint32_t>(size_c[2]) << 8 |
static_cast<uint32_t>(size_c[1]) << 16 | static_cast<uint32_t>(size_c[0]) << 24;
} else {
size = size_c[0] | static_cast<uint32_t>(size_c[1]) << 8 |
static_cast<uint32_t>(size_c[2]) << 16 | static_cast<uint32_t>(size_c[3]) << 24;
}
#endif
std::unique_ptr<char[]> buffer(new char[size + 1]);
std::cin.read(buffer.get(), size);
*(buffer.get() + size) = '\0';