当前位置: 首页>>代码示例>>C++>>正文


C++ Q_free函数代码示例

本文整理汇总了C++中Q_free函数的典型用法代码示例。如果您正苦于以下问题:C++ Q_free函数的具体用法?C++ Q_free怎么用?C++ Q_free使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了Q_free函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: StatsGrid_Remove

void StatsGrid_Remove(stats_weight_grid_t **grid)
{
	int row;

	// Nothing to remove.
	if((*grid) == NULL)
	{
		return;
	}

	// Free all the rows.
	if((*grid)->cells != NULL)
	{
		for(row = 0; row < (*grid)->row_count; row++)
		{
			// Make sure it hasn't already been freed.
			if((*grid)->cells[row] != NULL)
			{
				Q_free((*grid)->cells[row]);
			}
		}
	}

	// Free all columns.
	Q_free((*grid)->cells);

	// Free the grid itself.
	Q_free((*grid));
}
开发者ID:jite,项目名称:jquake,代码行数:29,代码来源:stats_grid.c

示例2: Q_malloc

// strip spaces multiple spaces from in-between words
char *XSD_StripSpaces (char *str)
{
    char *buf, *ret;
    unsigned int p = 0, q = 0;

    if (str == NULL)
        return str;

    buf = (char *) Q_malloc(strlen(str)+1);
    for (p=0; p < strlen(str); p++)
    {
        if (XSD_IsSpace(str[p]))
        {
            if (q == 0  ||  XSD_IsSpace(buf[q-1]))
                ;
            else
                buf[q++] = ' ';
        }
        else
            buf[q++] = str[p];
    }

    // strip spaces from the end
    while (q > 0  &&  XSD_IsSpace(buf[q-1]))
        q--;
    buf[q] = 0;

    ret = (char *) Q_strdup(buf);
    Q_free(buf);
    Q_free(str);
    return ret;
}
开发者ID:AAS,项目名称:ezquake-source,代码行数:33,代码来源:xsd.c

示例3: Q_free

mvd_clock_t *MVD_ClockList_Remove(mvd_clock_t *item)
{
	mvd_clock_t *ret = NULL;

	if (item == mvd_clocklist) {
		mvd_clocklist = item->next;
		if (mvd_clocklist) {
			mvd_clocklist->prev = NULL;
		}
		Q_free(item);
		return mvd_clocklist;
	}

	ret = item->next;
	// item->prev is not null
	if (item->next) {
		item->next->prev = item->prev;
		item->prev->next = item->next;
	}
	else {
		item->prev->next = NULL;
	}
	Q_free(item);
	return ret;
}
开发者ID:DavidWiberg,项目名称:ezquake-source,代码行数:25,代码来源:mvd_utils.c

示例4: funcmp

// compares two fun strings
int funcmp(const char *s1, const char *s2)
{
    char *t1, *t2;
    int ret;

    if (s1 == NULL  &&  s2 == NULL)
        return 0;

    if (s1 == NULL)
        return -1;

    if (s2 == NULL)
        return 1;

    t1 = Q_strdup(s1);
    t2 = Q_strdup(s2);

    FunToSort(t1);
    FunToSort(t2);

    ret = strcmp(t1, t2);

    Q_free(t1);
    Q_free(t2);

    return ret;
}
开发者ID:AAS,项目名称:ezquake-source,代码行数:28,代码来源:utils.c

示例5: MP3_WINAMP_CachePlaylistFlush

static void MP3_WINAMP_CachePlaylistFlush(void) {
	int i;
	for (i = 0; i < WINAMP_Playlist_nelms; i++)
		Q_free(WINAMP_Playlist[i]);

	Q_free(WINAMP_Playlist);
}
开发者ID:jogi1,项目名称:camquake,代码行数:7,代码来源:mp3_winamp.c

示例6: Util_F_Match

