[Scummvm-cvs-logs] SF.net SVN: scummvm:[38406] scummvm/trunk/engines/sci

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Tue Feb 17 14:51:53 CET 2009


Revision: 38406
          http://scummvm.svn.sourceforge.net/scummvm/?rev=38406&view=rev
Author:   thebluegr
Date:     2009-02-17 13:51:52 +0000 (Tue, 17 Feb 2009)

Log Message:
-----------
Replaced sci_free() with free() - it's OK to free a NULL pointer, so the checking that sci_free() performed is not necessary

Modified Paths:
--------------
    scummvm/trunk/engines/sci/engine/game.cpp
    scummvm/trunk/engines/sci/engine/gc.cpp
    scummvm/trunk/engines/sci/engine/kernel.cpp
    scummvm/trunk/engines/sci/engine/kfile.cpp
    scummvm/trunk/engines/sci/engine/kmenu.cpp
    scummvm/trunk/engines/sci/engine/kpathing.cpp
    scummvm/trunk/engines/sci/engine/scriptdebug.cpp
    scummvm/trunk/engines/sci/engine/seg_manager.cpp
    scummvm/trunk/engines/sci/engine/sys_strings.cpp
    scummvm/trunk/engines/sci/engine/vm.cpp
    scummvm/trunk/engines/sci/gfx/operations.cpp
    scummvm/trunk/engines/sci/include/sci_memory.h
    scummvm/trunk/engines/sci/sci.cpp
    scummvm/trunk/engines/sci/scicore/aatree.cpp
    scummvm/trunk/engines/sci/scicore/exe.cpp
    scummvm/trunk/engines/sci/scicore/exe_lzexe.cpp
    scummvm/trunk/engines/sci/scicore/exe_raw.cpp
    scummvm/trunk/engines/sci/scicore/resource.cpp
    scummvm/trunk/engines/sci/scicore/resource_map.cpp
    scummvm/trunk/engines/sci/scicore/sci_memory.cpp
    scummvm/trunk/engines/sci/scicore/tools.cpp
    scummvm/trunk/engines/sci/sfx/iterator.cpp
    scummvm/trunk/engines/sci/sfx/mixer/soft.cpp
    scummvm/trunk/engines/sci/sfx/pcm-iterator.cpp
    scummvm/trunk/engines/sci/sfx/softseq/amiga.cpp

Modified: scummvm/trunk/engines/sci/engine/game.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/game.cpp	2009-02-17 12:20:40 UTC (rev 38405)
+++ scummvm/trunk/engines/sci/engine/game.cpp	2009-02-17 13:51:52 UTC (rev 38406)
@@ -278,7 +278,7 @@
 	s->port = NULL;
 
 	if (s->pics)
-		sci_free(s->pics);
+		free(s->pics);
 	s->pics = NULL;
 }
 
@@ -415,7 +415,7 @@
 					seeker += getInt16(script->data + seeker + 2);
 					if (seeker <= lastseeker) {
 						sciprintf("Warning: Script version is invalid.\n");
-						sci_free(s->classtable);
+						free(s->classtable);
 						return  SCI_ERROR_INVALID_SCRIPT_VERSION;
 					}
 				}
@@ -572,7 +572,7 @@
 	sciprintf("Freeing VM memory\n");
 	s->save_dir_copy_buf = NULL;
 
-	sci_free(s->classtable);
+	free(s->classtable);
 	s->classtable = NULL;
 
 	/* Close all opened file handles */
@@ -580,7 +580,7 @@
 		if (s->file_handles[i])
 			fclose(s->file_handles[i]);
 
