mesa: s/FREE/free/

v2: replace instances in dri/common/ dirs

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
Brian Paul
2012-09-01 07:47:24 -06:00
parent 4fdac659f8
commit fe72a069d1
49 changed files with 143 additions and 143 deletions

View File

@@ -159,7 +159,7 @@ dri_create_context(gl_api api, const struct gl_config * visual,
if (ctx && ctx->st) if (ctx && ctx->st)
ctx->st->destroy(ctx->st); ctx->st->destroy(ctx->st);
FREE(ctx); free(ctx);
return GL_FALSE; return GL_FALSE;
} }
@@ -172,7 +172,7 @@ dri_destroy_context(__DRIcontext * cPriv)
* driParseConfigFiles allocated values only - the rest * driParseConfigFiles allocated values only - the rest
* is owned by screen optionCache. * is owned by screen optionCache.
*/ */
FREE(ctx->optionCache.values); free(ctx->optionCache.values);
/* No particular reason to wait for command completion before /* No particular reason to wait for command completion before
* destroying a context, but we flush the context here * destroying a context, but we flush the context here
@@ -184,7 +184,7 @@ dri_destroy_context(__DRIcontext * cPriv)
if (ctx->pp) pp_free(ctx->pp); if (ctx->pp) pp_free(ctx->pp);
FREE(ctx); free(ctx);
} }
GLboolean GLboolean

View File

@@ -355,13 +355,13 @@ dri_destroy_option_cache(struct dri_screen * screen)
if (screen->optionCache.info) { if (screen->optionCache.info) {
for (i = 0; i < (1 << screen->optionCache.tableSize); ++i) { for (i = 0; i < (1 << screen->optionCache.tableSize); ++i) {
FREE(screen->optionCache.info[i].name); free(screen->optionCache.info[i].name);
FREE(screen->optionCache.info[i].ranges); free(screen->optionCache.info[i].ranges);
} }
FREE(screen->optionCache.info); free(screen->optionCache.info);
} }
FREE(screen->optionCache.values); free(screen->optionCache.values);
} }
void void
@@ -383,7 +383,7 @@ dri_destroy_screen(__DRIscreen * sPriv)
dri_destroy_screen_helper(screen); dri_destroy_screen_helper(screen);
FREE(screen); free(screen);
sPriv->driverPrivate = NULL; sPriv->driverPrivate = NULL;
sPriv->extensions = NULL; sPriv->extensions = NULL;
} }

View File

@@ -357,7 +357,7 @@ glXUseXFont(Font font, int first, int count, int listbase)
glEndList(); glEndList();
} }
FREE(bm); free(bm);
XFreeFontInfo(NULL, fs, 1); XFreeFontInfo(NULL, fs, 1);
XFreeGC(dpy, gc); XFreeGC(dpy, gc);

View File

@@ -169,7 +169,7 @@ xmesa_init_display( Display *display )
xmdpy->screen = NULL; xmdpy->screen = NULL;
} }
if (xmdpy->smapi) { if (xmdpy->smapi) {
FREE(xmdpy->smapi); free(xmdpy->smapi);
xmdpy->smapi = NULL; xmdpy->smapi = NULL;
} }
@@ -800,8 +800,8 @@ XMesaVisual XMesaCreateVisual( Display *display,
v->stvis.color_format = choose_pixel_format(v); v->stvis.color_format = choose_pixel_format(v);
if (v->stvis.color_format == PIPE_FORMAT_NONE) { if (v->stvis.color_format == PIPE_FORMAT_NONE) {
FREE(v->visinfo); free(v->visinfo);
FREE(v); free(v);
return NULL; return NULL;
} }

View File

@@ -279,9 +279,9 @@ xmesa_create_st_framebuffer(XMesaDisplay xmdpy, XMesaBuffer b)
xstfb = CALLOC_STRUCT(xmesa_st_framebuffer); xstfb = CALLOC_STRUCT(xmesa_st_framebuffer);
if (!stfbi || !xstfb) { if (!stfbi || !xstfb) {
if (stfbi) if (stfbi)
FREE(stfbi); free(stfbi);
if (xstfb) if (xstfb)
FREE(xstfb); free(xstfb);
return NULL; return NULL;
} }
@@ -314,8 +314,8 @@ xmesa_destroy_st_framebuffer(struct st_framebuffer_iface *stfbi)
for (i = 0; i < ST_ATTACHMENT_COUNT; i++) for (i = 0; i < ST_ATTACHMENT_COUNT; i++)
pipe_resource_reference(&xstfb->textures[i], NULL); pipe_resource_reference(&xstfb->textures[i], NULL);
FREE(xstfb); free(xstfb);
FREE(stfbi); free(stfbi);
} }
void void

View File

@@ -68,7 +68,7 @@ driCreateNewScreen(int scrn, const __DRIextension **extensions,
*driver_configs = driDriverAPI.InitScreen(psp); *driver_configs = driDriverAPI.InitScreen(psp);
if (*driver_configs == NULL) { if (*driver_configs == NULL) {
FREE(psp); free(psp);
return NULL; return NULL;
} }
@@ -79,7 +79,7 @@ static void driDestroyScreen(__DRIscreen *psp)
{ {
if (psp) { if (psp) {
driDriverAPI.DestroyScreen(psp); driDriverAPI.DestroyScreen(psp);
FREE(psp); free(psp);
} }
} }
@@ -178,7 +178,7 @@ driCreateContextAttribs(__DRIscreen *screen, int api,
if (!driDriverAPI.CreateContext(mesa_api, modes, pcp, if (!driDriverAPI.CreateContext(mesa_api, modes, pcp,
major_version, minor_version, major_version, minor_version,
flags, error, shareCtx)) { flags, error, shareCtx)) {
FREE(pcp); free(pcp);
return NULL; return NULL;
} }
@@ -209,7 +209,7 @@ driDestroyContext(__DRIcontext *pcp)
{ {
if (pcp) { if (pcp) {
driDriverAPI.DestroyContext(pcp); driDriverAPI.DestroyContext(pcp);
FREE(pcp); free(pcp);
} }
} }
@@ -289,7 +289,7 @@ static void dri_put_drawable(__DRIdrawable *pdp)
return; return;
driDriverAPI.DestroyBuffer(pdp); driDriverAPI.DestroyBuffer(pdp);
FREE(pdp); free(pdp);
} }
} }
@@ -311,7 +311,7 @@ driCreateNewDrawable(__DRIscreen *psp,
dri_get_drawable(pdp); dri_get_drawable(pdp);
if (!driDriverAPI.CreateBuffer(psp, pdp, &config->modes, GL_FALSE)) { if (!driDriverAPI.CreateBuffer(psp, pdp, &config->modes, GL_FALSE)) {
FREE(pdp); free(pdp);
return NULL; return NULL;
} }

View File

@@ -382,9 +382,9 @@ static GLboolean parseRanges (driOptionInfo *info, const XML_Char *string) {
else else
range = NULL; range = NULL;
} }
FREE (cp); free(cp);
if (i < nRanges) { if (i < nRanges) {
FREE (ranges); free(ranges);
return GL_FALSE; return GL_FALSE;
} else } else
assert (range == NULL); assert (range == NULL);
@@ -990,7 +990,7 @@ void driParseConfigFiles (driOptionCache *cache, const driOptionCache *info,
} }
if (filenames[1]) if (filenames[1])
FREE (filenames[1]); free(filenames[1]);
} }
void driDestroyOptionInfo (driOptionCache *info) { void driDestroyOptionInfo (driOptionCache *info) {
@@ -999,18 +999,18 @@ void driDestroyOptionInfo (driOptionCache *info) {
GLuint i, size = 1 << info->tableSize; GLuint i, size = 1 << info->tableSize;
for (i = 0; i < size; ++i) { for (i = 0; i < size; ++i) {
if (info->info[i].name) { if (info->info[i].name) {
FREE (info->info[i].name); free(info->info[i].name);
if (info->info[i].ranges) if (info->info[i].ranges)
FREE (info->info[i].ranges); free(info->info[i].ranges);
} }
} }
FREE (info->info); free(info->info);
} }
} }
void driDestroyOptionCache (driOptionCache *cache) { void driDestroyOptionCache (driOptionCache *cache) {
if (cache->values) if (cache->values)
FREE (cache->values); free(cache->values);
} }
GLboolean driCheckOption (const driOptionCache *cache, const char *name, GLboolean driCheckOption (const driOptionCache *cache, const char *name,

View File

@@ -65,7 +65,7 @@ i830CreateContext(const struct gl_config * mesaVis,
if (!intelInitContext(intel, __DRI_API_OPENGL, mesaVis, driContextPriv, if (!intelInitContext(intel, __DRI_API_OPENGL, mesaVis, driContextPriv,
sharedContextPrivate, &functions)) { sharedContextPrivate, &functions)) {
FREE(i830); free(i830);
return false; return false;
} }

View File

@@ -167,7 +167,7 @@ i915CreateContext(int api,
if (!intelInitContext(intel, api, mesaVis, driContextPriv, if (!intelInitContext(intel, api, mesaVis, driContextPriv,
sharedContextPrivate, &functions)) { sharedContextPrivate, &functions)) {
FREE(i915); free(i915);
*error = __DRI_CTX_ERROR_NO_MEMORY; *error = __DRI_CTX_ERROR_NO_MEMORY;
return false; return false;
} }
@@ -184,7 +184,7 @@ i915CreateContext(int api,
if (req_version > max_version) { if (req_version > max_version) {
*error = __DRI_CTX_ERROR_BAD_VERSION; *error = __DRI_CTX_ERROR_BAD_VERSION;
FREE(i915); free(i915);
return false; return false;
} }
break; break;
@@ -194,7 +194,7 @@ i915CreateContext(int api,
break; break;
default: default:
*error = __DRI_CTX_ERROR_BAD_API; *error = __DRI_CTX_ERROR_BAD_API;
FREE(i915); free(i915);
return false; return false;
} }

View File

@@ -148,7 +148,7 @@ brwCreateContext(int api,
if (!intelInitContext( intel, api, mesaVis, driContextPriv, if (!intelInitContext( intel, api, mesaVis, driContextPriv,
sharedContextPrivate, &functions )) { sharedContextPrivate, &functions )) {
printf("%s: failed to init intel context\n", __FUNCTION__); printf("%s: failed to init intel context\n", __FUNCTION__);
FREE(brw); free(brw);
*error = __DRI_CTX_ERROR_NO_MEMORY; *error = __DRI_CTX_ERROR_NO_MEMORY;
return false; return false;
} }

View File

@@ -120,7 +120,7 @@ rehash(struct brw_cache *cache)
items[c->hash % size] = c; items[c->hash % size] = c;
} }
FREE(cache->items); free(cache->items);
cache->items = items; cache->items = items;
cache->size = size; cache->size = size;
} }

View File

@@ -309,7 +309,7 @@ intel_create_image_from_name(__DRIscreen *screen,
cpp, width, height, cpp, width, height,
pitch, name, "image"); pitch, name, "image");
if (image->region == NULL) { if (image->region == NULL) {
FREE(image); free(image);
return NULL; return NULL;
} }
@@ -371,7 +371,7 @@ static void
intel_destroy_image(__DRIimage *image) intel_destroy_image(__DRIimage *image)
{ {
intel_region_release(&image->region); intel_region_release(&image->region);
FREE(image); free(image);
} }
static __DRIimage * static __DRIimage *
@@ -397,7 +397,7 @@ intel_create_image(__DRIscreen *screen,
image->region = image->region =
intel_region_alloc(intelScreen, tiling, cpp, width, height, true); intel_region_alloc(intelScreen, tiling, cpp, width, height, true);
if (image->region == NULL) { if (image->region == NULL) {
FREE(image); free(image);
return NULL; return NULL;
} }
@@ -446,7 +446,7 @@ intel_dup_image(__DRIimage *orig_image, void *loaderPrivate)
intel_region_reference(&image->region, orig_image->region); intel_region_reference(&image->region, orig_image->region);
if (image->region == NULL) { if (image->region == NULL) {
FREE(image); free(image);
return NULL; return NULL;
} }
@@ -543,13 +543,13 @@ intel_from_planar(__DRIimage *parent, int plane, void *loaderPrivate)
pitch = stride / cpp; pitch = stride / cpp;
if (offset + height * cpp * pitch > parent->region->bo->size) { if (offset + height * cpp * pitch > parent->region->bo->size) {
_mesa_warning(NULL, "intel_create_sub_image: subimage out of bounds"); _mesa_warning(NULL, "intel_create_sub_image: subimage out of bounds");
FREE(image); free(image);
return NULL; return NULL;
} }
image->region = calloc(sizeof(*image->region), 1); image->region = calloc(sizeof(*image->region), 1);
if (image->region == NULL) { if (image->region == NULL) {
FREE(image); free(image);
return NULL; return NULL;
} }
@@ -639,7 +639,7 @@ intelDestroyScreen(__DRIscreen * sPriv)
_mesa_HashDeleteAll(intelScreen->named_regions, nop_callback, NULL); _mesa_HashDeleteAll(intelScreen->named_regions, nop_callback, NULL);
_mesa_DeleteHashTable(intelScreen->named_regions); _mesa_DeleteHashTable(intelScreen->named_regions);
FREE(intelScreen); free(intelScreen);
sPriv->driverPrivate = NULL; sPriv->driverPrivate = NULL;
} }
@@ -1156,7 +1156,7 @@ intelAllocateBuffer(__DRIscreen *screen,
true); true);
if (intelBuffer->region == NULL) { if (intelBuffer->region == NULL) {
FREE(intelBuffer); free(intelBuffer);
return NULL; return NULL;
} }

View File

@@ -67,8 +67,8 @@ nouveau_bufferobj_del(struct gl_context *ctx, struct gl_buffer_object *obj)
struct nouveau_bufferobj *nbo = to_nouveau_bufferobj(obj); struct nouveau_bufferobj *nbo = to_nouveau_bufferobj(obj);
nouveau_bo_ref(NULL, &nbo->bo); nouveau_bo_ref(NULL, &nbo->bo);
FREE(nbo->sys); free(nbo->sys);
FREE(nbo); free(nbo);
} }
static GLboolean static GLboolean
@@ -84,7 +84,7 @@ nouveau_bufferobj_data(struct gl_context *ctx, GLenum target, GLsizeiptrARB size
/* Free previous storage */ /* Free previous storage */
nouveau_bo_ref(NULL, &nbo->bo); nouveau_bo_ref(NULL, &nbo->bo);
FREE(nbo->sys); free(nbo->sys);
if (target == GL_ELEMENT_ARRAY_BUFFER_ARB || if (target == GL_ELEMENT_ARRAY_BUFFER_ARB ||
(size < 512 && usage == GL_DYNAMIC_DRAW_ARB) || (size < 512 && usage == GL_DYNAMIC_DRAW_ARB) ||

View File

@@ -144,7 +144,7 @@ nouveau_destroy_screen(__DRIscreen *dri_screen)
nouveau_device_del(&screen->device); nouveau_device_del(&screen->device);
FREE(screen); free(screen);
dri_screen->driverPrivate = NULL; dri_screen->driverPrivate = NULL;
} }

