close(dri2_dpy->fd);
if (dri2_dpy->driver)
dlclose(dri2_dpy->driver);
- if (dri2_dpy->device_name)
- free(dri2_dpy->device_name);
+ free(dri2_dpy->device_name);
if (disp->PlatformDisplay == NULL) {
switch (disp->Platform) {
if (authenticate == NULL || !authenticate->authenticated)
ret = -1;
- if (authenticate)
- free(authenticate);
+ free(authenticate);
return ret;
}
_eglReleaseDisplayResources(drv, disp);
_eglCleanupDisplay(disp);
- if (GLX_dpy->visuals)
- free(GLX_dpy->visuals);
- if (GLX_dpy->fbconfigs)
- free(GLX_dpy->fbconfigs);
+ free(GLX_dpy->visuals);
+ free(GLX_dpy->fbconfigs);
if (!disp->PlatformDisplay)
XCloseDisplay(GLX_dpy->dpy);
static void fc_poplevel(struct r600_shader_ctx *ctx)
{
struct r600_cf_stack_entry *sp = &ctx->bc->fc_stack[ctx->bc->fc_sp];
- if (sp->mid) {
- free(sp->mid);
- sp->mid = NULL;
- }
+ free(sp->mid);
+ sp->mid = NULL;
sp->num_mid = 0;
sp->start = NULL;
sp->type = 0;
priv = (__GLXdisplayPrivate *) extension->private_data;
FreeScreenConfigs(priv);
- if (priv->serverGLXversion)
- free((char *) priv->serverGLXversion);
-
+ free((char *) priv->serverGLXversion);
free((char *) priv);
return 0;
}
{
if (xscr->dri_fd >= 0)
close(xscr->dri_fd);
- if (xscr->dri_driver)
- free(xscr->dri_driver);
- if (xscr->dri_device)
- free(xscr->dri_device);
+ free(xscr->dri_driver);
+ free(xscr->dri_device);
#ifdef GLX_DIRECT_RENDERING
/* xscr->glx_dpy will be destroyed with the X display */
xscr->glx_dpy->xscr = NULL;
#endif
- if (xscr->visuals)
- free(xscr->visuals);
+ free(xscr->visuals);
FREE(xscr);
}
xmdpy->screen->destroy(xmdpy->screen);
xmdpy->screen = NULL;
}
- if (xmdpy->smapi) {
- free(xmdpy->smapi);
- xmdpy->smapi = NULL;
- }
+ free(xmdpy->smapi);
+ xmdpy->smapi = NULL;
xmdpy->display = NULL;
}
stfbi = CALLOC_STRUCT(st_framebuffer_iface);
xstfb = CALLOC_STRUCT(xmesa_st_framebuffer);
if (!stfbi || !xstfb) {
- if (stfbi)
- free(stfbi);
- if (xstfb)
- free(xstfb);
+ free(stfbi);
+ free(xstfb);
return NULL;
}
ureg_destroy(ureg);
- if (temp)
- free(temp);
- if (constant)
- free(constant);
- if (sampler)
- free(sampler);
+ free(temp);
+ free(constant);
+ free(sampler);
return p;
}
subpictures = XvMCListSubpictureTypes(dpy, port, surface_type_id, &num_subpics);
if (num_subpics < 1) {
- if (subpictures)
- free(subpictures);
+ free(subpictures);
return BadMatch;
}
if (!subpictures)
if (xlib_handle)
FREE(xlib_handle);
- if (visinfo)
- free(visinfo);
+ free(visinfo);
if (win)
XDestroyWindow(graw.display, win);
driReleaseDrawables(&pcp->base);
- if (context->extensions)
- free((char *) context->extensions);
+ free((char *) context->extensions);
(*psc->core->destroyContext) (pcp->driContext);
return &pcp->base;
error_exit:
- if (pcp != NULL)
- free(pcp);
+ free(pcp);
return NULL;
}
if (framebuffer.base != MAP_FAILED)
drmUnmap((drmAddress) framebuffer.base, framebuffer.size);
- if (framebuffer.dev_priv != NULL)
- free(framebuffer.dev_priv);
+ free(framebuffer.dev_priv);
if (fd >= 0)
drmCloseOnce(fd);
driReleaseDrawables(&pcp->base);
- if (context->extensions)
- free((char *) context->extensions);
+ free((char *) context->extensions);
(*psc->core->destroyContext) (pcp->driContext);
driReleaseDrawables(&pcp->base);
- if (context->extensions)
- free((char *) context->extensions);
+ free((char *) context->extensions);
(*psc->core->destroyContext) (pcp->driContext);
}
FreeScreenConfigs(priv);
- if (priv->serverGLXvendor)
- free((char *) priv->serverGLXvendor);
- if (priv->serverGLXversion)
- free((char *) priv->serverGLXversion);
+ free((char *) priv->serverGLXvendor);
+ free((char *) priv->serverGLXversion);
__glxHashDestroy(priv->glXDrawHash);
{
if (psc->configs) {
glx_config_destroy_list(psc->configs);
- if (psc->effectiveGLXexts)
- free(psc->effectiveGLXexts);
+ free(psc->effectiveGLXexts);
psc->configs = NULL; /* NOTE: just for paranoia */
}
if (psc->visuals) {
{
__glXFreeVertexArrayState(gc);
- if (gc->vendor)
- free((char *) gc->vendor);
- if (gc->renderer)
- free((char *) gc->renderer);
- if (gc->version)
- free((char *) gc->version);
- if (gc->extensions)
- free((char *) gc->extensions);
+ free((char *) gc->vendor);
+ free((char *) gc->renderer);
+ free((char *) gc->version);
+ free((char *) gc->extensions);
__glFreeAttributeState(gc);
free((char *) gc->buf);
free((char *) gc->client_state_private);
struct array_state_vector *arrays = state->array_state;
if (arrays) {
- if (arrays->stack) {
- free(arrays->stack);
- arrays->stack = NULL;
- }
- if (arrays->arrays) {
- free(arrays->arrays);
- arrays->arrays = NULL;
- }
+ free(arrays->stack);
+ arrays->stack = NULL;
+ free(arrays->arrays);
+ arrays->arrays = NULL;
free(arrays);
state->array_state = NULL;
}
XML_ParserFree (p);
}
- if (filenames[1])
- free(filenames[1]);
+ free(filenames[1]);
}
void driDestroyOptionInfo (driOptionCache *info) {
for (i = 0; i < size; ++i) {
if (info->info[i].name) {
free(info->info[i].name);
- if (info->info[i].ranges)
- free(info->info[i].ranges);
+ free(info->info[i].ranges);
}
}
free(info->info);
}
void driDestroyOptionCache (driOptionCache *cache) {
- if (cache->values)
- free(cache->values);
+ free(cache->values);
}
GLboolean driCheckOption (const driOptionCache *cache, const char *name,
return intel_buffer_purgeable(intel_obj->buffer);
if (option == GL_RELEASED_APPLE) {
- if (intel_obj->sys_buffer != NULL) {
- free(intel_obj->sys_buffer);
- intel_obj->sys_buffer = NULL;
- }
+ free(intel_obj->sys_buffer);
+ intel_obj->sys_buffer = NULL;
return GL_RELEASED_APPLE;
} else {
intelImage->base.Buffer = NULL;
}
- if (intelImage->base.ImageOffsets) {
- free(intelImage->base.ImageOffsets);
- intelImage->base.ImageOffsets = NULL;
- }
+ free(intelImage->base.ImageOffsets);
+ intelImage->base.ImageOffsets = NULL;
}
/**
foreach(atom, &radeon->hw.atomlist) {
free(atom->cmd);
- if (atom->lastcmd)
- free(atom->lastcmd);
+ free(atom->lastcmd);
}
}
image->base.Buffer = NULL;
}
- if (image->base.ImageOffsets) {
- free(image->base.ImageOffsets);
- image->base.ImageOffsets = NULL;
- }
+ free(image->base.ImageOffsets);
+ image->base.ImageOffsets = NULL;
}
/* Set Data pointer and additional data for mapped texture image */
if (deepvis==NULL || vislist->depth > deepest) {
/* YES! found a satisfactory visual */
- if (deepvis) {
- free(deepvis);
- }
+ free(deepvis);
deepest = vislist->depth;
deepvis = vislist;
/* DEBUG tt = ov->transparent_type;*/
{
GLuint i;
for (i = 0; i < MAX_NUM_PASSES_ATI; i++) {
- if (s->Instructions[i])
- free(s->Instructions[i]);
- if (s->SetupInst[i])
- free(s->SetupInst[i]);
+ free(s->Instructions[i]);
+ free(s->SetupInst[i]);
}
free(s);
}
(or, could use the same mem but would need to reinitialize) */
/* no idea if it's allowed to redefine a shader */
for (i = 0; i < MAX_NUM_PASSES_ATI; i++) {
- if (ctx->ATIFragmentShader.Current->Instructions[i])
- free(ctx->ATIFragmentShader.Current->Instructions[i]);
- if (ctx->ATIFragmentShader.Current->SetupInst[i])
- free(ctx->ATIFragmentShader.Current->SetupInst[i]);
+ free(ctx->ATIFragmentShader.Current->Instructions[i]);
+ free(ctx->ATIFragmentShader.Current->SetupInst[i]);
}
/* malloc the instructions here - not sure if the best place but its
{
(void) ctx;
- if (bufObj->Data)
- free(bufObj->Data);
+ free(bufObj->Data);
/* assign strange values here to help w/ debugging */
bufObj->RefCount = -1000;
_mesa_free_errors_data(ctx);
- if (ctx->Extensions.String)
- free((void *) ctx->Extensions.String);
+ free((void *)ctx->Extensions.String);
- if (ctx->VersionString)
- free(ctx->VersionString);
+ free(ctx->VersionString);
/* unbind the context if it's currently bound */
if (ctx == _mesa_get_current_context()) {
void *newBuffer = malloc(newSize);
if (newBuffer && oldBuffer && copySize > 0)
memcpy(newBuffer, oldBuffer, copySize);
- if (oldBuffer)
- free(oldBuffer);
+ free(oldBuffer);
return newBuffer;
}
return;
/* free old shader source string and install new one */
- if (sh->Source) {
- free((void *) sh->Source);
- }
+ free((void *)sh->Source);
sh->Source = source;
sh->CompileStatus = GL_FALSE;
#ifdef DEBUG
static void
_mesa_delete_shader(struct gl_context *ctx, struct gl_shader *sh)
{
- if (sh->Source)
- free((void *) sh->Source);
+ free((void *)sh->Source);
_mesa_reference_program(ctx, &sh->Program, NULL);
ralloc_free(sh);
}
}
shProg->NumShaders = 0;
- if (shProg->Shaders) {
- free(shProg->Shaders);
- shProg->Shaders = NULL;
- }
+ free(shProg->Shaders);
+ shProg->Shaders = NULL;
/* Transform feedback varying vars */
for (i = 0; i < shProg->TransformFeedback.NumVarying; i++) {
_mesa_TexImage2D(target, lvl, info->format, w, h, 0,
info->format, info->type, image);
- if (image)
- free(image);
+ free(image);
/* advance index pointer to point to next src mipmap */
if (info->palette_size == 16)
}
cleanUp:
- if (newSource != NULL) {
- free(newSource);
- }
+ free(newSource);
}
return;
}
- if (program->Base.String != NULL)
- free(program->Base.String);
+ free(program->Base.String);
/* Copy the relevant contents of the arb_program struct into the
* fragment_program struct.
program->UsesKill = state.fragment.UsesKill;
program->UsesDFdy = state.fragment.UsesDFdy;
- if (program->Base.Instructions)
- free(program->Base.Instructions);
+ free(program->Base.Instructions);
program->Base.Instructions = prog.Instructions;
if (program->Base.Parameters)
return;
}
- if (program->Base.String != NULL)
- free(program->Base.String);
+ free(program->Base.String);
/* Copy the relevant contents of the arb_program struct into the
* vertex_program struct.
program->IsPositionInvariant = (state.option.PositionInvariant)
? GL_TRUE : GL_FALSE;
- if (program->Base.Instructions)
- free(program->Base.Instructions);
+ free(program->Base.Instructions);
program->Base.Instructions = prog.Instructions;
if (program->Base.Parameters)
/* install the program */
program->Base.Target = target;
- if (program->Base.String) {
- free(program->Base.String);
- }
+ free(program->Base.String);
program->Base.String = programString;
program->Base.Format = GL_PROGRAM_FORMAT_ASCII_ARB;
- if (program->Base.Instructions) {
- free(program->Base.Instructions);
- }
+ free(program->Base.Instructions);
program->Base.Instructions = newInst;
program->Base.NumInstructions = parseState.numInst;
program->Base.InputsRead = parseState.inputsRead;
/* install the program */
program->Base.Target = target;
- if (program->Base.String) {
- free(program->Base.String);
- }
+ free(program->Base.String);
program->Base.String = programString;
program->Base.Format = GL_PROGRAM_FORMAT_ASCII_ARB;
- if (program->Base.Instructions) {
- free(program->Base.Instructions);
- }
+ free(program->Base.Instructions);
program->Base.Instructions = newInst;
program->Base.InputsRead = parseState.inputsRead;
if (parseState.isPositionInvariant)
{
GLuint i;
for (i = 0; i < count; i++) {
- if (inst[i].Data)
- free(inst[i].Data);
- if (inst[i].Comment)
- free((char *) inst[i].Comment);
+ free(inst[i].Data);
+ free((char *)inst[i].Comment);
}
free(inst);
}
{
GLuint i;
for (i = 0; i < paramList->NumParameters; i++) {
- if (paramList->Parameters[i].Name)
- free((void *) paramList->Parameters[i].Name);
+ free((void *)paramList->Parameters[i].Name);
}
free(paramList->Parameters);
if (paramList->ParameterValues)
if (prog == &_mesa_DummyProgram)
return;
- if (prog->String)
- free(prog->String);
+ free(prog->String);
if (prog->Instructions) {
_mesa_free_instructions(prog->Instructions, prog->NumInstructions);
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexSubImage");
}
- if (tempSrc)
- free(tempSrc);
+ free(tempSrc);
}
st_texture_image_unmap(st, stImage);
}
free( swrast->SpanArrays );
- if (swrast->ZoomedArrays)
- free( swrast->ZoomedArrays );
+ free( swrast->ZoomedArrays );
free( swrast->TexelBuffer );
free(swrast->stencil_temp.buf1);
span.array->ChanType = CHAN_TYPE;
}
- if (convImage) {
- free(convImage);
- }
+ free(convImage);
swrast_render_finish(ctx);
}
bpp = _mesa_get_format_bytes(rb->Format);
/* free old buffer storage */
- if (srb->Buffer) {
- free(srb->Buffer);
- srb->Buffer = NULL;
- }
+ free(srb->Buffer);
+ srb->Buffer = NULL;
srb->RowStride = width * bpp;
{
struct swrast_renderbuffer *srb = swrast_renderbuffer(rb);
- if (srb->Buffer) {
- free(srb->Buffer);
- srb->Buffer = NULL;
- }
+ free(srb->Buffer);
+ srb->Buffer = NULL;
_mesa_delete_renderbuffer(rb);
}
swImage->Buffer = NULL;
}
- if (swImage->ImageOffsets) {
- free(swImage->ImageOffsets);
- swImage->ImageOffsets = NULL;
- }
+ free(swImage->ImageOffsets);
+ swImage->ImageOffsets = NULL;
}
_mesa_vector4f_free( &store->texcoord[i] );
- if (store->tmp_f) free( store->tmp_f );
- if (store->tmp_m) free( store->tmp_m );
+ free( store->tmp_f );
+ free( store->tmp_m );
free( store );
stage->privatePtr = NULL;
}
}
}
- if (sub_prims) {
- free(sub_prims);
- }
+ free(sub_prims);
}
ctx->Array._DrawArrays = saved_arrays;
ctx->NewDriverState |= ctx->DriverFlags.NewArray;
- if (tmp_indices)
- free(tmp_indices);
+ free(tmp_indices);
- if (tmp_prims)
- free(tmp_prims);
+ free(tmp_prims);
}
if (--node->prim_store->refcount == 0)
free(node->prim_store);
- if (node->current_data) {
- free(node->current_data);
- node->current_data = NULL;
- }
+ free(node->current_data);
+ node->current_data = NULL;
}