-	sci_free(s->file_handles);
+	free(s->file_handles);
 	s->file_handles = NULL;
 
 	/* FIXME: file handles will NOT be closed under DOS. DJGPP generates an
@@ -611,7 +611,7 @@
 	bp = s->bp_list;
 	while (bp) {
 		bp_next = bp->next;
-		if (bp->type == BREAK_SELECTOR) sci_free(bp->data.name);
+		if (bp->type == BREAK_SELECTOR) free(bp->data.name);
 		free(bp);
 		bp = bp_next;
 	}
@@ -708,7 +708,7 @@
 int
 game_exit(state_t *s) {
 	if (s->execution_stack) {
-		sci_free(s->execution_stack);
+		free(s->execution_stack);
 	}
 
 	sfx_exit(&s->sound);
@@ -718,7 +718,7 @@
 	sm_destroy(&s->seg_manager);
 
 	if (s->synonyms_nr) {
-		sci_free(s->synonyms);
+		free(s->synonyms);
 		s->synonyms = NULL;
 		s->synonyms_nr = 0;
 	}
@@ -729,7 +729,7 @@
 #warning "Free parser segment here"
 #endif
 	if (send_calls_allocated) {
-		sci_free(send_calls);
+		free(send_calls);
 		send_calls_allocated = 0;
 	}
 
@@ -741,7 +741,7 @@
 
 	_free_graphics_input(s);
 
-	sci_free(s->game_name);
+	free(s->game_name);
 
 	return 0;
 }

Modified: scummvm/trunk/engines/sci/engine/gc.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/gc.cpp	2009-02-17 12:20:40 UTC (rev 38405)
+++ scummvm/trunk/engines/sci/engine/gc.cpp	2009-02-17 13:51:52 UTC (rev 38406)
@@ -86,7 +86,7 @@
 
 	if (!wl->used) {
 		*wlp = wl->next;
-		sci_free(wl);
+		free(wl);
 	}
 
 	return retval;
@@ -97,7 +97,7 @@
 	if (wl) {
 		if (wl->next)
 			free_worklist(wl->next);
-		sci_free(wl);
+		free(wl);
 	}
 }
 
@@ -235,7 +235,7 @@
 	for (i = 1; i < sm->heap_size; i++)
 		if (interfaces[i])
 			interfaces[i]->deallocate_self(interfaces[i]);
-	sci_free(interfaces);
+	free(interfaces);
 	delete nonnormal_map;
 	return normal_map;
 }

Modified: scummvm/trunk/engines/sci/engine/kernel.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kernel.cpp	2009-02-17 12:20:40 UTC (rev 38405)
+++ scummvm/trunk/engines/sci/engine/kernel.cpp	2009-02-17 13:51:52 UTC (rev 38406)
@@ -902,7 +902,7 @@
 
 void
 free_kfunct_tables(state_t *s) {
-	sci_free(s->kfunct_table);
+	free(s->kfunct_table);
 	s->kfunct_table = NULL;
 
 }

Modified: scummvm/trunk/engines/sci/engine/kfile.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kfile.cpp	2009-02-17 12:20:40 UTC (rev 38405)
+++ scummvm/trunk/engines/sci/engine/kfile.cpp	2009-02-17 13:51:52 UTC (rev 38406)
@@ -298,7 +298,7 @@
 		sciprintf(__FILE__": Can't chdir to savegame dir '%s' or "
 		          "create it\n", save_dir);
 
-		sci_free(cwd);
+		free(cwd);
 		return NULL;
 	}
 
@@ -590,7 +590,7 @@
 
 	remove(testpath);
 
-	sci_free(testpath);
+	free(testpath);
 
 	return make_reg(0, !failed);
 }

Modified: scummvm/trunk/engines/sci/engine/kmenu.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kmenu.cpp	2009-02-17 12:20:40 UTC (rev 38405)
+++ scummvm/trunk/engines/sci/engine/kmenu.cpp	2009-02-17 13:51:52 UTC (rev 38406)
@@ -79,7 +79,7 @@
 	s->status_bar_background = bgcolor;
 
 	if (NULL != s->status_bar_text) {
-		sci_free(s->status_bar_text);
+		free(s->status_bar_text);
 		s->status_bar_text = NULL;
 	}
 

Modified: scummvm/trunk/engines/sci/engine/kpathing.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kpathing.cpp	2009-02-17 12:20:40 UTC (rev 38405)
+++ scummvm/trunk/engines/sci/engine/kpathing.cpp	2009-02-17 13:51:52 UTC (rev 38406)
@@ -872,7 +872,7 @@
 		}
 	}
 
-	sci_free(vert_sorted);
+	free(vert_sorted);
 
 	/* Free tree */
 	aatree_free(tree);