View File

@@ -134,7 +134,7 @@ nv04_context_destroy(struct gl_context *ctx)
nouveau_object_del(&nctx->hw.surf3d); nouveau_object_del(&nctx->hw.surf3d);
nouveau_context_deinit(ctx); nouveau_context_deinit(ctx);
FREE(ctx); free(ctx);
} }
static struct gl_context * static struct gl_context *

View File

@@ -423,7 +423,7 @@ nv10_context_destroy(struct gl_context *ctx)
nouveau_object_del(&nctx->hw.eng3d); nouveau_object_del(&nctx->hw.eng3d);
nouveau_context_deinit(ctx); nouveau_context_deinit(ctx);
FREE(ctx); free(ctx);
} }
static struct gl_context * static struct gl_context *

View File

@@ -434,7 +434,7 @@ nv20_context_destroy(struct gl_context *ctx)
nouveau_object_del(&nctx->hw.eng3d); nouveau_object_del(&nctx->hw.eng3d);
nouveau_context_deinit(ctx); nouveau_context_deinit(ctx);
FREE(ctx); free(ctx);
} }
static struct gl_context * static struct gl_context *

View File

@@ -281,7 +281,7 @@ GLboolean r200CreateContext( gl_api api,
if (!radeonInitContext(&rmesa->radeon, &functions, if (!radeonInitContext(&rmesa->radeon, &functions,
glVisual, driContextPriv, glVisual, driContextPriv,
sharedContextPrivate)) { sharedContextPrivate)) {
FREE(rmesa); free(rmesa);
*error = __DRI_CTX_ERROR_NO_MEMORY; *error = __DRI_CTX_ERROR_NO_MEMORY;
return GL_FALSE; return GL_FALSE;
} }

View File

@@ -202,9 +202,9 @@ static void radeon_destroy_atom_list(radeonContextPtr radeon)
struct radeon_state_atom *atom; struct radeon_state_atom *atom;
foreach(atom, &radeon->hw.atomlist) { foreach(atom, &radeon->hw.atomlist) {
FREE(atom->cmd); free(atom->cmd);
if (atom->lastcmd) if (atom->lastcmd)
FREE(atom->lastcmd); free(atom->lastcmd);
} }
} }
@@ -267,7 +267,7 @@ void radeonDestroyContext(__DRIcontext *driContextPriv )
fclose(track); fclose(track);
} }
#endif #endif
FREE(radeon); free(radeon);
} }
/* Force the context `c' to be unbound from its buffer. /* Force the context `c' to be unbound from its buffer.

View File

@@ -243,7 +243,7 @@ r100CreateContext( gl_api api,
if (!radeonInitContext(&rmesa->radeon, &functions, if (!radeonInitContext(&rmesa->radeon, &functions,
glVisual, driContextPriv, glVisual, driContextPriv,
sharedContextPrivate)) { sharedContextPrivate)) {
FREE(rmesa); free(rmesa);
*error = __DRI_CTX_ERROR_NO_MEMORY; *error = __DRI_CTX_ERROR_NO_MEMORY;
return GL_FALSE; return GL_FALSE;
} }

View File

@@ -302,19 +302,19 @@ void radeonFreeDmaRegions(radeonContextPtr rmesa)
foreach_s(dma_bo, temp, &rmesa->dma.free) { foreach_s(dma_bo, temp, &rmesa->dma.free) {
remove_from_list(dma_bo); remove_from_list(dma_bo);
radeon_bo_unref(dma_bo->bo); radeon_bo_unref(dma_bo->bo);
FREE(dma_bo); free(dma_bo);
} }
foreach_s(dma_bo, temp, &rmesa->dma.wait) { foreach_s(dma_bo, temp, &rmesa->dma.wait) {
remove_from_list(dma_bo); remove_from_list(dma_bo);
radeon_bo_unref(dma_bo->bo); radeon_bo_unref(dma_bo->bo);
FREE(dma_bo); free(dma_bo);
} }
foreach_s(dma_bo, temp, &rmesa->dma.reserved) { foreach_s(dma_bo, temp, &rmesa->dma.reserved) {
remove_from_list(dma_bo); remove_from_list(dma_bo);
radeon_bo_unref(dma_bo->bo); radeon_bo_unref(dma_bo->bo);
FREE(dma_bo); free(dma_bo);
} }
} }
@@ -344,7 +344,7 @@ void radeonReleaseDmaRegions(radeonContextPtr rmesa)
{ {
struct radeon_dma_bo *dma_bo; struct radeon_dma_bo *dma_bo;
struct radeon_dma_bo *temp; struct radeon_dma_bo *temp;
const int expire_at = ++rmesa->dma.free.expire_counter + DMA_BO_FREE_TIME; const int expire_at = ++rmesa->dma.free.expire_counter + DMA_BO_free_TIME;
const int time = rmesa->dma.free.expire_counter; const int time = rmesa->dma.free.expire_counter;
if (RADEON_DEBUG & RADEON_DMA) { if (RADEON_DEBUG & RADEON_DMA) {
@@ -371,14 +371,14 @@ void radeonReleaseDmaRegions(radeonContextPtr rmesa)
WARN_ONCE("Leaking dma buffer object!\n"); WARN_ONCE("Leaking dma buffer object!\n");
radeon_bo_unref(dma_bo->bo); radeon_bo_unref(dma_bo->bo);
remove_from_list(dma_bo); remove_from_list(dma_bo);
FREE(dma_bo); free(dma_bo);
continue; continue;
} }
/* free objects that are too small to be used because of large request */ /* free objects that are too small to be used because of large request */
if (dma_bo->bo->size < rmesa->dma.minimum_size) { if (dma_bo->bo->size < rmesa->dma.minimum_size) {
radeon_bo_unref(dma_bo->bo); radeon_bo_unref(dma_bo->bo);
remove_from_list(dma_bo); remove_from_list(dma_bo);
FREE(dma_bo); free(dma_bo);
continue; continue;
} }
if (!radeon_bo_is_idle(dma_bo->bo)) { if (!radeon_bo_is_idle(dma_bo->bo)) {
@@ -396,7 +396,7 @@ void radeonReleaseDmaRegions(radeonContextPtr rmesa)
if (dma_bo->bo->size < rmesa->dma.minimum_size) { if (dma_bo->bo->size < rmesa->dma.minimum_size) {
radeon_bo_unref(dma_bo->bo); radeon_bo_unref(dma_bo->bo);
remove_from_list(dma_bo); remove_from_list(dma_bo);
FREE(dma_bo); free(dma_bo);
continue; continue;
} }
remove_from_list(dma_bo); remove_from_list(dma_bo);
@@ -410,7 +410,7 @@ void radeonReleaseDmaRegions(radeonContextPtr rmesa)
break; break;
remove_from_list(dma_bo); remove_from_list(dma_bo);
radeon_bo_unref(dma_bo->bo); radeon_bo_unref(dma_bo->bo);
FREE(dma_bo); free(dma_bo);
} }
} }

