shader->in_prim_idx = 0;
shader->input_vertex_stride = input_stride;
shader->input = input;
- if (shader->primitive_lengths) {
- FREE(shader->primitive_lengths);
- }
+ FREE(shader->primitive_lengths);
shader->primitive_lengths = MALLOC(max_out_prims * sizeof(unsigned));
tgsi_exec_set_constant_buffers(machine, PIPE_MAX_CONSTANT_BUFFERS,
u_mmDestroy(mm->heap);
if(mm->map)
pb_unmap(mm->buffer);
- if(mm)
- FREE(mm);
+ FREE(mm);
return NULL;
}
return SUPER(pool);
failure:
- if(pool->bufs)
- FREE(pool->bufs);
+ FREE(pool->bufs);
if(pool->map)
pb_unmap(pool->buffer);
if(pool->buffer)
pb_reference(&pool->buffer, NULL);
- if(pool)
- FREE(pool);
+ FREE(pool);
return NULL;
}
if (!tokens) {
/* unbind and free all */
- if (mach->Declarations) {
- FREE( mach->Declarations );
- }
+ FREE(mach->Declarations);
mach->Declarations = NULL;
mach->NumDeclarations = 0;
- if (mach->Instructions) {
- FREE( mach->Instructions );
- }
+ FREE(mach->Instructions);
mach->Instructions = NULL;
mach->NumInstructions = 0;
}
tgsi_parse_free (&parse);
- if (mach->Declarations) {
- FREE( mach->Declarations );
- }
+ FREE(mach->Declarations);
mach->Declarations = declarations;
mach->NumDeclarations = numDeclarations;
- if (mach->Instructions) {
- FREE( mach->Instructions );
- }
+ FREE(mach->Instructions);
mach->Instructions = instructions;
mach->NumInstructions = numInstructions;
}
tgsi_exec_machine_destroy(struct tgsi_exec_machine *mach)
{
if (mach) {
- if (mach->Instructions)
- FREE(mach->Instructions);
- if (mach->Declarations)
- FREE(mach->Declarations);
+ FREE(mach->Instructions);
+ FREE(mach->Declarations);
align_free(mach->Inputs);
align_free(mach->Outputs);
if (vbuf)
pipe_resource_reference(&vbuf, NULL);
- if (v)
- FREE(v);
+ FREE(v);
}
src_row += src_step;
}
- if (tmp_s) {
- FREE(tmp_s);
- }
+ FREE(tmp_s);
- if (tmp_z) {
- FREE(tmp_z);
- }
+ FREE(tmp_z);
return;
}
iws->buffer_destroy(iws, tex->buffer);
for (i = 0; i < Elements(tex->image_offset); i++)
- if (tex->image_offset[i])
- FREE(tex->image_offset[i]);
+ FREE(tex->image_offset[i]);
FREE(tex);
}
{
struct i915_fragment_shader *ifs = (struct i915_fragment_shader *) shader;
- if (ifs->decl) {
- FREE(ifs->decl);
- ifs->decl = NULL;
- }
+ FREE(ifs->decl);
+ ifs->decl = NULL;
if (ifs->program) {
FREE(ifs->program);
FREE((struct tgsi_token *)ifs->state.tokens);
ifs->state.tokens = NULL;
}
+
ifs->program_len = 0;
ifs->decl_len = 0;
fail:
for (level = 0; level <= pt->last_level; level++) {
- if (lpr->layout[level]) {
- FREE(lpr->layout[level]);
- }
+ FREE(lpr->layout[level]);
}
return FALSE;
return TRUE;
out_err:
- if (fpc->r_temp) {
- FREE(fpc->r_temp);
- fpc->r_temp = NULL;
- }
+ FREE(fpc->r_temp);
+ fpc->r_temp = NULL;
+
tgsi_parse_free(&p);
return FALSE;
}
tgsi_parse_free(&parse);
if(fpc)
{
- if (fpc->r_temp)
- FREE(fpc->r_temp);
+ FREE(fpc->r_temp);
util_dynarray_fini(&fpc->if_stack);
util_dynarray_fini(&fpc->label_relocs);
util_dynarray_fini(&fpc->imm_data);
NOUVEAU_ERR("shader translation failed: %i\n", ret);
goto out;
}
- if (info->bin.syms) /* we don't need them yet */
- FREE(info->bin.syms);
+ FREE(info->bin.syms);
prog->code = info->bin.code;
prog->code_size = info->bin.codeSize;
if (p->mem)
nouveau_heap_free(&p->mem);
- if (p->code)
- FREE(p->code);
+ FREE(p->code);
- if (p->fixups)
- FREE(p->fixups);
+ FREE(p->fixups);
- if (p->so)
- FREE(p->so);
+ FREE(p->so);
memset(p, 0, sizeof(*p));
if (screen->base.pushbuf)
screen->base.pushbuf->user_priv = NULL;
- if (screen->blitctx)
- FREE(screen->blitctx);
+ FREE(screen->blitctx);
nouveau_bo_ref(NULL, &screen->code);
nouveau_bo_ref(NULL, &screen->tls_bo);
nouveau_heap_destroy(&screen->gp_code_heap);
nouveau_heap_destroy(&screen->fp_code_heap);
- if (screen->tic.entries)
- FREE(screen->tic.entries);
+ FREE(screen->tic.entries);
nouveau_object_del(&screen->tesla);
nouveau_object_del(&screen->eng2d);
NOUVEAU_ERR("shader translation failed: %i\n", ret);
goto out;
}
- if (info->bin.syms) /* we don't need them yet */
- FREE(info->bin.syms);
+ FREE(info->bin.syms);
prog->code = info->bin.code;
prog->code_size = info->bin.codeSize;
if (prog->mem)
nouveau_heap_free(&prog->mem);
- if (prog->code)
- FREE(prog->code);
- if (prog->immd_data)
- FREE(prog->immd_data);
- if (prog->relocs)
- FREE(prog->relocs);
+ FREE(prog->code);
+ FREE(prog->immd_data);
+ FREE(prog->relocs);
if (prog->tfb) {
if (nvc0->state.tfb == prog->tfb)
nvc0->state.tfb = NULL;
if (screen->base.pushbuf)
screen->base.pushbuf->user_priv = NULL;
- if (screen->blitctx)
- FREE(screen->blitctx);
+ FREE(screen->blitctx);
nouveau_bo_ref(NULL, &screen->text);
nouveau_bo_ref(NULL, &screen->uniform_bo);
nouveau_heap_destroy(&screen->lib_code);
nouveau_heap_destroy(&screen->text_heap);
- if (screen->tic.entries)
- FREE(screen->tic.entries);
+ FREE(screen->tic.entries);
nouveau_mm_destroy(screen->mm_VRAM_fe0);
{
struct r300_resource *rbuf = r300_resource(buf);
- if (rbuf->malloced_buffer)
- FREE(rbuf->malloced_buffer);
+ FREE(rbuf->malloced_buffer);
if (rbuf->buf)
pb_reference(&rbuf->buf, NULL);
if (r300->screen->caps.has_tcl) {
rc_constants_destroy(&vs->code.constants);
- if (vs->code.constants_remap_table)
- FREE(vs->code.constants_remap_table);
+ FREE(vs->code.constants_remap_table);
} else {
draw_delete_vertex_shader(r300->draw,
(struct draw_vertex_shader*)vs->draw_vs);
native_connectors =
gdpy->native->modeset->get_connectors(gdpy->native, &num_connectors, NULL);
if (!num_connectors) {
- if (native_connectors)
- FREE(native_connectors);
+ FREE(native_connectors);
return;
}
native_modes =
gdpy->native->modeset->get_modes(gdpy->native, nconn, &num_modes);
if (!num_modes) {
- if (native_modes)
- FREE(native_modes);
+ FREE(native_modes);
continue;
}
native_configs = gdpy->native->get_configs(gdpy->native, &num_configs);
if (!num_configs) {
- if (native_configs)
- FREE(native_configs);
+ FREE(native_configs);
return id;
}
FREE(drmdpy->connectors);
}
- if (drmdpy->shown_surfaces) {
- FREE(drmdpy->shown_surfaces);
- drmdpy->shown_surfaces = NULL;
- }
+ FREE(drmdpy->shown_surfaces);
+ drmdpy->shown_surfaces = NULL;
if (drmdpy->saved_crtcs) {
for (i = 0; i < drmdpy->resources->count_crtcs; i++) {
{
struct drm_display *drmdpy = drm_display(ndpy);
- if (drmdpy->config)
- FREE(drmdpy->config);
+ FREE(drmdpy->config);
drm_display_fini_modeset(&drmdpy->base);
ndpy->screen = NULL;
ndpy_uninit(ndpy);
- if (drmdpy->device_name)
- FREE(drmdpy->device_name);
+ FREE(drmdpy->device_name);
if (drmdpy->own_gbm) {
gbm_device_destroy(&drmdpy->gbmdrm->base.base);
{
struct gdi_display *gdpy = gdi_display(ndpy);
- if (gdpy->configs)
- FREE(gdpy->configs);
+ FREE(gdpy->configs);
ndpy_uninit(ndpy);
if (drmdpy->wl_drm)
wl_drm_destroy(drmdpy->wl_drm);
- if (drmdpy->device_name)
- FREE(drmdpy->device_name);
- if (drmdpy->base.configs)
- FREE(drmdpy->base.configs);
+ FREE(drmdpy->device_name);
+ FREE(drmdpy->base.configs);
if (drmdpy->base.own_dpy)
wl_display_disconnect(drmdpy->base.dpy);
{
struct wayland_shm_display *shmdpy = wayland_shm_display(ndpy);
- if (shmdpy->base.configs)
- FREE(shmdpy->base.configs);
+ FREE(shmdpy->base.configs);
if (shmdpy->base.own_dpy)
wl_display_disconnect(shmdpy->base.dpy);
dri2surf->server_stamp++;
dri2surf->client_stamp = dri2surf->server_stamp;
- if (dri2surf->last_xbufs)
- FREE(dri2surf->last_xbufs);
+ FREE(dri2surf->last_xbufs);
dri2surf->last_xbufs = xbufs;
dri2surf->last_num_xbufs = num_outs;
}
struct dri2_surface *dri2surf = dri2_surface(nsurf);
int i;
- if (dri2surf->last_xbufs)
- FREE(dri2surf->last_xbufs);
+ FREE(dri2surf->last_xbufs);
for (i = 0; i < NUM_NATIVE_ATTACHMENTS; i++) {
struct pipe_resource *ptex = dri2surf->textures[i];
{
struct dri2_display *dri2dpy = dri2_display(ndpy);
- if (dri2dpy->configs)
- FREE(dri2dpy->configs);
+ FREE(dri2dpy->configs);
if (dri2dpy->base.screen)
dri2dpy->base.screen->destroy(dri2dpy->base.screen);
{
struct ximage_display *xdpy = ximage_display(ndpy);
- if (xdpy->configs)
- FREE(xdpy->configs);
+ FREE(xdpy->configs);
ndpy_uninit(ndpy);
glyph = (struct vg_glyph *)
cso_hash_take(font->glyphs, (unsigned) glyphIndex);
- if (glyph)
- FREE(glyph);
+ FREE(glyph);
return (glyph != NULL);
}
return TRUE;
error1:
- if (stw_dev->smapi)
- FREE(stw_dev->smapi);
+ FREE(stw_dev->smapi);
if (stw_dev->stapi)
stw_dev->stapi->destroy(stw_dev->stapi);
if (screen)
screen->destroy(screen);
- if (xlib_handle)
- FREE(xlib_handle);
+ FREE(xlib_handle);
free(visinfo);
{
struct dri_sw_displaytarget *dri_sw_dt = dri_sw_displaytarget(dt);
- if (dri_sw_dt->data) {
- FREE(dri_sw_dt->data);
- }
+ FREE(dri_sw_dt->data);
FREE(dri_sw_dt);
}