@@ -1252,10 +1252,10 @@
 	while (!CLIST_EMPTY(&polygon->vertices)) {
 		vertex_t *vertex = CLIST_FIRST(&polygon->vertices);
 		CLIST_REMOVE(&polygon->vertices, vertex, entries);
-		sci_free(vertex);
+		free(vertex);
 	}
 
-	sci_free(polygon);
+	free(polygon);
 }
 
 static void
@@ -1266,10 +1266,10 @@
 */
 {
 	if (p->vertex_index)
-		sci_free(p->vertex_index);
+		free(p->vertex_index);
 
 	if (p->vis_matrix)
-		sci_free(p->vis_matrix);
+		free(p->vis_matrix);
 
 	while (!LIST_EMPTY(&p->polygons)) {
 		polygon_t *polygon = LIST_FIRST(&p->polygons);
@@ -1277,7 +1277,7 @@
 		free_polygon(polygon);
 	}
 
-	sci_free(p);
+	free(p);
 }
 
 static void

Modified: scummvm/trunk/engines/sci/engine/scriptdebug.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/scriptdebug.cpp	2009-02-17 12:20:40 UTC (rev 38405)
+++ scummvm/trunk/engines/sci/engine/scriptdebug.cpp	2009-02-17 13:51:52 UTC (rev 38406)
@@ -2559,7 +2559,7 @@
 	                     (int *) &(s->debug_mode),
 	                     param);
 
-	sci_free(param);
+	free(param);
 }
 
 int
@@ -2954,7 +2954,7 @@
 	/* Delete it */
 	bp_next = bp->next;
 	type = bp->type;
-	if (type == BREAK_SELECTOR) sci_free(bp->data.name);
+	if (type == BREAK_SELECTOR) free(bp->data.name);
 	free(bp);
 	if (bp_prev)
 		bp_prev->next = bp_next;

Modified: scummvm/trunk/engines/sci/engine/seg_manager.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/seg_manager.cpp	2009-02-17 12:20:40 UTC (rev 38405)
+++ scummvm/trunk/engines/sci/engine/seg_manager.cpp	2009-02-17 13:51:52 UTC (rev 38406)
@@ -153,7 +153,7 @@
 
 	delete self->id_seg_map;
 
-	sci_free(self->heap);
+	free(self->heap);
 	self->heap = NULL;
 }
 
@@ -285,44 +285,44 @@
 		break;
 
 	case MEM_OBJ_LOCALS:
-		sci_free(mobj->data.locals.locals);
+		free(mobj->data.locals.locals);
 		mobj->data.locals.locals = NULL;
 		break;
 
 	case MEM_OBJ_DYNMEM:
 		if (mobj->data.dynmem.buf)
-			sci_free(mobj->data.dynmem.buf);
+			free(mobj->data.dynmem.buf);
 		mobj->data.dynmem.buf = NULL;
 		break;
 	case MEM_OBJ_SYS_STRINGS:
 		sys_string_free_all(&(mobj->data.sys_strings));
 		break;
 	case MEM_OBJ_STACK:
-		sci_free(mobj->data.stack.entries);
+		free(mobj->data.stack.entries);
 		mobj->data.stack.entries = NULL;
 		break;
 	case MEM_OBJ_LISTS:
-		sci_free(mobj->data.lists.table);
+		free(mobj->data.lists.table);
 		mobj->data.lists.table = NULL;
 		mobj->data.lists.entries_nr = mobj->data.lists.max_entry = 0;
 		break;
 	case MEM_OBJ_NODES:
-		sci_free(mobj->data.nodes.table);
+		free(mobj->data.nodes.table);
 		mobj->data.nodes.table = NULL;
 		mobj->data.nodes.entries_nr = mobj->data.nodes.max_entry = 0;
 		break;
 	case MEM_OBJ_CLONES:
-		sci_free(mobj->data.clones.table);
+		free(mobj->data.clones.table);
 		mobj->data.clones.table = NULL;
 		mobj->data.clones.entries_nr = mobj->data.clones.max_entry = 0;
 		break;
 	case MEM_OBJ_HUNK:
-		sci_free(mobj->data.hunks.table);
+		free(mobj->data.hunks.table);
 		mobj->data.hunks.table = NULL;
 		mobj->data.hunks.entries_nr = mobj->data.hunks.max_entry = 0;
 		break;
 	case MEM_OBJ_RESERVED:
