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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 0 additions and 51 deletions

View file

@ -527,7 +527,6 @@ HEADERS += \
src/util/IncognitoBrowser.hpp \ src/util/IncognitoBrowser.hpp \
src/util/InitUpdateButton.hpp \ src/util/InitUpdateButton.hpp \
src/util/IrcHelpers.hpp \ src/util/IrcHelpers.hpp \
src/util/IsBigEndian.hpp \
src/util/LayoutCreator.hpp \ src/util/LayoutCreator.hpp \
src/util/LayoutHelper.hpp \ src/util/LayoutHelper.hpp \
src/util/NuulsUploader.hpp \ src/util/NuulsUploader.hpp \
@ -536,7 +535,6 @@ HEADERS += \
src/util/PostToThread.hpp \ src/util/PostToThread.hpp \
src/util/QObjectRef.hpp \ src/util/QObjectRef.hpp \
src/util/QStringHash.hpp \ src/util/QStringHash.hpp \
src/util/rangealgorithm.hpp \
src/util/RapidjsonHelpers.hpp \ src/util/RapidjsonHelpers.hpp \
src/util/RapidJsonSerializeQString.hpp \ src/util/RapidJsonSerializeQString.hpp \
src/util/RatelimitBucket.hpp \ src/util/RatelimitBucket.hpp \

View file

@ -32,7 +32,6 @@
#include "singletons/Updates.hpp" #include "singletons/Updates.hpp"
#include "singletons/WindowManager.hpp" #include "singletons/WindowManager.hpp"
#include "util/Helpers.hpp" #include "util/Helpers.hpp"
#include "util/IsBigEndian.hpp"
#include "util/PostToThread.hpp" #include "util/PostToThread.hpp"
#include "util/RapidjsonHelpers.hpp" #include "util/RapidjsonHelpers.hpp"
#include "widgets/Notebook.hpp" #include "widgets/Notebook.hpp"

View file

@ -58,19 +58,6 @@ namespace {
auto size = *reinterpret_cast<uint32_t *>(size_c); 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::unique_ptr<char[]> buffer(new char[size + 1]);
std::cin.read(buffer.get(), size); std::cin.read(buffer.get(), size);
*(buffer.get() + size) = '\0'; *(buffer.get() + size) = '\0';

View file

@ -1,13 +0,0 @@
#pragma once
namespace chatterino {
bool isBigEndian()
{
int test = 1;
char *p = reinterpret_cast<char *>(&test);
return p[0] == 0;
}
} // namespace chatterino

View file

@ -1,22 +0,0 @@
#pragma once
#include <algorithm>
namespace chatterino {
namespace util {
template <typename Container, typename UnaryPredicate>
typename Container::iterator find_if(Container &container,
UnaryPredicate pred)
{
return std::find_if(container.begin(), container.end(), pred);
}
template <typename Container, typename UnaryPredicate>
bool any_of(Container &container, UnaryPredicate pred)
{
return std::any_of(container.begin(), container.end(), pred);
}
} // namespace util
} // namespace chatterino