qbool Util_F_Match (const char *_msg, char *f_request) {
	int offset, i, status, flags;
	char *s, *msg;

	msg = Q_strdup(_msg);
	flags = TP_CategorizeMessage(msg, &offset);

	if (flags != 1 && flags != 4)
		return false;

	for (i = 0, s = msg + offset; i < strlen(s); i++)
		s[i] = s[i] & ~128;		

	if (strstr(s, f_request) != s) {
		Q_free(msg);
		return false;
	}
	status = 0;
	for (s += strlen(f_request); *s; s++) {
		if (isdigit(*s) && status <= 1) {
			status = 1;
		} else if (isspace(*s)) {
			status = (status == 1) ? 2 : status;
		} else {
			Q_free(msg);			
			return false;
		}
	}
	Q_free(msg);
	return true;
}
开发者ID:AAS,项目名称:ezquake-source,代码行数:31,代码来源:utils.c

示例7: R_Bloom_InitTextures

void R_Bloom_InitTextures( void )
{
	unsigned char *data;
	int maxtexsize;
	size_t size;

	// Find closer power of 2 to screen size.
	for (screen_texture_width = 1;  screen_texture_width  < glwidth;  screen_texture_width *= 2);
	for (screen_texture_height = 1; screen_texture_height < glheight; screen_texture_height *= 2);

    // Disable blooms if we can't handle a texture of that size.
	glGetIntegerv (GL_MAX_TEXTURE_SIZE, &maxtexsize);
	if (screen_texture_width > maxtexsize || screen_texture_height > maxtexsize)
	{
		screen_texture_width = screen_texture_height = 0;
		Cvar_SetValue (&r_bloom, 0);
		Com_Printf ("WARNING: 'R_InitBloomScreenTexture' too high resolution for Light Bloom. Effect disabled\n");
		return;
	}

	// Init the screen texture.
	size = screen_texture_width * screen_texture_height * sizeof (int);
	data = Q_malloc (size);
	memset (data, 255, size);
	//r_bloomscreentexture = GL_LoadTexture ( "***r_screenbackuptexture***", screen_texture_width, screen_texture_height, data, 0, 4); // false, false, 4);
	
	if (!r_bloomscreentexture)
		r_bloomscreentexture = texture_extension_number++;

	GL_Bind (r_bloomscreentexture);
	glTexImage2D (GL_TEXTURE_2D, 0, gl_solid_format, screen_texture_width, screen_texture_height, 0, GL_RGBA, GL_UNSIGNED_BYTE, data);
	glTexParameterf (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
	glTexParameterf (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);

	Q_free (data);

	// Validate bloom size and init the bloom effect texture.
	R_Bloom_InitEffectTexture();

	// If screensize is more than 2x the bloom effect texture, set up for stepped downsampling.
	r_bloomdownsamplingtexture = 0;
	r_screendownsamplingtexture_size = 0;
	if( glwidth > (BLOOM_SIZE * 2) && !r_bloom_fast_sample.value )
	{
		r_screendownsamplingtexture_size = (int)(BLOOM_SIZE * 2);
		data = Q_calloc (r_screendownsamplingtexture_size * r_screendownsamplingtexture_size, sizeof (int));
		r_bloomdownsamplingtexture = GL_LoadTexture ( "***r_bloomdownsamplingtexture***", r_screendownsamplingtexture_size, r_screendownsamplingtexture_size, data, 0, 4);
		Q_free (data);
	}

	// Init the screen backup texture.
	if (r_screendownsamplingtexture_size)
		R_Bloom_InitBackUpTexture (r_screendownsamplingtexture_size, r_screendownsamplingtexture_size);
	else
		R_Bloom_InitBackUpTexture (BLOOM_SIZE, BLOOM_SIZE);
}
开发者ID:jogi1,项目名称:camquake,代码行数:56,代码来源:gl_bloom.c

示例8: ClipWinding

/*
=================
ChopWinding

Returns the fragment of in that is on the front side
of the cliping plane.  The original is freed.
=================
*/
winding_t	*ChopWinding (winding_t *in, vec3_t normal, vec_t dist)
{
	winding_t	*f, *b;

	ClipWinding (in, normal, dist, &f, &b);
	Q_free (in);
	if (b)
		Q_free (b);
	return f;
}
开发者ID:atphalix,项目名称:eviltoys,代码行数:18,代码来源:polylib.c

示例9: QTVList_Entry_Destroy

void QTVList_Entry_Destroy(sb_qtventry_t *entry)
{
	while (entry->players) {
		sb_qtvplayer_t *next = entry->players->next;
		Q_free(entry->players);
		entry->players = next;
	}

	Q_free(entry);
}
开发者ID:AAS,项目名称:ezquake-source,代码行数:10,代码来源:EX_browser_qtvlist.c

示例10: FreePage

static void FreePage(CPageViewer_page_t *page)
{
    FreePageRendered(page);
    if (page->url)
        Q_free(page->url);
    if (page->doc)
        XSD_FreeDocument((xml_t *)page->doc);
    Q_free(page);
    return;
}
开发者ID:AAS,项目名称:ezquake-source,代码行数:10,代码来源:Ctrl_PageViewer.c

示例11: SList_Set

void SList_Set (int i, char *addr, char *desc) {
	if (i >= MAX_SERVER_LIST || i < 0)
		Sys_Error("SList_Switch: Bad index %d", i);

	if (slist[i].server)
		Q_free(slist[i].server);
	if (slist[i].description)
		Q_free(slist[i].description);

	slist[i].server = Q_strdup (addr);
	slist[i].description = Q_strdup (desc);
}
开发者ID:DavidWiberg,项目名称:ezquake-source,代码行数:12,代码来源:cl_slist.c

示例12: CmdArgs_Clear

void CmdArgs_Clear(void)
{
	int i;

	for (i = 0; i < cmdargs.mvd_files_count; i++)
	{
		Q_free(cmdargs.mvd_files[i]);
	}

	Q_free(cmdargs.template_file);
	Q_free(cmdargs.frag_file);
}
开发者ID:JoakimSoderberg,项目名称:mvdparser,代码行数:12,代码来源:main.c

示例13: IN_RawInput_DeInit

void IN_RawInput_DeInit(void)
{
	if (rawmicecount < 1)
		return;

	IN_RawInput_DeRegister();
	Q_free(rawmice);
	Q_free(raw);

	// dealloc mouse structure
	rawmicecount = 0;
}
开发者ID:jite,项目名称:jquake,代码行数:12,代码来源:in_win.c

示例14: Cmd_StuffCmds_f

/*
===============
Cmd_StuffCmds_f

Adds command line parameters as script statements
Commands lead with a +, and continue until a - or another +
quake +prog jctest.qp +cmd amlev1
quake -nosound +cmd amlev1
===============
*/
void Cmd_StuffCmds_f (void)
{
	int i, j;
	int s;
	char *text, *build, c;

	// build the combined string to parse from
	s = 0;
	for (i = 1; i < com_argc; i++)
		s += strlen (com_argv[i]) + 1;

	if (!s)
		return;

	text = (char *) Q_malloc (s+1);
	text[0] = 0;
	for (i = 1; i < com_argc; i++)
	{
		strlcat (text, com_argv[i], s + 1);
		if (i != com_argc-1)
			strlcat (text, " ", s + 1);
	}

	// pull out the commands
	build = (char *) Q_malloc (s+1);
	build[0] = 0;

	for (i=0 ; i<s-1 ; i++)
	{
		if (text[i] == '+')
		{
			i++;

			for (j=i ; (text[j] != '+') && (text[j] != '-') && (text[j] != 0) ; j++)
				;

			c = text[j];
			text[j] = 0;

			strlcat (build, text + i, s + 1);
			strlcat (build, "\n", s + 1);
			text[j] = c;
			i = j-1;
		}
	}

	if (build[0])
		Cbuf_AddText (build);

	Q_free (text);
	Q_free (build);
}
开发者ID:QuakePhil,项目名称:mvdsv,代码行数:62,代码来源:cmd.c

示例15: Reset_Source

void Reset_Source(source_data *s)
{
    int i;
    if (s->servers != NULL)
    {
        for (i=0; i < s->serversn; i++)
            Q_free(s->servers[i]);
        Q_free(s->servers);
    }
    s->serversn = 0;
    s->last_update.wYear = 0;
    //s->name[0] = 0;
}
开发者ID:imanex,项目名称:ezquake-source,代码行数:13,代码来源:EX_browser_sources.c


注:本文中的Q_free函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。