View File

@@ -251,7 +251,7 @@ radeon_create_image_from_name(__DRIscreen *screen,
0); 0);
if (image->bo == NULL) { if (image->bo == NULL) {
FREE(image); free(image);
return NULL; return NULL;
} }
@@ -298,7 +298,7 @@ static void
radeon_destroy_image(__DRIimage *image) radeon_destroy_image(__DRIimage *image)
{ {
radeon_bo_unref(image->bo); radeon_bo_unref(image->bo);
FREE(image); free(image);
} }
static __DRIimage * static __DRIimage *
@@ -351,7 +351,7 @@ radeon_create_image(__DRIscreen *screen,
0); 0);
if (image->bo == NULL) { if (image->bo == NULL) {
FREE(image); free(image);
return NULL; return NULL;
} }
@@ -507,7 +507,7 @@ radeonCreateScreen2(__DRIscreen *sPriv)
ret = radeonGetParam(sPriv, RADEON_PARAM_DEVICE_ID, &device_id); ret = radeonGetParam(sPriv, RADEON_PARAM_DEVICE_ID, &device_id);
if (ret) { if (ret) {
FREE( screen ); free( screen );
fprintf(stderr, "drm_radeon_getparam_t (RADEON_PARAM_DEVICE_ID): %d\n", ret); fprintf(stderr, "drm_radeon_getparam_t (RADEON_PARAM_DEVICE_ID): %d\n", ret);
return NULL; return NULL;
} }
@@ -561,7 +561,7 @@ radeonDestroyScreen( __DRIscreen *sPriv )
/* free all option information */ /* free all option information */
driDestroyOptionInfo (&screen->optionCache); driDestroyOptionInfo (&screen->optionCache);
FREE( screen ); free( screen );
sPriv->driverPrivate = NULL; sPriv->driverPrivate = NULL;
} }

