<commit_before>/* :ts=4
 *  $VER: retroFreeSprite.c $Revision$ (11-Nov-2017)
 *
 *  This file is part of retromode.
 *
 *  Copyright (c) 2017 LiveForIt Software.
 *  MIT License.
 *
 * $Id$
 *
 * $Log$
 *
 *
 */

#include <stdlib.h>
#include <stdio.h>
#include <exec/exec.h>
#include <proto/exec.h>
#include <dos/dos.h>
#include <exec/types.h>
#include <libraries/retromode.h>
#include <proto/retromode.h>
#include <stdarg.h>
#include <libbase.h>

/****** retromode/main/retroFreeSprite ******************************************
*
*   NAME
*      retroFreeSprite -- Description
*
*   SYNOPSIS
*      void retroFreeSprite(struct retroSprite * sprite);
*
*   FUNCTION
*
*   INPUTS
*       sprite - 
*
*   RESULT
*       This function does not return a result
*
*   EXAMPLE
*
*   NOTES
*
*   BUGS
*
*   SEE ALSO
*
*****************************************************************************
*
*/

void _retromode_retroFreeSprite(struct RetroModeIFace *Self, struct retroSprite * sprite)
{
	struct RetroLibrary *libBase = (struct RetroLibrary *) Self -> Data.LibBase;
	int n;

	if (sprite)
	{
		if (sprite->frames)
		{
			for (n=0; n<sprite->number_of_frames; n++ )
			{
				if (sprite->frames[n].data) libBase->IExec->FreeVec(sprite->frames[n].data);
			 }
<commit_msg>Optimization: moving variable declarations from outer if to inner if's<commit_after>/* :ts=4
 *  $VER: retroFreeSprite.c $Revision$ (11-Nov-2017)
 *
 *  This file is part of retromode.
 *
 *  Copyright (c) 2017 LiveForIt Software.
 *  MIT License.
 *
 * $Id$
 *
 * $Log$
 *
 *
 */

#include <stdlib.h>
#include <stdio.h>
#include <exec/exec.h>
#include <proto/exec.h>
#include <dos/dos.h>
#include <exec/types.h>
#include <libraries/retromode.h>
#include <proto/retromode.h>
#include <stdarg.h>
#include <libbase.h>

/****** retromode/main/retroFreeSprite ******************************************
*
*   NAME
*      retroFreeSprite -- Description
*
*   SYNOPSIS
*      void retroFreeSprite(struct retroSprite * sprite);
*
*   FUNCTION
*
*   INPUTS
*       sprite - 
*
*   RESULT
*       This function does not return a result
*
*   EXAMPLE
*
*   NOTES
*
*   BUGS
*
*   SEE ALSO
*
*****************************************************************************
*
*/

void _retromode_retroFreeSprite(struct RetroModeIFace *Self, struct retroSprite * sprite)
{
	struct RetroLibrary *libBase = (struct RetroLibrary *) Self -> Data.LibBase;

	if (sprite)
	{
		if (sprite->frames)
		{
			int n;

			for (n=0; n<sprite->number_of_frames; n++ )
			{
				if (sprite->frames[n].data) libBase->IExec->FreeVec(sprite->frames[n].data);
			 }

{'fraction_non_alphanumeric': 0.23266563944530047, 'fraction_numerical': 0.009244992295839754, 'mean_word_length': 3.6624775583482942, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 37, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4611387', 'n_tokens_mistral': 1021, 'n_tokens_neox': 940, 'n_words': 195}