-		sci_free(mobj->data.reserved);
+		free(mobj->data.reserved);
 		break;
 	default:
 		fprintf(stderr, "Deallocating segment type %d not supported!\n",
@@ -432,7 +432,7 @@
 sm_free_script(mem_obj_t* mem) {
 	if (!mem) return;
 	if (mem->data.script.buf) {
-		sci_free(mem->data.script.buf);
+		free(mem->data.script.buf);
 		mem->data.script.buf = NULL;
 		mem->data.script.buf_size = 0;
 	}
@@ -453,7 +453,7 @@
 
 	delete mem->data.script.obj_indices;
 	if (NULL != mem->data.script.code) {
-		sci_free(mem->data.script.code);
+		free(mem->data.script.code);
 	}
 }
 
@@ -1283,7 +1283,7 @@
 			                                      * scr->objects_nr);
 		else {
 			if (scr->objects_allocated)
-				sci_free(scr->objects);
+				free(scr->objects);
 			scr->objects = NULL;
 		}
 		scr->objects_allocated = scr->objects_nr;
@@ -1378,7 +1378,7 @@
 static void
 _clone_cleanup(clone_t *clone) {
 	if (clone->variables)
-		sci_free(clone->variables); /* Free the dynamically allocated memory part */
+		free(clone->variables); /* Free the dynamically allocated memory part */
 }
 
 static void
@@ -1604,7 +1604,7 @@
 
 static void
 deallocate_self(seg_interface_t *self) {
-	sci_free(self);
+	free(self);
 }
 
 
@@ -1728,7 +1728,7 @@
 		sciprintf("[GC] Clone "PREG": Freeing\n", PRINT_REG(addr));
 		sciprintf("[GC] Clone had pos "PREG"\n", PRINT_REG(victim_obj->pos));
 	*/
-	sci_free(victim_obj->variables);
+	free(victim_obj->variables);
 	victim_obj->variables = NULL;
 	sm_free_clone(self->segmgr, addr);
 }

Modified: scummvm/trunk/engines/sci/engine/sys_strings.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/sys_strings.cpp	2009-02-17 12:20:40 UTC (rev 38405)
+++ scummvm/trunk/engines/sci/engine/sys_strings.cpp	2009-02-17 13:51:52 UTC (rev 38406)
@@ -104,7 +104,7 @@
 		if (data) {
 			s->value = (char *)sci_malloc(s->max_size + 1);
 			strcpy(s->value, data);
-			sci_free(data);
+			free(data);
 		}
 	}
 

Modified: scummvm/trunk/engines/sci/engine/vm.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/vm.cpp	2009-02-17 12:20:40 UTC (rev 38405)
+++ scummvm/trunk/engines/sci/engine/vm.cpp	2009-02-17 13:51:52 UTC (rev 38406)
@@ -2212,7 +2212,7 @@
 		run_vm(s, (successor || restoring) ? 1 : 0);
 		if (s->restarting_flags & SCI_GAME_IS_RESTARTING_NOW) { /* Restart was requested? */
 
-			sci_free(s->execution_stack);
+			free(s->execution_stack);
 			s->execution_stack = NULL;
 			s->execution_stack_pos = -1;
 			s->execution_stack_pos_changed = 0;
@@ -2237,7 +2237,7 @@
 			if (successor) {
 				game_exit(s);
 				script_free_vm_memory(s);
-				sci_free(s);
+				free(s);
 				s = successor;
 
 				if (!send_calls_allocated)

Modified: scummvm/trunk/engines/sci/gfx/operations.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/operations.cpp	2009-02-17 12:20:40 UTC (rev 38405)
+++ scummvm/trunk/engines/sci/gfx/operations.cpp	2009-02-17 13:51:52 UTC (rev 38406)
@@ -2269,11 +2269,11 @@
 
 			for (j = 0; j < i; j++)
 				gfx_free_pixmap(state->driver, handle->text_pixmaps[j]);
-			sci_free(handle->text_pixmaps);
-			sci_free(handle->text);
-			sci_free(handle->lines);
+			free(handle->text_pixmaps);
+			free(handle->text);
+			free(handle->lines);
 			GFXERROR("Failed to draw text pixmap for line %d/%d\n", i, handle->lines_nr);
-			sci_free(handle);
+			free(handle);
 			return NULL;
 		}
 	}

