Remove snake_case in core folder

This commit is contained in:
Gymnasiast 2023-01-16 20:24:52 +01:00
parent 11e28b5262
commit 28edbf9116
No known key found for this signature in database
GPG Key ID: DBFFF47AB2CA3EDD
4 changed files with 11 additions and 11 deletions

View File

@ -13,7 +13,7 @@
#include <functional> #include <functional>
template<class ForwardIt, class T, class Compare = std::less<>> template<class ForwardIt, class T, class Compare = std::less<>>
ForwardIt binary_find(ForwardIt first, ForwardIt last, const T& value, Compare comp = {}) ForwardIt BinaryFind(ForwardIt first, ForwardIt last, const T& value, Compare comp = {})
{ {
first = std::lower_bound(first, last, value, comp); first = std::lower_bound(first, last, value, comp);
return first != last && !comp(value, *first) ? first : last; return first != last && !comp(value, *first) ? first : last;

View File

@ -29,7 +29,7 @@
namespace Http namespace Http
{ {
static size_t writeData(const char* src, size_t size, size_t nmemb, void* userdata) static size_t WriteData(const char* src, size_t size, size_t nmemb, void* userdata)
{ {
size_t realsize = size * nmemb; size_t realsize = size * nmemb;
Response* res = static_cast<Response*>(userdata); Response* res = static_cast<Response*>(userdata);
@ -38,7 +38,7 @@ namespace Http
return realsize; return realsize;
} }
static size_t header_callback(const char* src, size_t size, size_t nitems, void* userdata) static size_t HeaderCallback(const char* src, size_t size, size_t nitems, void* userdata)
{ {
size_t realsize = nitems * size; size_t realsize = nitems * size;
Response* res = static_cast<Response*>(userdata); Response* res = static_cast<Response*>(userdata);
@ -62,7 +62,7 @@ namespace Http
size_t sizeleft; size_t sizeleft;
}; };
static size_t read_callback(void* dst, size_t size, size_t nmemb, void* userp) static size_t ReadCallback(void* dst, size_t size, size_t nmemb, void* userp)
{ {
WriteThis* wt = static_cast<WriteThis*>(userp); WriteThis* wt = static_cast<WriteThis*>(userp);
size_t buffer_size = size * nmemb; size_t buffer_size = size * nmemb;
@ -98,7 +98,7 @@ namespace Http
wt.readptr = req.body.c_str(); wt.readptr = req.body.c_str();
wt.sizeleft = req.body.size(); wt.sizeleft = req.body.size();
curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_callback); curl_easy_setopt(curl, CURLOPT_READFUNCTION, ReadCallback);
curl_easy_setopt(curl, CURLOPT_READDATA, &wt); curl_easy_setopt(curl, CURLOPT_READDATA, &wt);
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, static_cast<long>(wt.sizeleft)); curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, static_cast<long>(wt.sizeleft));
} }
@ -114,9 +114,9 @@ namespace Http
curl_easy_setopt(curl, CURLOPT_URL, req.url.c_str()); curl_easy_setopt(curl, CURLOPT_URL, req.url.c_str());
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, true); curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, true);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, writeData); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteData);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, static_cast<void*>(&res)); curl_easy_setopt(curl, CURLOPT_WRITEDATA, static_cast<void*>(&res));
curl_easy_setopt(curl, CURLOPT_HEADERFUNCTION, header_callback); curl_easy_setopt(curl, CURLOPT_HEADERFUNCTION, HeaderCallback);
curl_easy_setopt(curl, CURLOPT_HEADERDATA, static_cast<void*>(&res)); curl_easy_setopt(curl, CURLOPT_HEADERDATA, static_cast<void*>(&res));
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, true); curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, true);
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, true); curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, true);

View File

@ -292,7 +292,7 @@ static void AddToFreeList(EntityId index)
static void RemoveFromEntityList(EntityBase* entity) static void RemoveFromEntityList(EntityBase* entity)
{ {
auto& list = gEntityLists[EnumValue(entity->Type)]; auto& list = gEntityLists[EnumValue(entity->Type)];
auto ptr = binary_find(std::begin(list), std::end(list), entity->sprite_index); auto ptr = BinaryFind(std::begin(list), std::end(list), entity->sprite_index);
if (ptr != std::end(list)) if (ptr != std::end(list))
{ {
list.erase(ptr); list.erase(ptr);
@ -365,7 +365,7 @@ EntityBase* CreateEntity(EntityType type)
EntityBase* CreateEntityAt(const EntityId index, const EntityType type) EntityBase* CreateEntityAt(const EntityId index, const EntityType type)
{ {
auto id = binary_find(std::rbegin(_freeIdList), std::rend(_freeIdList), index); auto id = BinaryFind(std::rbegin(_freeIdList), std::rend(_freeIdList), index);
if (id == std::rend(_freeIdList)) if (id == std::rend(_freeIdList))
{ {
return nullptr; return nullptr;
@ -422,7 +422,7 @@ static void EntitySpatialRemove(EntityBase* entity)
{ {
size_t currentIndex = GetSpatialIndexOffset({ entity->x, entity->y }); size_t currentIndex = GetSpatialIndexOffset({ entity->x, entity->y });
auto& spatialVector = gEntitySpatialIndex[currentIndex]; auto& spatialVector = gEntitySpatialIndex[currentIndex];
auto index = binary_find(std::begin(spatialVector), std::end(spatialVector), entity->sprite_index); auto index = BinaryFind(std::begin(spatialVector), std::end(spatialVector), entity->sprite_index);
if (index != std::end(spatialVector)) if (index != std::end(spatialVector))
{ {
spatialVector.erase(index, index + 1); spatialVector.erase(index, index + 1);

View File

@ -57,7 +57,7 @@ bool PatrolArea::Get(const TileCoordsXY& pos) const
if (area == nullptr) if (area == nullptr)
return false; return false;
auto it = binary_find(area->SortedTiles.begin(), area->SortedTiles.end(), pos, CompareTileCoordsXY); auto it = BinaryFind(area->SortedTiles.begin(), area->SortedTiles.end(), pos, CompareTileCoordsXY);
auto found = it != area->SortedTiles.end(); auto found = it != area->SortedTiles.end();
return found; return found;
} }