View File

@@ -504,7 +504,7 @@ drawable_fail:
if (drawable) if (drawable)
free(drawable->row); free(drawable->row);
FREE(drawable); free(drawable);
return GL_FALSE; return GL_FALSE;
} }
@@ -806,7 +806,7 @@ dri_create_context(gl_api api,
context_fail: context_fail:
FREE(ctx); free(ctx);
return GL_FALSE; return GL_FALSE;
} }

View File

@@ -363,7 +363,7 @@ Fake_glXUseXFont(Font font, int first, int count, int listbase)
glEndList(); glEndList();
} }
FREE(bm); free(bm);
XFreeFontInfo(NULL, fs, 1); XFreeFontInfo(NULL, fs, 1);
XFreeGC(dpy, gc); XFreeGC(dpy, gc);

View File

@@ -1438,7 +1438,7 @@ GLboolean _ae_create_context( struct gl_context *ctx )
void _ae_destroy_context( struct gl_context *ctx ) void _ae_destroy_context( struct gl_context *ctx )
{ {
if ( AE_CONTEXT( ctx ) ) { if ( AE_CONTEXT( ctx ) ) {
FREE( ctx->aelt_context ); free(ctx->aelt_context);
ctx->aelt_context = NULL; ctx->aelt_context = NULL;
} }
} }

