1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 07:17:35 +00:00

Test: Mark compilation-unit-only functions as static

This enables a nice warning in case a function becomes dead code. Also,
in the case of test-crypto.cpp, I took the liberty to add the prefix 'g_'
to the global event loop.
This commit is contained in:
Ben Wiederhake 2020-08-11 00:02:25 +02:00 committed by Andreas Kling
parent 2b76f48a17
commit 76da9a4a7d
9 changed files with 191 additions and 192 deletions

View file

@ -37,7 +37,7 @@ struct SortableObject {
int m_payload;
};
int compare_sortable_object(const void* a, const void* b)
static int compare_sortable_object(const void* a, const void* b)
{
const int key1 = static_cast<const SortableObject*>(a)->m_key;
const int key2 = static_cast<const SortableObject*>(b)->m_key;
@ -50,13 +50,13 @@ int compare_sortable_object(const void* a, const void* b)
}
}
int calc_payload_for_pos(size_t pos)
static int calc_payload_for_pos(size_t pos)
{
pos *= 231;
return pos ^ (pos << 8) ^ (pos << 16) ^ (pos << 24);
}
void shuffle_vec(Vector<SortableObject>& test_objects)
static void shuffle_vec(Vector<SortableObject>& test_objects)
{
for (size_t i = 0; i < test_objects.size() * 3; ++i) {
auto i1 = rand() % test_objects.size();