summaryrefslogtreecommitdiff
path: root/src/ai
diff options
context:
space:
mode:
Diffstat (limited to 'src/ai')
-rw-r--r--src/ai/ai_config.cpp8
-rw-r--r--src/ai/ai_info.cpp8
-rw-r--r--src/ai/ai_scanner.cpp6
-rw-r--r--src/ai/api/ai_controller.cpp4
4 files changed, 13 insertions, 13 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();
}
diff --git a/src/ai/ai_info.cpp b/src/ai/ai_info.cpp
index a1d635ac0..630f04b82 100644
--- a/src/ai/ai_info.cpp
+++ b/src/ai/ai_info.cpp
@@ -39,7 +39,7 @@ AIConfigItem _start_date_config = {
AILibrary::~AILibrary()
{
- free((void *)this->category);
+ free(this->category);
}
/* static */ SQInteger AIFileInfo::Constructor(HSQUIRRELVM vm, AIFileInfo *info)
@@ -146,8 +146,8 @@ AIInfo::~AIInfo()
{
/* Free all allocated strings */
for (AIConfigItemList::iterator it = this->config_list.begin(); it != this->config_list.end(); it++) {
- free((void*)(*it).name);
- free((void*)(*it).description);
+ free((*it).name);
+ free((*it).description);
if (it->labels != NULL) {
for (LabelMapping::iterator it2 = (*it).labels->Begin(); it2 != (*it).labels->End(); it2++) {
free(it2->second);
@@ -156,7 +156,7 @@ AIInfo::~AIInfo()
}
}
this->config_list.clear();
- free((void*)this->api_version);
+ free(this->api_version);
}
bool AIInfo::CanLoadFromVersion(int version) const
diff --git a/src/ai/ai_scanner.cpp b/src/ai/ai_scanner.cpp
index 9e752c010..a3995c01a 100644
--- a/src/ai/ai_scanner.cpp
+++ b/src/ai/ai_scanner.cpp
@@ -68,16 +68,16 @@ void AIScanner::Reset()
{
AIInfoList::iterator it = this->info_list.begin();
for (; it != this->info_list.end(); it++) {
- free((void *)(*it).first);
+ free((*it).first);
delete (*it).second;
}
it = this->info_single_list.begin();
for (; it != this->info_single_list.end(); it++) {
- free((void *)(*it).first);
+ free((*it).first);
}
AILibraryList::iterator lit = this->library_list.begin();
for (; lit != this->library_list.end(); lit++) {
- free((void *)(*lit).first);
+ free((*lit).first);
delete (*lit).second;
}
diff --git a/src/ai/api/ai_controller.cpp b/src/ai/api/ai_controller.cpp
index c6130303d..0c478cf4a 100644
--- a/src/ai/api/ai_controller.cpp
+++ b/src/ai/api/ai_controller.cpp
@@ -54,8 +54,8 @@ AIController::AIController() :
AIController::~AIController()
{
for (LoadedLibraryList::iterator iter = this->loaded_library.begin(); iter != this->loaded_library.end(); iter++) {
- free((void *)(*iter).second);
- free((void *)(*iter).first);
+ free((*iter).second);
+ free((*iter).first);
}
this->loaded_library.clear();