Modified: scummvm/trunk/engines/sci/include/sci_memory.h
===================================================================
--- scummvm/trunk/engines/sci/include/sci_memory.h	2009-02-17 12:20:40 UTC (rev 38405)
+++ scummvm/trunk/engines/sci/include/sci_memory.h	2009-02-17 13:51:52 UTC (rev 38406)
@@ -129,7 +129,7 @@
 /* Allocates the specified amount of memory.
 ** Parameters: (size_t) size: Number of bytes to allocate
 ** Returns   : (void *) A pointer to the allocated memory chunk
-** To free this string, use the sci_free() command.
+** To free this string, use the free() command.
 ** If the call fails, behaviour is dependent on the definition of SCI_ALLOC.
 */
 
@@ -139,7 +139,7 @@
 ** Parameters: (size_t) num: Number of elements to allocate
 **             (size_t) size: Amount of memory per element to allocate
 ** Returns   : (void *) A pointer to the allocated memory chunk
-** To free this string, use the sci_free() command.
+** To free this string, use the free() command.
 ** See _SCI_MALLOC() for more information if call fails.
 */
 
@@ -152,17 +152,10 @@
 **             bytes of memory and everything contained in the original 'ptr'
 **             (possibly minus some trailing data if the new memory area is
 **             smaller than the old one).
-** To free this string, use the sci_free() command.
+** To free this string, use the free() command.
 ** See _SCI_MALLOC() for more information if call fails.
 */
 
-extern void
-	sci_free(void *ptr);
-/* Frees previously allocated memory chunks
-** Parameters: (void *) ptr: The pointer to free
-** Returns   : (void)
-*/
-
 extern void *
 	sci_memdup(const void *src, size_t size);
 /* Duplicates a chunk of memory
@@ -170,7 +163,7 @@
 **             (size_t) size: Number of bytes to duplicate
 ** Returns   : (void *) An appropriately allocated duplicate, or NULL on error
 ** Please try to avoid data duplication unless absolutely neccessary!
-** To free this string, use the sci_free() command.
+** To free this string, use the free() command.
 ** See _SCI_MALLOC() for more information if call fails.
 */
 
@@ -180,7 +173,7 @@
 ** Parameters: (const char *) src: The original pointer
 ** Returns   : (char *) a pointer to the storage location for the copied
 **             string.
-** To free this string, use the sci_free() command.
+** To free this string, use the free() command.
 ** See _SCI_MALLOC() for more information if call fails.
 */
 
@@ -192,7 +185,7 @@
 **             (int) length: The maximum length of the string (not counting
 **                           a trailing \0).
 ** Returns   : (char *) The resulting copy, allocated with sci_malloc().
-** To free this string, use the sci_free() command.
+** To free this string, use the free() command.
 ** See _SCI_MALLOC() for more information if call fails.
 */
 

Modified: scummvm/trunk/engines/sci/sci.cpp
===================================================================
--- scummvm/trunk/engines/sci/sci.cpp	2009-02-17 12:20:40 UTC (rev 38405)
+++ scummvm/trunk/engines/sci/sci.cpp	2009-02-17 13:51:52 UTC (rev 38406)
@@ -325,8 +325,8 @@
 	game_exit(gamestate);
 	script_free_engine(gamestate); /* Uninitialize game state */
 	script_free_breakpoints(gamestate);
-	sci_free(gamestate->work_dir);
-	sci_free(gamestate);
+	free(gamestate->work_dir);
+	free(gamestate);
 
 	scir_free_resource_manager(resmgr);
 

Modified: scummvm/trunk/engines/sci/scicore/aatree.cpp
===================================================================
--- scummvm/trunk/engines/sci/scicore/aatree.cpp	2009-02-17 12:20:40 UTC (rev 38405)
+++ scummvm/trunk/engines/sci/scicore/aatree.cpp	2009-02-17 13:51:52 UTC (rev 38406)
@@ -84,7 +84,7 @@
 			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(t->left);
 	aatree_free(t->right);
 
-	sci_free(t);
+	free(t);
 }

