diff --git a/src/openrct2/core/Algorithm.hpp b/src/openrct2/core/Algorithm.hpp index e88382c8ae..e8ad32d512 100644 --- a/src/openrct2/core/Algorithm.hpp +++ b/src/openrct2/core/Algorithm.hpp @@ -13,7 +13,7 @@ #include template> -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); return first != last && !comp(value, *first) ? first : last; diff --git a/src/openrct2/core/Http.cURL.cpp b/src/openrct2/core/Http.cURL.cpp index 91ba18eca3..ec57f1c7df 100644 --- a/src/openrct2/core/Http.cURL.cpp +++ b/src/openrct2/core/Http.cURL.cpp @@ -29,7 +29,7 @@ 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; Response* res = static_cast(userdata); @@ -38,7 +38,7 @@ namespace Http 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; Response* res = static_cast(userdata); @@ -62,7 +62,7 @@ namespace Http 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(userp); size_t buffer_size = size * nmemb; @@ -98,7 +98,7 @@ namespace Http wt.readptr = req.body.c_str(); 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_POSTFIELDSIZE, static_cast(wt.sizeleft)); } @@ -114,9 +114,9 @@ namespace Http curl_easy_setopt(curl, CURLOPT_URL, req.url.c_str()); 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(&res)); - curl_easy_setopt(curl, CURLOPT_HEADERFUNCTION, header_callback); + curl_easy_setopt(curl, CURLOPT_HEADERFUNCTION, HeaderCallback); curl_easy_setopt(curl, CURLOPT_HEADERDATA, static_cast(&res)); curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, true); curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, true); diff --git a/src/openrct2/entity/EntityRegistry.cpp b/src/openrct2/entity/EntityRegistry.cpp index 09a6c04c4c..608f79f7c8 100644 --- a/src/openrct2/entity/EntityRegistry.cpp +++ b/src/openrct2/entity/EntityRegistry.cpp @@ -292,7 +292,7 @@ static void AddToFreeList(EntityId index) static void RemoveFromEntityList(EntityBase* entity) { 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)) { list.erase(ptr); @@ -365,7 +365,7 @@ EntityBase* CreateEntity(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)) { return nullptr; @@ -422,7 +422,7 @@ static void EntitySpatialRemove(EntityBase* entity) { size_t currentIndex = GetSpatialIndexOffset({ entity->x, entity->y }); 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)) { spatialVector.erase(index, index + 1); diff --git a/src/openrct2/entity/PatrolArea.cpp b/src/openrct2/entity/PatrolArea.cpp index 6fe234b1b7..edcd0bc295 100644 --- a/src/openrct2/entity/PatrolArea.cpp +++ b/src/openrct2/entity/PatrolArea.cpp @@ -57,7 +57,7 @@ bool PatrolArea::Get(const TileCoordsXY& pos) const if (area == nullptr) 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(); return found; }