aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/scicore
diff options
context:
space:
mode:
Diffstat (limited to 'engines/sci/scicore')
-rw-r--r--engines/sci/scicore/aatree.cpp4
-rw-r--r--engines/sci/scicore/exe.cpp2
-rw-r--r--engines/sci/scicore/exe_lzexe.cpp4
-rw-r--r--engines/sci/scicore/exe_raw.cpp2
-rw-r--r--engines/sci/scicore/resource.cpp10
-rw-r--r--engines/sci/scicore/resource_map.cpp2
-rw-r--r--engines/sci/scicore/sci_memory.cpp14
-rw-r--r--engines/sci/scicore/tools.cpp2
8 files changed, 14 insertions, 26 deletions
diff --git a/engines/sci/scicore/aatree.cpp b/engines/sci/scicore/aatree.cpp
index 624dcf9d8e..bb47e8cb33 100644
--- a/engines/sci/scicore/aatree.cpp
+++ b/engines/sci/scicore/aatree.cpp
@@ -84,7 +84,7 @@ delete_node(void *x, aatree_t **t, aatree_t *deleted, int (*compar)(const void *
deleted->key = (*t)->key;
temp = *t;
*t = (*t)->right;
- sci_free(temp);
+ free(temp);
retval = 0;
} else if (((*t)->left->level < (*t)->level - 1) || ((*t)->right->level < (*t)->level - 1)) {
(*t)->level--;
@@ -165,5 +165,5 @@ aatree_free(aatree_t *t) {
aatree_free(t->left);
aatree_free(t->right);
- sci_free(t);
+ free(t);
}
diff --git a/engines/sci/scicore/exe.cpp b/engines/sci/scicore/exe.cpp
index e266fd9665..d30734bfde 100644
--- a/engines/sci/scicore/exe.cpp
+++ b/engines/sci/scicore/exe.cpp
@@ -78,5 +78,5 @@ void
exe_close(exe_file_t *file) {
file->decompressor->close(file->handle);
- sci_free(file);
+ free(file);
}
diff --git a/engines/sci/scicore/exe_lzexe.cpp b/engines/sci/scicore/exe_lzexe.cpp
index fafc6d6c4d..7866dd66f7 100644
--- a/engines/sci/scicore/exe_lzexe.cpp
+++ b/engines/sci/scicore/exe_lzexe.cpp
@@ -263,7 +263,7 @@ lzexe_open(const char *filename) {
handle = (exe_handle_t*)sci_malloc(sizeof(exe_handle_t));
if (!lzexe_init(handle, f)) {
- sci_free(handle);
+ free(handle);
return NULL;
}
@@ -318,7 +318,7 @@ static void
lzexe_close(exe_handle_t *handle) {
fclose(handle->f);
- sci_free(handle);
+ free(handle);
}
exe_decompressor_t
diff --git a/engines/sci/scicore/exe_raw.cpp b/engines/sci/scicore/exe_raw.cpp
index 016c280ddd..1c1334abdb 100644
--- a/engines/sci/scicore/exe_raw.cpp
+++ b/engines/sci/scicore/exe_raw.cpp
@@ -56,7 +56,7 @@ static void
raw_close(exe_handle_t *handle) {
fclose(handle->f);
- sci_free(handle);
+ free(handle);
}
exe_decompressor_t
diff --git a/engines/sci/scicore/resource.cpp b/engines/sci/scicore/resource.cpp
index 039bf79890..d3dc88ce2a 100644
--- a/engines/sci/scicore/resource.cpp
+++ b/engines/sci/scicore/resource.cpp
@@ -608,7 +608,7 @@ scir_new_resource_manager(char *dir, int version,
}
sciprintf("Resmgr: Could not retrieve a resource list!\n");
_scir_free_resource_sources(mgr->sources);
- sci_free(mgr);
+ free(mgr);
chdir(caller_cwd);
free(caller_cwd);
return NULL;
@@ -721,10 +721,10 @@ _scir_free_resources(resource_t *resources, int resources_nr) {
_scir_free_altsources(res->alt_sources);
if (res->status != SCI_STATUS_NOMALLOC)
- sci_free(res->data);
+ free(res->data);
}
- sci_free(resources);
+ free(resources);
}
void
@@ -733,13 +733,13 @@ scir_free_resource_manager(resource_mgr_t *mgr) {
_scir_free_resource_sources(mgr->sources);
mgr->resources = NULL;
- sci_free(mgr);
+ free(mgr);
}
static void
_scir_unalloc(resource_t *res) {
- sci_free(res->data);
+ free(res->data);
res->data = NULL;
res->status = SCI_STATUS_NOMALLOC;
}
diff --git a/engines/sci/scicore/resource_map.cpp b/engines/sci/scicore/resource_map.cpp
index 984efa83ac..992cedbd2c 100644
--- a/engines/sci/scicore/resource_map.cpp
+++ b/engines/sci/scicore/resource_map.cpp
@@ -236,7 +236,7 @@ sci0_read_resource_map(resource_mgr_t *mgr, resource_source_t *map, resource_t *
int i;
if (sci_res_read_entry(mgr, map, buf, resources + resource_index, *sci_version)) {
- sci_free(resources);
+ free(resources);
close(fd);
return SCI_ERROR_RESMAP_NOT_FOUND;
}
diff --git a/engines/sci/scicore/sci_memory.cpp b/engines/sci/scicore/sci_memory.cpp
index 332ae0a740..0d8d5f6876 100644
--- a/engines/sci/scicore/sci_memory.cpp
+++ b/engines/sci/scicore/sci_memory.cpp
@@ -76,18 +76,6 @@ sci_realloc(void *ptr, size_t size) {
}
-void
-sci_free(void *ptr) {
- if (!ptr) {
- fprintf(stderr, "_SCI_FREE() [%s (%s) : %u]\n",
- __FILE__, "", __LINE__);
- fprintf(stderr, " attempt to free NULL pointer\n");
- BREAKPOINT();
- }
- free(ptr);
-}
-
-
void *
sci_memdup(const void *ptr, size_t size) {
void *res;
@@ -201,7 +189,7 @@ extern void
#ifdef TRACE_REFCOUNT
fprintf(stderr, "[] REF: Freeing (%p)...\n", fdata - 3);
#endif
- sci_free(fdata - 3);
+ free(fdata - 3);
#ifdef TRACE_REFCOUNT
fprintf(stderr, "[] REF: Done.\n");
#endif
diff --git a/engines/sci/scicore/tools.cpp b/engines/sci/scicore/tools.cpp
index a353017fc9..4b60c9244d 100644
--- a/engines/sci/scicore/tools.cpp
+++ b/engines/sci/scicore/tools.cpp
@@ -674,7 +674,7 @@ sci_getcwd(void) {
if (getcwd(cwd, size - 1))
return cwd;
- sci_free(cwd);
+ free(cwd);
}
fprintf(stderr, "Could not determine current working directory!\n");