View File

@@ -1314,8 +1314,8 @@ _mesa_PopAttrib(void)
} }
next = attr->next; next = attr->next;
FREE( attr->data ); free(attr->data);
FREE( attr ); free(attr);
attr = next; attr = next;
} }
} }
@@ -1592,8 +1592,8 @@ _mesa_PopClientAttrib(void)
} }
next = node->next; next = node->next;
FREE( node->data ); free(node->data);
FREE( node ); free(node);
node = next; node = next;
} }
} }

View File

@@ -391,7 +391,7 @@ _mesa_get_msg(struct gl_context *ctx, GLenum *source, GLenum *type,
} }
if (msg->message != (char*)out_of_memory) if (msg->message != (char*)out_of_memory)
FREE(msg->message); free(msg->message);
msg->message = NULL; msg->message = NULL;
msg->length = 0; msg->length = 0;
@@ -786,7 +786,7 @@ _mesa_free_errors_data(struct gl_context *ctx)
foreach_s(node, tmp, &ClientIDs->Namespaces[s][t].Severity[sev]) { foreach_s(node, tmp, &ClientIDs->Namespaces[s][t].Severity[sev]) {
entry = (struct gl_client_severity *)node; entry = (struct gl_client_severity *)node;
FREE(entry); free(entry);
} }
} }
} }

View File