Modified: scummvm/trunk/engines/sci/scicore/exe.cpp
===================================================================
--- scummvm/trunk/engines/sci/scicore/exe.cpp	2009-02-17 12:20:40 UTC (rev 38405)
+++ scummvm/trunk/engines/sci/scicore/exe.cpp	2009-02-17 13:51:52 UTC (rev 38406)
@@ -78,5 +78,5 @@
 exe_close(exe_file_t *file) {
 	file->decompressor->close(file->handle);
 
-	sci_free(file);
+	free(file);
 }

Modified: scummvm/trunk/engines/sci/scicore/exe_lzexe.cpp
===================================================================
--- scummvm/trunk/engines/sci/scicore/exe_lzexe.cpp	2009-02-17 12:20:40 UTC (rev 38405)
+++ scummvm/trunk/engines/sci/scicore/exe_lzexe.cpp	2009-02-17 13:51:52 UTC (rev 38406)
@@ -263,7 +263,7 @@
 	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 @@
 lzexe_close(exe_handle_t *handle) {
 	fclose(handle->f);
 
-	sci_free(handle);
+	free(handle);
 }
 
 exe_decompressor_t

Modified: scummvm/trunk/engines/sci/scicore/exe_raw.cpp
===================================================================
--- scummvm/trunk/engines/sci/scicore/exe_raw.cpp	2009-02-17 12:20:40 UTC (rev 38405)
+++ scummvm/trunk/engines/sci/scicore/exe_raw.cpp	2009-02-17 13:51:52 UTC (rev 38406)
@@ -56,7 +56,7 @@
 raw_close(exe_handle_t *handle) {
 	fclose(handle->f);
 
-	sci_free(handle);
+	free(handle);
 }
 
 exe_decompressor_t

Modified: scummvm/trunk/engines/sci/scicore/resource.cpp
===================================================================
--- scummvm/trunk/engines/sci/scicore/resource.cpp	2009-02-17 12:20:40 UTC (rev 38405)
+++ scummvm/trunk/engines/sci/scicore/resource.cpp	2009-02-17 13:51:52 UTC (rev 38406)
@@ -608,7 +608,7 @@
 		}
 		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_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_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;
 }

Modified: scummvm/trunk/engines/sci/scicore/resource_map.cpp
===================================================================
--- scummvm/trunk/engines/sci/scicore/resource_map.cpp	2009-02-17 12:20:40 UTC (rev 38405)
+++ scummvm/trunk/engines/sci/scicore/resource_map.cpp	2009-02-17 13:51:52 UTC (rev 38406)
@@ -236,7 +236,7 @@
 			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;
 			}

Modified: scummvm/trunk/engines/sci/scicore/sci_memory.cpp
===================================================================
--- scummvm/trunk/engines/sci/scicore/sci_memory.cpp	2009-02-17 12:20:40 UTC (rev 38405)
+++ scummvm/trunk/engines/sci/scicore/sci_memory.cpp	2009-02-17 13:51:52 UTC (rev 38406)
@@ -76,18 +76,6 @@
 }
 
 
-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 @@
 #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

Modified: scummvm/trunk/engines/sci/scicore/tools.cpp
===================================================================
--- scummvm/trunk/engines/sci/scicore/tools.cpp	2009-02-17 12:20:40 UTC (rev 38405)
+++ scummvm/trunk/engines/sci/scicore/tools.cpp	2009-02-17 13:51:52 UTC (rev 38406)
@@ -674,7 +674,7 @@
 		if (getcwd(cwd, size - 1))
 			return cwd;
 
-		sci_free(cwd);
+		free(cwd);
 	}
 
 	fprintf(stderr, "Could not determine current working directory!\n");

Modified: scummvm/trunk/engines/sci/sfx/iterator.cpp
===================================================================
--- scummvm/trunk/engines/sci/sfx/iterator.cpp	2009-02-17 12:20:40 UTC (rev 38405)
+++ scummvm/trunk/engines/sci/sfx/iterator.cpp	2009-02-17 13:51:52 UTC (rev 38406)
@@ -1000,7 +1000,7 @@
 
 		self->next_sample = self->next_sample->next;
 
