Codefix: Avoid type-casting function pointer with incorrect type. (#12929)
Make `AutolengthProc` take `int` instead of `void *`, avoiding pointer parameters.
This commit is contained in:
@@ -41,9 +41,9 @@ static const SaveLoad _ai_running_desc[] = {
|
||||
SLEG_CONDVAR("running_version", _ai_saveload_version, SLE_UINT32, SLV_AI_LOCAL_CONFIG, SL_MAX_VERSION),
|
||||
};
|
||||
|
||||
static void SaveReal_AIPL(int *index_ptr)
|
||||
static void SaveReal_AIPL(int arg)
|
||||
{
|
||||
CompanyID index = (CompanyID)*index_ptr;
|
||||
CompanyID index = static_cast<CompanyID>(arg);
|
||||
AIConfig *config = AIConfig::GetConfig(index, AIConfig::SSS_FORCE_GAME);
|
||||
|
||||
if (config->HasScript()) {
|
||||
@@ -162,7 +162,7 @@ struct AIPLChunkHandler : ChunkHandler {
|
||||
|
||||
for (int i = COMPANY_FIRST; i < MAX_COMPANIES; i++) {
|
||||
SlSetArrayIndex(i);
|
||||
SlAutolength((AutolengthProc *)SaveReal_AIPL, &i);
|
||||
SlAutolength(SaveReal_AIPL, i);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user