@@ -416,7 +416,7 @@ map1(GLenum target, GLfloat u1, GLfloat u2, GLint ustride,
map->u2 = u2; map->u2 = u2;
map->du = 1.0F / (u2 - u1); map->du = 1.0F / (u2 - u1);
if (map->Points) if (map->Points)
FREE( map->Points ); free( map->Points );
map->Points = pnts; map->Points = pnts;
} }
@@ -516,7 +516,7 @@ map2( GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder,
map->v2 = v2; map->v2 = v2;
map->dv = 1.0F / (v2 - v1); map->dv = 1.0F / (v2 - v1);
if (map->Points) if (map->Points)
FREE( map->Points ); free( map->Points );
map->Points = pnts; map->Points = pnts;
} }
@@ -1048,44 +1048,44 @@ void _mesa_free_eval_data( struct gl_context *ctx )
/* Free evaluator data */ /* Free evaluator data */
if (ctx->EvalMap.Map1Vertex3.Points) if (ctx->EvalMap.Map1Vertex3.Points)
FREE( ctx->EvalMap.Map1Vertex3.Points ); free( ctx->EvalMap.Map1Vertex3.Points );
if (ctx->EvalMap.Map1Vertex4.Points) if (ctx->EvalMap.Map1Vertex4.Points)
FREE( ctx->EvalMap.Map1Vertex4.Points ); free( ctx->EvalMap.Map1Vertex4.Points );
if (ctx->EvalMap.Map1Index.Points) if (ctx->EvalMap.Map1Index.Points)
FREE( ctx->EvalMap.Map1Index.Points ); free( ctx->EvalMap.Map1Index.Points );
if (ctx->EvalMap.Map1Color4.Points) if (ctx->EvalMap.Map1Color4.Points)
FREE( ctx->EvalMap.Map1Color4.Points ); free( ctx->EvalMap.Map1Color4.Points );
if (ctx->EvalMap.Map1Normal.Points) if (ctx->EvalMap.Map1Normal.Points)
FREE( ctx->EvalMap.Map1Normal.Points ); free( ctx->EvalMap.Map1Normal.Points );
if (ctx->EvalMap.Map1Texture1.Points) if (ctx->EvalMap.Map1Texture1.Points)
FREE( ctx->EvalMap.Map1Texture1.Points ); free( ctx->EvalMap.Map1Texture1.Points );
if (ctx->EvalMap.Map1Texture2.Points) if (ctx->EvalMap.Map1Texture2.Points)
FREE( ctx->EvalMap.Map1Texture2.Points ); free( ctx->EvalMap.Map1Texture2.Points );
if (ctx->EvalMap.Map1Texture3.Points) if (ctx->EvalMap.Map1Texture3.Points)
FREE( ctx->EvalMap.Map1Texture3.Points ); free( ctx->EvalMap.Map1Texture3.Points );
if (ctx->EvalMap.Map1Texture4.Points) if (ctx->EvalMap.Map1Texture4.Points)
FREE( ctx->EvalMap.Map1Texture4.Points ); free( ctx->EvalMap.Map1Texture4.Points );
for (i = 0; i < 16; i++) for (i = 0; i < 16; i++)
FREE((ctx->EvalMap.Map1Attrib[i].Points)); free((ctx->EvalMap.Map1Attrib[i].Points));
if (ctx->EvalMap.Map2Vertex3.Points) if (ctx->EvalMap.Map2Vertex3.Points)
FREE( ctx->EvalMap.Map2Vertex3.Points ); free( ctx->EvalMap.Map2Vertex3.Points );
if (ctx->EvalMap.Map2Vertex4.Points) if (ctx->EvalMap.Map2Vertex4.Points)
FREE( ctx->EvalMap.Map2Vertex4.Points ); free( ctx->EvalMap.Map2Vertex4.Points );
if (ctx->EvalMap.Map2Index.Points) if (ctx->EvalMap.Map2Index.Points)
FREE( ctx->EvalMap.Map2Index.Points ); free( ctx->EvalMap.Map2Index.Points );
if (ctx->EvalMap.Map2Color4.Points) if (ctx->EvalMap.Map2Color4.Points)
FREE( ctx->EvalMap.Map2Color4.Points ); free( ctx->EvalMap.Map2Color4.Points );
if (ctx->EvalMap.Map2Normal.Points) if (ctx->EvalMap.Map2Normal.Points)
FREE( ctx->EvalMap.Map2Normal.Points ); free( ctx->EvalMap.Map2Normal.Points );
if (ctx->EvalMap.Map2Texture1.Points) if (ctx->EvalMap.Map2Texture1.Points)
FREE( ctx->EvalMap.Map2Texture1.Points ); free( ctx->EvalMap.Map2Texture1.Points );
if (ctx->EvalMap.Map2Texture2.Points) if (ctx->EvalMap.Map2Texture2.Points)
FREE( ctx->EvalMap.Map2Texture2.Points ); free( ctx->EvalMap.Map2Texture2.Points );
if (ctx->EvalMap.Map2Texture3.Points) if (ctx->EvalMap.Map2Texture3.Points)
FREE( ctx->EvalMap.Map2Texture3.Points ); free( ctx->EvalMap.Map2Texture3.Points );
if (ctx->EvalMap.Map2Texture4.Points) if (ctx->EvalMap.Map2Texture4.Points)
FREE( ctx->EvalMap.Map2Texture4.Points ); free( ctx->EvalMap.Map2Texture4.Points );
for (i = 0; i < 16; i++) for (i = 0; i < 16; i++)
FREE((ctx->EvalMap.Map2Attrib[i].Points)); free((ctx->EvalMap.Map2Attrib[i].Points));
} }

View File

@@ -693,7 +693,7 @@ free_matrix_stack( struct gl_matrix_stack *stack )
for (i = 0; i < stack->MaxDepth; i++) { for (i = 0; i < stack->MaxDepth; i++) {
_math_matrix_dtr(&stack->Stack[i]); _math_matrix_dtr(&stack->Stack[i]);
} }
FREE(stack->Stack); free(stack->Stack);
stack->Stack = stack->Top = NULL; stack->Stack = stack->Top = NULL;
} }

View File

@@ -155,7 +155,7 @@ void
_mesa_delete_sampler_object(struct gl_context *ctx, _mesa_delete_sampler_object(struct gl_context *ctx,
struct gl_sampler_object *sampObj) struct gl_sampler_object *sampObj)
{ {
FREE(sampObj); free(sampObj);
} }

View File

