1
0
Fork 0

Codefix: always add space between * and const for consistency

pull/14213/head
Rubidium 2025-05-04 21:38:38 +02:00
parent d7563096c6
commit f063eee7db
4 changed files with 7 additions and 7 deletions

View File

@ -114,7 +114,7 @@ static auto _callback_table = MakeCallbackTable(std::make_index_sequence<_callba
template <typename T> struct CallbackArgsHelper;
template <typename... Targs>
struct CallbackArgsHelper<void(*const)(Commands, const CommandCost &, Targs...)> {
struct CallbackArgsHelper<void(* const)(Commands, const CommandCost &, Targs...)> {
using Args = std::tuple<std::decay_t<Targs>...>;
};

View File

@ -46,13 +46,13 @@ bool SetFallbackFont(FontCacheSettings *settings, const std::string &language_is
lang_codes[0] = CFStringCreateWithCString(kCFAllocatorDefault, lang.c_str(), kCFStringEncodingUTF8);
lang_codes[1] = CFSTR("en");
CFArrayRef lang_arr = CFArrayCreate(kCFAllocatorDefault, (const void **)lang_codes, lengthof(lang_codes), &kCFTypeArrayCallBacks);
CFAutoRelease<CFDictionaryRef> lang_attribs(CFDictionaryCreate(kCFAllocatorDefault, const_cast<const void **>(reinterpret_cast<const void *const *>(&kCTFontLanguagesAttribute)), (const void **)&lang_arr, 1, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));
CFAutoRelease<CFDictionaryRef> lang_attribs(CFDictionaryCreate(kCFAllocatorDefault, const_cast<const void **>(reinterpret_cast<const void * const *>(&kCTFontLanguagesAttribute)), (const void **)&lang_arr, 1, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));
CFAutoRelease<CTFontDescriptorRef> lang_desc(CTFontDescriptorCreateWithAttributes(lang_attribs.get()));
CFRelease(lang_arr);
CFRelease(lang_codes[0]);
/* Get array of all font descriptors for the wanted language. */
CFAutoRelease<CFSetRef> mandatory_attribs(CFSetCreate(kCFAllocatorDefault, const_cast<const void **>(reinterpret_cast<const void *const *>(&kCTFontLanguagesAttribute)), 1, &kCFTypeSetCallBacks));
CFAutoRelease<CFSetRef> mandatory_attribs(CFSetCreate(kCFAllocatorDefault, const_cast<const void **>(reinterpret_cast<const void * const *>(&kCTFontLanguagesAttribute)), 1, &kCFTypeSetCallBacks));
CFAutoRelease<CFArrayRef> descs(CTFontDescriptorCreateMatchingFontDescriptors(lang_desc.get(), mandatory_attribs.get()));
bool result = false;

View File

@ -438,10 +438,10 @@ CommandCost CmdRemoveStoryPageElement(DoCommandFlags flags, StoryPageElementID p
CommandCost CmdStoryPageButton(DoCommandFlags flags, TileIndex tile, StoryPageElementID page_element_id, VehicleID reference)
{
if (!StoryPageElement::IsValidID(page_element_id)) return CMD_ERROR;
const StoryPageElement *const pe = StoryPageElement::Get(page_element_id);
const StoryPageElement * const pe = StoryPageElement::Get(page_element_id);
/* Check the player belongs to the company that owns the page. */
const StoryPage *const sp = StoryPage::Get(pe->page);
const StoryPage * const sp = StoryPage::Get(pe->page);
if (sp->company != CompanyID::Invalid() && sp->company != _current_company) return CMD_ERROR;
switch (pe->type) {

View File

@ -890,7 +890,7 @@ public:
void OnPlaceObject([[maybe_unused]] Point pt, TileIndex tile) override
{
const StoryPageElement *const pe = StoryPageElement::GetIfValid(this->active_button_id);
const StoryPageElement * const pe = StoryPageElement::GetIfValid(this->active_button_id);
if (pe == nullptr || pe->type != SPET_BUTTON_TILE) {
ResetObjectToPlace();
this->active_button_id = StoryPageElementID::Invalid();
@ -904,7 +904,7 @@ public:
bool OnVehicleSelect(const Vehicle *v) override
{
const StoryPageElement *const pe = StoryPageElement::GetIfValid(this->active_button_id);
const StoryPageElement * const pe = StoryPageElement::GetIfValid(this->active_button_id);
if (pe == nullptr || pe->type != SPET_BUTTON_VEHICLE) {
ResetObjectToPlace();
this->active_button_id = StoryPageElementID::Invalid();