-		sci_free(sample);
+		free(sample);
 
 		return feed;
 	} else
@@ -1269,7 +1269,7 @@
 	while (sample_seeker) {
 		sci1_sample_t *old_sample = sample_seeker;
 		sample_seeker = sample_seeker->next;
-		sci_free(old_sample);
+		free(old_sample);
 	}
 
 	_sci0_cleanup((sci0_song_iterator_t *)it);
@@ -1383,7 +1383,7 @@
 		case _SIMSG_PLASTICWRAP_ACK_MORPH:
 			if (self->delta <= 0) {
 				song_iterator_t *it = self->delegate;
-				sci_free(self);
+				free(self);
 				return it;
 			}
 			break;
@@ -1658,13 +1658,13 @@
 				if (self->may_destroy)
 					songit_free(self->children[TEE_LEFT].it);
 				old_it = self->children[TEE_RIGHT].it;
-				sci_free(self);
+				free(self);
 				return old_it;
 			} else if (!(self->status & TEE_RIGHT_ACTIVE)) {
 				if (self->may_destroy)
 					songit_free(self->children[TEE_RIGHT].it);
 				old_it = self->children[TEE_LEFT].it;
-				sci_free(self);
+				free(self);
 				return old_it;
 			} else {
 				sciprintf("[tee-iterator] WARNING:"
@@ -1949,7 +1949,7 @@
 		for (i = 0; i < it->death_listeners_nr; i++)
 			it->death_listeners[i].notify(it->death_listeners[i].self, it);
 
-		sci_free(it);
+		free(it);
 	}
 }
 

Modified: scummvm/trunk/engines/sci/sfx/mixer/soft.cpp
===================================================================
--- scummvm/trunk/engines/sci/sfx/mixer/soft.cpp	2009-02-17 12:20:40 UTC (rev 38405)
+++ scummvm/trunk/engines/sci/sfx/mixer/soft.cpp	2009-02-17 13:51:52 UTC (rev 38406)
@@ -216,7 +216,7 @@
 			feed->destroy(feed);
 
 			if (fs->buf)
-				sci_free(fs->buf);
+				free(fs->buf);
 
 			self->feeds_nr--;
 
@@ -255,16 +255,16 @@
 		_mix_unsubscribe(self, self->feeds[0].feed);
 
 	if (P->outbuf)
-		sci_free(P->outbuf);
+		free(P->outbuf);
 	if (P->writebuf)
-		sci_free(P->writebuf);
+		free(P->writebuf);
 
 	if (P->compbuf_l)
-		sci_free(P->compbuf_l);
+		free(P->compbuf_l);
 	if (P->compbuf_l)
-		sci_free(P->compbuf_r);
+		free(P->compbuf_r);
 
-	sci_free(P);
+	free(P);
 	self->private_bits /* = P */ = NULL;
 	RELEASE_LOCK();
 

Modified: scummvm/trunk/engines/sci/sfx/pcm-iterator.cpp
===================================================================
--- scummvm/trunk/engines/sci/sfx/pcm-iterator.cpp	2009-02-17 12:20:40 UTC (rev 38405)
+++ scummvm/trunk/engines/sci/sfx/pcm-iterator.cpp	2009-02-17 13:51:52 UTC (rev 38406)
@@ -109,6 +109,6 @@
 static void
 pi_destroy(sfx_pcm_feed_t *self) {
 	sci_refcount_decref(D->base_data);
-	sci_free(D);
-	sci_free(self);
+	free(D);
+	free(self);
 }

Modified: scummvm/trunk/engines/sci/sfx/softseq/amiga.cpp
===================================================================
--- scummvm/trunk/engines/sci/sfx/softseq/amiga.cpp	2009-02-17 12:20:40 UTC (rev 38405)
+++ scummvm/trunk/engines/sci/sfx/softseq/amiga.cpp	2009-02-17 13:51:52 UTC (rev 38406)
@@ -528,8 +528,8 @@
 
 	for (i = 0; i < bank.size; i++) {
 		if (bank.instruments[i]) {
-			sci_free(bank.instruments[i]->samples);
-			sci_free(bank.instruments[i]);
+			free(bank.instruments[i]->samples);
+			free(bank.instruments[i]);
 		}
 	}
 }


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list