@@ -1550,7 +1550,7 @@ _mesa_parse_nv_fragment_program(struct gl_context *ctx, GLenum dstTarget,
/* install the program */ /* install the program */
program->Base.Target = target; program->Base.Target = target;
if (program->Base.String) { if (program->Base.String) {
FREE(program->Base.String); free(program->Base.String);
} }
program->Base.String = programString; program->Base.String = programString;
program->Base.Format = GL_PROGRAM_FORMAT_ASCII_ARB; program->Base.Format = GL_PROGRAM_FORMAT_ASCII_ARB;

View File

@@ -60,7 +60,7 @@ static void st_delete_sync_object(struct gl_context *ctx,
struct st_sync_object *so = (struct st_sync_object*)obj; struct st_sync_object *so = (struct st_sync_object*)obj;
screen->fence_reference(screen, &so->fence, NULL); screen->fence_reference(screen, &so->fence, NULL);
FREE(so); free(so);
} }
static void st_fence_sync(struct gl_context *ctx, struct gl_sync_object *obj, static void st_fence_sync(struct gl_context *ctx, struct gl_sync_object *obj,

View File

@@ -4772,16 +4772,16 @@ st_translate_program(
out: out:
if (t) { if (t) {
FREE(t->insn); free(t->insn);
FREE(t->labels); free(t->labels);
FREE(t->constants); free(t->constants);
FREE(t->immediates); free(t->immediates);
if (t->error) { if (t->error) {
debug_printf("%s: translate error flag set\n", __FUNCTION__); debug_printf("%s: translate error flag set\n", __FUNCTION__);
} }
FREE(t); free(t);
} }
return ret; return ret;

View File

@@ -430,7 +430,7 @@ st_framebuffer_create(struct st_framebuffer_iface *stfbi)
/* add the color buffer */ /* add the color buffer */
idx = stfb->Base._ColorDrawBufferIndexes[0]; idx = stfb->Base._ColorDrawBufferIndexes[0];
if (!st_framebuffer_add_renderbuffer(stfb, idx)) { if (!st_framebuffer_add_renderbuffer(stfb, idx)) {
FREE(stfb); free(stfb);
return NULL; return NULL;
} }

View File

@@ -1259,9 +1259,9 @@ st_translate_mesa_program(
} }
out: out:
FREE(t->insn); free(t->insn);
FREE(t->labels); free(t->labels);
FREE(t->constants); free(t->constants);
if (t->error) { if (t->error) {
debug_printf("%s: translate error flag set\n", __FUNCTION__); debug_printf("%s: translate error flag set\n", __FUNCTION__);
@@ -1278,5 +1278,5 @@ out:
void void
st_free_tokens(const struct tgsi_token *tokens) st_free_tokens(const struct tgsi_token *tokens)
{ {
FREE((void *)tokens); free((void *)tokens);
} }

View File

@@ -74,7 +74,7 @@ delete_vp_variant(struct st_context *st, struct st_vp_variant *vpv)
if (vpv->tgsi.tokens) if (vpv->tgsi.tokens)
st_free_tokens(vpv->tgsi.tokens); st_free_tokens(vpv->tgsi.tokens);
FREE( vpv ); free( vpv );
} }
@@ -112,7 +112,7 @@ delete_fp_variant(struct st_context *st, struct st_fp_variant *fpv)
_mesa_free_parameter_list(fpv->parameters); _mesa_free_parameter_list(fpv->parameters);
if (fpv->tgsi.tokens) if (fpv->tgsi.tokens)
st_free_tokens(fpv->tgsi.tokens); st_free_tokens(fpv->tgsi.tokens);
FREE(fpv); free(fpv);
} }
@@ -144,7 +144,7 @@ delete_gp_variant(struct st_context *st, struct st_gp_variant *gpv)
if (gpv->driver_shader) if (gpv->driver_shader)
cso_delete_geometry_shader(st->cso_context, gpv->driver_shader); cso_delete_geometry_shader(st->cso_context, gpv->driver_shader);
FREE(gpv); free(gpv);
} }
@@ -316,7 +316,7 @@ st_translate_vertex_program(struct st_context *st,
ureg = ureg_create( TGSI_PROCESSOR_VERTEX ); ureg = ureg_create( TGSI_PROCESSOR_VERTEX );
if (ureg == NULL) { if (ureg == NULL) {
FREE(vpv); free(vpv);
return NULL; return NULL;
} }
@@ -676,7 +676,7 @@ st_translate_fragment_program(struct st_context *st,
ureg = ureg_create( TGSI_PROCESSOR_FRAGMENT ); ureg = ureg_create( TGSI_PROCESSOR_FRAGMENT );
if (ureg == NULL) { if (ureg == NULL) {
FREE(variant); free(variant);
return NULL; return NULL;
} }
@@ -836,7 +836,7 @@ st_translate_geometry_program(struct st_context *st,
ureg = ureg_create( TGSI_PROCESSOR_GEOMETRY ); ureg = ureg_create( TGSI_PROCESSOR_GEOMETRY );
if (ureg == NULL) { if (ureg == NULL) {
FREE(gpv); free(gpv);
return NULL; return NULL;
} }

View File

@@ -777,7 +777,7 @@ _swrast_CreateContext( struct gl_context *ctx )
*/ */
swrast->SpanArrays = (SWspanarrays *) malloc(maxThreads * sizeof(SWspanarrays)); swrast->SpanArrays = (SWspanarrays *) malloc(maxThreads * sizeof(SWspanarrays));
if (!swrast->SpanArrays) { if (!swrast->SpanArrays) {
FREE(swrast); free(swrast);
return GL_FALSE; return GL_FALSE;
} }
for(i = 0; i < maxThreads; i++) { for(i = 0; i < maxThreads; i++) {
@@ -828,17 +828,17 @@ _swrast_DestroyContext( struct gl_context *ctx )
_mesa_debug(ctx, "_swrast_DestroyContext\n"); _mesa_debug(ctx, "_swrast_DestroyContext\n");
} }
FREE( swrast->SpanArrays ); free( swrast->SpanArrays );
if (swrast->ZoomedArrays) if (swrast->ZoomedArrays)
FREE( swrast->ZoomedArrays ); free( swrast->ZoomedArrays );
FREE( swrast->TexelBuffer ); free( swrast->TexelBuffer );
free(swrast->stencil_temp.buf1); free(swrast->stencil_temp.buf1);
free(swrast->stencil_temp.buf2); free(swrast->stencil_temp.buf2);
free(swrast->stencil_temp.buf3); free(swrast->stencil_temp.buf3);
free(swrast->stencil_temp.buf4); free(swrast->stencil_temp.buf4);
FREE( swrast ); free( swrast );
ctx->swrast_context = 0; ctx->swrast_context = 0;
} }

View File

@@ -72,7 +72,7 @@ _swsetup_DestroyContext( struct gl_context *ctx )
SScontext *swsetup = SWSETUP_CONTEXT(ctx); SScontext *swsetup = SWSETUP_CONTEXT(ctx);
if (swsetup) { if (swsetup) {
FREE(swsetup); free(swsetup);
ctx->swsetup_context = 0; ctx->swsetup_context = 0;
} }

View File

@@ -116,7 +116,7 @@ _tnl_DestroyContext( struct gl_context *ctx )
_tnl_destroy_pipeline( ctx ); _tnl_destroy_pipeline( ctx );
FREE(tnl); free(tnl);
ctx->swtnl_context = NULL; ctx->swtnl_context = NULL;
} }

View File

@@ -259,7 +259,7 @@ free_fog_data(struct tnl_pipeline_stage *stage)
struct fog_stage_data *store = FOG_STAGE_DATA(stage); struct fog_stage_data *store = FOG_STAGE_DATA(stage);
if (store) { if (store) {
_mesa_vector4f_free( &store->fogcoord ); _mesa_vector4f_free( &store->fogcoord );
FREE( store ); free( store );
stage->privatePtr = NULL; stage->privatePtr = NULL;
} }
} }

