diff options
author | rubidium <rubidium@openttd.org> | 2011-11-12 13:00:29 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2011-11-12 13:00:29 +0000 |
commit | 7fd1e1df81c3ed45e176f1bbf46d873b6cff316e (patch) | |
tree | 8f2ad83400a7897a066ff4f500bd0cdd150c1b93 /src/ai/ai_config.cpp | |
parent | d61b90ac6fb63ee42f47ca53cacd5aa7d7b30bae (diff) | |
download | openttd-7fd1e1df81c3ed45e176f1bbf46d873b6cff316e.tar.xz |
(svn r23198) -Codechange: introduce a free that takes const pointers so we don't need to cast to void/non-const before being able to free
Diffstat (limited to 'src/ai/ai_config.cpp')
-rw-r--r-- | src/ai/ai_config.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ai/ai_config.cpp b/src/ai/ai_config.cpp index a00cf4867..a5d656911 100644 --- a/src/ai/ai_config.cpp +++ b/src/ai/ai_config.cpp @@ -17,7 +17,7 @@ void AIConfig::ChangeAI(const char *name, int version, bool force_exact_match, bool is_random_ai) { - free((void *)this->name); + free(this->name); this->name = (name == NULL) ? NULL : strdup(name); this->info = (name == NULL) ? NULL : AI::FindInfo(this->name, version, force_exact_match); this->version = (info == NULL) ? -1 : info->GetVersion(); @@ -31,7 +31,7 @@ void AIConfig::ChangeAI(const char *name, int version, bool force_exact_match, b int start_date = this->GetSetting("start_date"); for (SettingValueList::iterator it = this->settings.begin(); it != this->settings.end(); it++) { - free((void*)(*it).first); + free((*it).first); } this->settings.clear(); @@ -65,7 +65,7 @@ AIConfig::AIConfig(const AIConfig *config) AIConfig::~AIConfig() { - free((void *)this->name); + free(this->name); this->ResetSettings(); if (this->config_list != NULL) delete this->config_list; } @@ -148,7 +148,7 @@ void AIConfig::SetSetting(const char *name, int value) void AIConfig::ResetSettings() { for (SettingValueList::iterator it = this->settings.begin(); it != this->settings.end(); it++) { - free((void*)(*it).first); + free((*it).first); } this->settings.clear(); } |