View File

@@ -457,7 +457,7 @@ static void dtr( struct tnl_pipeline_stage *stage )
_mesa_vector4f_free( &store->LitColor[1] ); _mesa_vector4f_free( &store->LitColor[1] );
_mesa_vector4f_free( &store->LitSecondary[0] ); _mesa_vector4f_free( &store->LitSecondary[0] );
_mesa_vector4f_free( &store->LitSecondary[1] ); _mesa_vector4f_free( &store->LitSecondary[1] );
FREE( store ); free( store );
stage->privatePtr = NULL; stage->privatePtr = NULL;
} }
} }

View File

@@ -546,7 +546,7 @@ dtr(struct tnl_pipeline_stage *stage)
_mesa_vector4f_free( &store->ndcCoords ); _mesa_vector4f_free( &store->ndcCoords );
_mesa_align_free( store->clipmask ); _mesa_align_free( store->clipmask );
FREE( store ); free( store );
stage->privatePtr = NULL; stage->privatePtr = NULL;
} }
} }

View File

@@ -589,9 +589,9 @@ static void free_texgen_data( struct tnl_pipeline_stage *stage )
_mesa_vector4f_free( &store->texcoord[i] ); _mesa_vector4f_free( &store->texcoord[i] );
if (store->tmp_f) FREE( store->tmp_f ); if (store->tmp_f) free( store->tmp_f );
if (store->tmp_m) FREE( store->tmp_m ); if (store->tmp_m) free( store->tmp_m );
FREE( store ); free( store );
stage->privatePtr = NULL; stage->privatePtr = NULL;
} }
} }

View File

@@ -110,7 +110,7 @@ static void free_texmat_data( struct tnl_pipeline_stage *stage )
for (i = 0; i < MAX_TEXTURE_COORD_UNITS; i++) for (i = 0; i < MAX_TEXTURE_COORD_UNITS; i++)
if (store->texcoord[i].data) if (store->texcoord[i].data)
_mesa_vector4f_free( &store->texcoord[i] ); _mesa_vector4f_free( &store->texcoord[i] );
FREE( store ); free( store );
stage->privatePtr = NULL; stage->privatePtr = NULL;
} }
} }

View File

@@ -265,7 +265,7 @@ static void dtr( struct tnl_pipeline_stage *stage )
_mesa_vector4f_free( &store->clip ); _mesa_vector4f_free( &store->clip );
_mesa_vector4f_free( &store->proj ); _mesa_vector4f_free( &store->proj );
_mesa_align_free( store->clipmask ); _mesa_align_free( store->clipmask );
FREE(store); free(store);
stage->privatePtr = NULL; stage->privatePtr = NULL;
stage->run = init_vertex_stage; stage->run = init_vertex_stage;
} }

View File

@@ -548,7 +548,7 @@ void _tnl_free_vertices( struct gl_context *ctx )
for (fp = vtx->fastpath ; fp ; fp = tmp) { for (fp = vtx->fastpath ; fp ; fp = tmp) {
tmp = fp->next; tmp = fp->next;
FREE(fp->attr); free(fp->attr);
/* KW: At the moment, fp->func is constrained to be allocated by /* KW: At the moment, fp->func is constrained to be allocated by
* _mesa_exec_alloc(), as the hardwired fastpaths in * _mesa_exec_alloc(), as the hardwired fastpaths in
@@ -557,7 +557,7 @@ void _tnl_free_vertices( struct gl_context *ctx )
* module gets another overhaul. * module gets another overhaul.
*/ */
_mesa_exec_free((void *) fp->func); _mesa_exec_free((void *) fp->func);
FREE(fp); free(fp);
} }
vtx->fastpath = NULL; vtx->fastpath = NULL;

View File

@@ -223,7 +223,7 @@ void _vbo_DestroyContext( struct gl_context *ctx )
vbo_exec_destroy(ctx); vbo_exec_destroy(ctx);
if (ctx->API == API_OPENGL) if (ctx->API == API_OPENGL)
vbo_save_destroy(ctx); vbo_save_destroy(ctx);
FREE(vbo); free(vbo);
ctx->swtnl_im = NULL; ctx->swtnl_im = NULL;
} }
} }

View File

@@ -101,13 +101,13 @@ void vbo_save_destroy( struct gl_context *ctx )
if (save->prim_store) { if (save->prim_store) {
if ( --save->prim_store->refcount == 0 ) { if ( --save->prim_store->refcount == 0 ) {
FREE( save->prim_store ); free(save->prim_store);
save->prim_store = NULL; save->prim_store = NULL;
} }
if ( --save->vertex_store->refcount == 0 ) { if ( --save->vertex_store->refcount == 0 ) {
_mesa_reference_buffer_object(ctx, _mesa_reference_buffer_object(ctx,
&save->vertex_store->bufferobj, NULL); &save->vertex_store->bufferobj, NULL);
FREE( save->vertex_store ); free(save->vertex_store);
save->vertex_store = NULL; save->vertex_store = NULL;
} }
} }

View File

@@ -233,7 +233,7 @@ free_vertex_store(struct gl_context *ctx,
_mesa_reference_buffer_object(ctx, &vertex_store->bufferobj, NULL); _mesa_reference_buffer_object(ctx, &vertex_store->bufferobj, NULL);
} }
FREE(vertex_store); free(vertex_store);
} }
@@ -1575,10 +1575,10 @@ vbo_destroy_vertex_list(struct gl_context *ctx, void *data)
free_vertex_store(ctx, node->vertex_store); free_vertex_store(ctx, node->vertex_store);
if (--node->prim_store->refcount == 0) if (--node->prim_store->refcount == 0)
FREE(node->prim_store); free(node->prim_store);
if (node->current_data) { if (node->current_data) {
FREE(node->current_data); free(node->current_data);
node->current_data = NULL; node->current_data = NULL;
} }
} }