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:
@@ -159,7 +159,7 @@ dri_create_context(gl_api api, const struct gl_config * visual,
|
||||
if (ctx && ctx->st)
|
||||
ctx->st->destroy(ctx->st);
|
||||
|
||||
FREE(ctx);
|
||||
free(ctx);
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
||||
@@ -172,7 +172,7 @@ dri_destroy_context(__DRIcontext * cPriv)
|
||||
* driParseConfigFiles allocated values only - the rest
|
||||
* is owned by screen optionCache.
|
||||
*/
|
||||
FREE(ctx->optionCache.values);
|
||||
free(ctx->optionCache.values);
|
||||
|
||||
/* No particular reason to wait for command completion before
|
||||
* 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);
|
||||
|
||||
FREE(ctx);
|
||||
free(ctx);
|
||||
}
|
||||
|
||||
GLboolean
|
||||
|
@@ -355,13 +355,13 @@ dri_destroy_option_cache(struct dri_screen * screen)
|
||||
|
||||
if (screen->optionCache.info) {
|
||||
for (i = 0; i < (1 << screen->optionCache.tableSize); ++i) {
|
||||
FREE(screen->optionCache.info[i].name);
|
||||
FREE(screen->optionCache.info[i].ranges);
|
||||
free(screen->optionCache.info[i].name);
|
||||
free(screen->optionCache.info[i].ranges);
|
||||
}
|
||||
FREE(screen->optionCache.info);
|
||||
free(screen->optionCache.info);
|
||||
}
|
||||
|
||||
FREE(screen->optionCache.values);
|
||||
free(screen->optionCache.values);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -383,7 +383,7 @@ dri_destroy_screen(__DRIscreen * sPriv)
|
||||
|
||||
dri_destroy_screen_helper(screen);
|
||||
|
||||
FREE(screen);
|
||||
free(screen);
|
||||
sPriv->driverPrivate = NULL;
|
||||
sPriv->extensions = NULL;
|
||||
}
|
||||
|
@@ -357,7 +357,7 @@ glXUseXFont(Font font, int first, int count, int listbase)
|
||||
glEndList();
|
||||
}
|
||||
|
||||
FREE(bm);
|
||||
free(bm);
|
||||
XFreeFontInfo(NULL, fs, 1);
|
||||
XFreeGC(dpy, gc);
|
||||
|
||||
|
@@ -169,7 +169,7 @@ xmesa_init_display( Display *display )
|
||||
xmdpy->screen = NULL;
|
||||
}
|
||||
if (xmdpy->smapi) {
|
||||
FREE(xmdpy->smapi);
|
||||
free(xmdpy->smapi);
|
||||
xmdpy->smapi = NULL;
|
||||
}
|
||||
|
||||
@@ -800,8 +800,8 @@ XMesaVisual XMesaCreateVisual( Display *display,
|
||||
|
||||
v->stvis.color_format = choose_pixel_format(v);
|
||||
if (v->stvis.color_format == PIPE_FORMAT_NONE) {
|
||||
FREE(v->visinfo);
|
||||
FREE(v);
|
||||
free(v->visinfo);
|
||||
free(v);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@@ -279,9 +279,9 @@ xmesa_create_st_framebuffer(XMesaDisplay xmdpy, XMesaBuffer b)
|
||||
xstfb = CALLOC_STRUCT(xmesa_st_framebuffer);
|
||||
if (!stfbi || !xstfb) {
|
||||
if (stfbi)
|
||||
FREE(stfbi);
|
||||
free(stfbi);
|
||||
if (xstfb)
|
||||
FREE(xstfb);
|
||||
free(xstfb);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -314,8 +314,8 @@ xmesa_destroy_st_framebuffer(struct st_framebuffer_iface *stfbi)
|
||||
for (i = 0; i < ST_ATTACHMENT_COUNT; i++)
|
||||
pipe_resource_reference(&xstfb->textures[i], NULL);
|
||||
|
||||
FREE(xstfb);
|
||||
FREE(stfbi);
|
||||
free(xstfb);
|
||||
free(stfbi);
|
||||
}
|
||||
|
||||
void
|
||||
|
@@ -68,7 +68,7 @@ driCreateNewScreen(int scrn, const __DRIextension **extensions,
|
||||
|
||||
*driver_configs = driDriverAPI.InitScreen(psp);
|
||||
if (*driver_configs == NULL) {
|
||||
FREE(psp);
|
||||
free(psp);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ static void driDestroyScreen(__DRIscreen *psp)
|
||||
{
|
||||
if (psp) {
|
||||
driDriverAPI.DestroyScreen(psp);
|
||||
FREE(psp);
|
||||
free(psp);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -178,7 +178,7 @@ driCreateContextAttribs(__DRIscreen *screen, int api,
|
||||
if (!driDriverAPI.CreateContext(mesa_api, modes, pcp,
|
||||
major_version, minor_version,
|
||||
flags, error, shareCtx)) {
|
||||
FREE(pcp);
|
||||
free(pcp);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -209,7 +209,7 @@ driDestroyContext(__DRIcontext *pcp)
|
||||
{
|
||||
if (pcp) {
|
||||
driDriverAPI.DestroyContext(pcp);
|
||||
FREE(pcp);
|
||||
free(pcp);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -289,7 +289,7 @@ static void dri_put_drawable(__DRIdrawable *pdp)
|
||||
return;
|
||||
|
||||
driDriverAPI.DestroyBuffer(pdp);
|
||||
FREE(pdp);
|
||||
free(pdp);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -311,7 +311,7 @@ driCreateNewDrawable(__DRIscreen *psp,
|
||||
dri_get_drawable(pdp);
|
||||
|
||||
if (!driDriverAPI.CreateBuffer(psp, pdp, &config->modes, GL_FALSE)) {
|
||||
FREE(pdp);
|
||||
free(pdp);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@@ -382,9 +382,9 @@ static GLboolean parseRanges (driOptionInfo *info, const XML_Char *string) {
|
||||
else
|
||||
range = NULL;
|
||||
}
|
||||
FREE (cp);
|
||||
free(cp);
|
||||
if (i < nRanges) {
|
||||
FREE (ranges);
|
||||
free(ranges);
|
||||
return GL_FALSE;
|
||||
} else
|
||||
assert (range == NULL);
|
||||
@@ -990,7 +990,7 @@ void driParseConfigFiles (driOptionCache *cache, const driOptionCache *info,
|
||||
}
|
||||
|
||||
if (filenames[1])
|
||||
FREE (filenames[1]);
|
||||
free(filenames[1]);
|
||||
}
|
||||
|
||||
void driDestroyOptionInfo (driOptionCache *info) {
|
||||
@@ -999,18 +999,18 @@ void driDestroyOptionInfo (driOptionCache *info) {
|
||||
GLuint i, size = 1 << info->tableSize;
|
||||
for (i = 0; i < size; ++i) {
|
||||
if (info->info[i].name) {
|
||||
FREE (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);
|
||||
free(info->info);
|
||||
}
|
||||
}
|
||||
|
||||
void driDestroyOptionCache (driOptionCache *cache) {
|
||||
if (cache->values)
|
||||
FREE (cache->values);
|
||||
free(cache->values);
|
||||
}
|
||||
|
||||
GLboolean driCheckOption (const driOptionCache *cache, const char *name,
|
||||
|
@@ -65,7 +65,7 @@ i830CreateContext(const struct gl_config * mesaVis,
|
||||
|
||||
if (!intelInitContext(intel, __DRI_API_OPENGL, mesaVis, driContextPriv,
|
||||
sharedContextPrivate, &functions)) {
|
||||
FREE(i830);
|
||||
free(i830);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@@ -167,7 +167,7 @@ i915CreateContext(int api,
|
||||
|
||||
if (!intelInitContext(intel, api, mesaVis, driContextPriv,
|
||||
sharedContextPrivate, &functions)) {
|
||||
FREE(i915);
|
||||
free(i915);
|
||||
*error = __DRI_CTX_ERROR_NO_MEMORY;
|
||||
return false;
|
||||
}
|
||||
@@ -184,7 +184,7 @@ i915CreateContext(int api,
|
||||
|
||||
if (req_version > max_version) {
|
||||
*error = __DRI_CTX_ERROR_BAD_VERSION;
|
||||
FREE(i915);
|
||||
free(i915);
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
@@ -194,7 +194,7 @@ i915CreateContext(int api,
|
||||
break;
|
||||
default:
|
||||
*error = __DRI_CTX_ERROR_BAD_API;
|
||||
FREE(i915);
|
||||
free(i915);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@@ -148,7 +148,7 @@ brwCreateContext(int api,
|
||||
if (!intelInitContext( intel, api, mesaVis, driContextPriv,
|
||||
sharedContextPrivate, &functions )) {
|
||||
printf("%s: failed to init intel context\n", __FUNCTION__);
|
||||
FREE(brw);
|
||||
free(brw);
|
||||
*error = __DRI_CTX_ERROR_NO_MEMORY;
|
||||
return false;
|
||||
}
|
||||
|
@@ -120,7 +120,7 @@ rehash(struct brw_cache *cache)
|
||||
items[c->hash % size] = c;
|
||||
}
|
||||
|
||||
FREE(cache->items);
|
||||
free(cache->items);
|
||||
cache->items = items;
|
||||
cache->size = size;
|
||||
}
|
||||
|
@@ -309,7 +309,7 @@ intel_create_image_from_name(__DRIscreen *screen,
|
||||
cpp, width, height,
|
||||
pitch, name, "image");
|
||||
if (image->region == NULL) {
|
||||
FREE(image);
|
||||
free(image);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -371,7 +371,7 @@ static void
|
||||
intel_destroy_image(__DRIimage *image)
|
||||
{
|
||||
intel_region_release(&image->region);
|
||||
FREE(image);
|
||||
free(image);
|
||||
}
|
||||
|
||||
static __DRIimage *
|
||||
@@ -397,7 +397,7 @@ intel_create_image(__DRIscreen *screen,
|
||||
image->region =
|
||||
intel_region_alloc(intelScreen, tiling, cpp, width, height, true);
|
||||
if (image->region == NULL) {
|
||||
FREE(image);
|
||||
free(image);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -446,7 +446,7 @@ intel_dup_image(__DRIimage *orig_image, void *loaderPrivate)
|
||||
|
||||
intel_region_reference(&image->region, orig_image->region);
|
||||
if (image->region == NULL) {
|
||||
FREE(image);
|
||||
free(image);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -543,13 +543,13 @@ intel_from_planar(__DRIimage *parent, int plane, void *loaderPrivate)
|
||||
pitch = stride / cpp;
|
||||
if (offset + height * cpp * pitch > parent->region->bo->size) {
|
||||
_mesa_warning(NULL, "intel_create_sub_image: subimage out of bounds");
|
||||
FREE(image);
|
||||
free(image);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
image->region = calloc(sizeof(*image->region), 1);
|
||||
if (image->region == NULL) {
|
||||
FREE(image);
|
||||
free(image);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -639,7 +639,7 @@ intelDestroyScreen(__DRIscreen * sPriv)
|
||||
_mesa_HashDeleteAll(intelScreen->named_regions, nop_callback, NULL);
|
||||
_mesa_DeleteHashTable(intelScreen->named_regions);
|
||||
|
||||
FREE(intelScreen);
|
||||
free(intelScreen);
|
||||
sPriv->driverPrivate = NULL;
|
||||
}
|
||||
|
||||
@@ -1156,7 +1156,7 @@ intelAllocateBuffer(__DRIscreen *screen,
|
||||
true);
|
||||
|
||||
if (intelBuffer->region == NULL) {
|
||||
FREE(intelBuffer);
|
||||
free(intelBuffer);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@@ -67,8 +67,8 @@ nouveau_bufferobj_del(struct gl_context *ctx, struct gl_buffer_object *obj)
|
||||
struct nouveau_bufferobj *nbo = to_nouveau_bufferobj(obj);
|
||||
|
||||
nouveau_bo_ref(NULL, &nbo->bo);
|
||||
FREE(nbo->sys);
|
||||
FREE(nbo);
|
||||
free(nbo->sys);
|
||||
free(nbo);
|
||||
}
|
||||
|
||||
static GLboolean
|
||||
@@ -84,7 +84,7 @@ nouveau_bufferobj_data(struct gl_context *ctx, GLenum target, GLsizeiptrARB size
|
||||
|
||||
/* Free previous storage */
|
||||
nouveau_bo_ref(NULL, &nbo->bo);
|
||||
FREE(nbo->sys);
|
||||
free(nbo->sys);
|
||||
|
||||
if (target == GL_ELEMENT_ARRAY_BUFFER_ARB ||
|
||||
(size < 512 && usage == GL_DYNAMIC_DRAW_ARB) ||
|
||||
|
@@ -144,7 +144,7 @@ nouveau_destroy_screen(__DRIscreen *dri_screen)
|
||||
|
||||
nouveau_device_del(&screen->device);
|
||||
|
||||
FREE(screen);
|
||||
free(screen);
|
||||
dri_screen->driverPrivate = NULL;
|
||||
}
|
||||
|
||||
|
@@ -134,7 +134,7 @@ nv04_context_destroy(struct gl_context *ctx)
|
||||
nouveau_object_del(&nctx->hw.surf3d);
|
||||
|
||||
nouveau_context_deinit(ctx);
|
||||
FREE(ctx);
|
||||
free(ctx);
|
||||
}
|
||||
|
||||
static struct gl_context *
|
||||
|
@@ -423,7 +423,7 @@ nv10_context_destroy(struct gl_context *ctx)
|
||||
nouveau_object_del(&nctx->hw.eng3d);
|
||||
|
||||
nouveau_context_deinit(ctx);
|
||||
FREE(ctx);
|
||||
free(ctx);
|
||||
}
|
||||
|
||||
static struct gl_context *
|
||||
|
@@ -434,7 +434,7 @@ nv20_context_destroy(struct gl_context *ctx)
|
||||
nouveau_object_del(&nctx->hw.eng3d);
|
||||
|
||||
nouveau_context_deinit(ctx);
|
||||
FREE(ctx);
|
||||
free(ctx);
|
||||
}
|
||||
|
||||
static struct gl_context *
|
||||
|
@@ -281,7 +281,7 @@ GLboolean r200CreateContext( gl_api api,
|
||||
if (!radeonInitContext(&rmesa->radeon, &functions,
|
||||
glVisual, driContextPriv,
|
||||
sharedContextPrivate)) {
|
||||
FREE(rmesa);
|
||||
free(rmesa);
|
||||
*error = __DRI_CTX_ERROR_NO_MEMORY;
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
@@ -202,9 +202,9 @@ static void radeon_destroy_atom_list(radeonContextPtr radeon)
|
||||
struct radeon_state_atom *atom;
|
||||
|
||||
foreach(atom, &radeon->hw.atomlist) {
|
||||
FREE(atom->cmd);
|
||||
free(atom->cmd);
|
||||
if (atom->lastcmd)
|
||||
FREE(atom->lastcmd);
|
||||
free(atom->lastcmd);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -267,7 +267,7 @@ void radeonDestroyContext(__DRIcontext *driContextPriv )
|
||||
fclose(track);
|
||||
}
|
||||
#endif
|
||||
FREE(radeon);
|
||||
free(radeon);
|
||||
}
|
||||
|
||||
/* Force the context `c' to be unbound from its buffer.
|
||||
|
@@ -243,7 +243,7 @@ r100CreateContext( gl_api api,
|
||||
if (!radeonInitContext(&rmesa->radeon, &functions,
|
||||
glVisual, driContextPriv,
|
||||
sharedContextPrivate)) {
|
||||
FREE(rmesa);
|
||||
free(rmesa);
|
||||
*error = __DRI_CTX_ERROR_NO_MEMORY;
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
@@ -302,19 +302,19 @@ void radeonFreeDmaRegions(radeonContextPtr rmesa)
|
||||
foreach_s(dma_bo, temp, &rmesa->dma.free) {
|
||||
remove_from_list(dma_bo);
|
||||
radeon_bo_unref(dma_bo->bo);
|
||||
FREE(dma_bo);
|
||||
free(dma_bo);
|
||||
}
|
||||
|
||||
foreach_s(dma_bo, temp, &rmesa->dma.wait) {
|
||||
remove_from_list(dma_bo);
|
||||
radeon_bo_unref(dma_bo->bo);
|
||||
FREE(dma_bo);
|
||||
free(dma_bo);
|
||||
}
|
||||
|
||||
foreach_s(dma_bo, temp, &rmesa->dma.reserved) {
|
||||
remove_from_list(dma_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 *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;
|
||||
|
||||
if (RADEON_DEBUG & RADEON_DMA) {
|
||||
@@ -371,14 +371,14 @@ void radeonReleaseDmaRegions(radeonContextPtr rmesa)
|
||||
WARN_ONCE("Leaking dma buffer object!\n");
|
||||
radeon_bo_unref(dma_bo->bo);
|
||||
remove_from_list(dma_bo);
|
||||
FREE(dma_bo);
|
||||
free(dma_bo);
|
||||
continue;
|
||||
}
|
||||
/* free objects that are too small to be used because of large request */
|
||||
if (dma_bo->bo->size < rmesa->dma.minimum_size) {
|
||||
radeon_bo_unref(dma_bo->bo);
|
||||
remove_from_list(dma_bo);
|
||||
FREE(dma_bo);
|
||||
free(dma_bo);
|
||||
continue;
|
||||
}
|
||||
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) {
|
||||
radeon_bo_unref(dma_bo->bo);
|
||||
remove_from_list(dma_bo);
|
||||
FREE(dma_bo);
|
||||
free(dma_bo);
|
||||
continue;
|
||||
}
|
||||
remove_from_list(dma_bo);
|
||||
@@ -410,7 +410,7 @@ void radeonReleaseDmaRegions(radeonContextPtr rmesa)
|
||||
break;
|
||||
remove_from_list(dma_bo);
|
||||
radeon_bo_unref(dma_bo->bo);
|
||||
FREE(dma_bo);
|
||||
free(dma_bo);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -251,7 +251,7 @@ radeon_create_image_from_name(__DRIscreen *screen,
|
||||
0);
|
||||
|
||||
if (image->bo == NULL) {
|
||||
FREE(image);
|
||||
free(image);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -298,7 +298,7 @@ static void
|
||||
radeon_destroy_image(__DRIimage *image)
|
||||
{
|
||||
radeon_bo_unref(image->bo);
|
||||
FREE(image);
|
||||
free(image);
|
||||
}
|
||||
|
||||
static __DRIimage *
|
||||
@@ -351,7 +351,7 @@ radeon_create_image(__DRIscreen *screen,
|
||||
0);
|
||||
|
||||
if (image->bo == NULL) {
|
||||
FREE(image);
|
||||
free(image);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -507,7 +507,7 @@ radeonCreateScreen2(__DRIscreen *sPriv)
|
||||
|
||||
ret = radeonGetParam(sPriv, RADEON_PARAM_DEVICE_ID, &device_id);
|
||||
if (ret) {
|
||||
FREE( screen );
|
||||
free( screen );
|
||||
fprintf(stderr, "drm_radeon_getparam_t (RADEON_PARAM_DEVICE_ID): %d\n", ret);
|
||||
return NULL;
|
||||
}
|
||||
@@ -561,7 +561,7 @@ radeonDestroyScreen( __DRIscreen *sPriv )
|
||||
/* free all option information */
|
||||
driDestroyOptionInfo (&screen->optionCache);
|
||||
|
||||
FREE( screen );
|
||||
free( screen );
|
||||
sPriv->driverPrivate = NULL;
|
||||
}
|
||||
|
||||
|
@@ -504,7 +504,7 @@ drawable_fail:
|
||||
if (drawable)
|
||||
free(drawable->row);
|
||||
|
||||
FREE(drawable);
|
||||
free(drawable);
|
||||
|
||||
return GL_FALSE;
|
||||
}
|
||||
@@ -806,7 +806,7 @@ dri_create_context(gl_api api,
|
||||
|
||||
context_fail:
|
||||
|
||||
FREE(ctx);
|
||||
free(ctx);
|
||||
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
@@ -363,7 +363,7 @@ Fake_glXUseXFont(Font font, int first, int count, int listbase)
|
||||
glEndList();
|
||||
}
|
||||
|
||||
FREE(bm);
|
||||
free(bm);
|
||||
XFreeFontInfo(NULL, fs, 1);
|
||||
XFreeGC(dpy, gc);
|
||||
|
||||
|
@@ -1438,7 +1438,7 @@ GLboolean _ae_create_context( struct gl_context *ctx )
|
||||
void _ae_destroy_context( struct gl_context *ctx )
|
||||
{
|
||||
if ( AE_CONTEXT( ctx ) ) {
|
||||
FREE( ctx->aelt_context );
|
||||
free(ctx->aelt_context);
|
||||
ctx->aelt_context = NULL;
|
||||
}
|
||||
}
|
||||
|
@@ -1314,8 +1314,8 @@ _mesa_PopAttrib(void)
|
||||
}
|
||||
|
||||
next = attr->next;
|
||||
FREE( attr->data );
|
||||
FREE( attr );
|
||||
free(attr->data);
|
||||
free(attr);
|
||||
attr = next;
|
||||
}
|
||||
}
|
||||
@@ -1592,8 +1592,8 @@ _mesa_PopClientAttrib(void)
|
||||
}
|
||||
|
||||
next = node->next;
|
||||
FREE( node->data );
|
||||
FREE( node );
|
||||
free(node->data);
|
||||
free(node);
|
||||
node = next;
|
||||
}
|
||||
}
|
||||
|
@@ -391,7 +391,7 @@ _mesa_get_msg(struct gl_context *ctx, GLenum *source, GLenum *type,
|
||||
}
|
||||
|
||||
if (msg->message != (char*)out_of_memory)
|
||||
FREE(msg->message);
|
||||
free(msg->message);
|
||||
msg->message = NULL;
|
||||
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]) {
|
||||
entry = (struct gl_client_severity *)node;
|
||||
FREE(entry);
|
||||
free(entry);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -416,7 +416,7 @@ map1(GLenum target, GLfloat u1, GLfloat u2, GLint ustride,
|
||||
map->u2 = u2;
|
||||
map->du = 1.0F / (u2 - u1);
|
||||
if (map->Points)
|
||||
FREE( map->Points );
|
||||
free( map->Points );
|
||||
map->Points = pnts;
|
||||
}
|
||||
|
||||
@@ -516,7 +516,7 @@ map2( GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder,
|
||||
map->v2 = v2;
|
||||
map->dv = 1.0F / (v2 - v1);
|
||||
if (map->Points)
|
||||
FREE( map->Points );
|
||||
free( map->Points );
|
||||
map->Points = pnts;
|
||||
}
|
||||
|
||||
@@ -1048,44 +1048,44 @@ void _mesa_free_eval_data( struct gl_context *ctx )
|
||||
|
||||
/* Free evaluator data */
|
||||
if (ctx->EvalMap.Map1Vertex3.Points)
|
||||
FREE( ctx->EvalMap.Map1Vertex3.Points );
|
||||
free( ctx->EvalMap.Map1Vertex3.Points );
|
||||
if (ctx->EvalMap.Map1Vertex4.Points)
|
||||
FREE( ctx->EvalMap.Map1Vertex4.Points );
|
||||
free( ctx->EvalMap.Map1Vertex4.Points );
|
||||
if (ctx->EvalMap.Map1Index.Points)
|
||||
FREE( ctx->EvalMap.Map1Index.Points );
|
||||
free( ctx->EvalMap.Map1Index.Points );
|
||||
if (ctx->EvalMap.Map1Color4.Points)
|
||||
FREE( ctx->EvalMap.Map1Color4.Points );
|
||||
free( ctx->EvalMap.Map1Color4.Points );
|
||||
if (ctx->EvalMap.Map1Normal.Points)
|
||||
FREE( ctx->EvalMap.Map1Normal.Points );
|
||||
free( ctx->EvalMap.Map1Normal.Points );
|
||||
if (ctx->EvalMap.Map1Texture1.Points)
|
||||
FREE( ctx->EvalMap.Map1Texture1.Points );
|
||||
free( ctx->EvalMap.Map1Texture1.Points );
|
||||
if (ctx->EvalMap.Map1Texture2.Points)
|
||||
FREE( ctx->EvalMap.Map1Texture2.Points );
|
||||
free( ctx->EvalMap.Map1Texture2.Points );
|
||||
if (ctx->EvalMap.Map1Texture3.Points)
|
||||
FREE( ctx->EvalMap.Map1Texture3.Points );
|
||||
free( ctx->EvalMap.Map1Texture3.Points );
|
||||
if (ctx->EvalMap.Map1Texture4.Points)
|
||||
FREE( ctx->EvalMap.Map1Texture4.Points );
|
||||
free( ctx->EvalMap.Map1Texture4.Points );
|
||||
for (i = 0; i < 16; i++)
|
||||
FREE((ctx->EvalMap.Map1Attrib[i].Points));
|
||||
free((ctx->EvalMap.Map1Attrib[i].Points));
|
||||
|
||||
if (ctx->EvalMap.Map2Vertex3.Points)
|
||||
FREE( ctx->EvalMap.Map2Vertex3.Points );
|
||||
free( ctx->EvalMap.Map2Vertex3.Points );
|
||||
if (ctx->EvalMap.Map2Vertex4.Points)
|
||||
FREE( ctx->EvalMap.Map2Vertex4.Points );
|
||||
free( ctx->EvalMap.Map2Vertex4.Points );
|
||||
if (ctx->EvalMap.Map2Index.Points)
|
||||
FREE( ctx->EvalMap.Map2Index.Points );
|
||||
free( ctx->EvalMap.Map2Index.Points );
|
||||
if (ctx->EvalMap.Map2Color4.Points)
|
||||
FREE( ctx->EvalMap.Map2Color4.Points );
|
||||
free( ctx->EvalMap.Map2Color4.Points );
|
||||
if (ctx->EvalMap.Map2Normal.Points)
|
||||
FREE( ctx->EvalMap.Map2Normal.Points );
|
||||
free( ctx->EvalMap.Map2Normal.Points );
|
||||
if (ctx->EvalMap.Map2Texture1.Points)
|
||||
FREE( ctx->EvalMap.Map2Texture1.Points );
|
||||
free( ctx->EvalMap.Map2Texture1.Points );
|
||||
if (ctx->EvalMap.Map2Texture2.Points)
|
||||
FREE( ctx->EvalMap.Map2Texture2.Points );
|
||||
free( ctx->EvalMap.Map2Texture2.Points );
|
||||
if (ctx->EvalMap.Map2Texture3.Points)
|
||||
FREE( ctx->EvalMap.Map2Texture3.Points );
|
||||
free( ctx->EvalMap.Map2Texture3.Points );
|
||||
if (ctx->EvalMap.Map2Texture4.Points)
|
||||
FREE( ctx->EvalMap.Map2Texture4.Points );
|
||||
free( ctx->EvalMap.Map2Texture4.Points );
|
||||
for (i = 0; i < 16; i++)
|
||||
FREE((ctx->EvalMap.Map2Attrib[i].Points));
|
||||
free((ctx->EvalMap.Map2Attrib[i].Points));
|
||||
}
|
||||
|
@@ -693,7 +693,7 @@ free_matrix_stack( struct gl_matrix_stack *stack )
|
||||
for (i = 0; i < stack->MaxDepth; i++) {
|
||||
_math_matrix_dtr(&stack->Stack[i]);
|
||||
}
|
||||
FREE(stack->Stack);
|
||||
free(stack->Stack);
|
||||
stack->Stack = stack->Top = NULL;
|
||||
}
|
||||
|
||||
|
@@ -155,7 +155,7 @@ void
|
||||
_mesa_delete_sampler_object(struct gl_context *ctx,
|
||||
struct gl_sampler_object *sampObj)
|
||||
{
|
||||
FREE(sampObj);
|
||||
free(sampObj);
|
||||
}
|
||||
|
||||
|
||||
|
@@ -1550,7 +1550,7 @@ _mesa_parse_nv_fragment_program(struct gl_context *ctx, GLenum dstTarget,
|
||||
/* 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;
|
||||
|
@@ -60,7 +60,7 @@ static void st_delete_sync_object(struct gl_context *ctx,
|
||||
struct st_sync_object *so = (struct st_sync_object*)obj;
|
||||
|
||||
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,
|
||||
|
@@ -4772,16 +4772,16 @@ st_translate_program(
|
||||
|
||||
out:
|
||||
if (t) {
|
||||
FREE(t->insn);
|
||||
FREE(t->labels);
|
||||
FREE(t->constants);
|
||||
FREE(t->immediates);
|
||||
free(t->insn);
|
||||
free(t->labels);
|
||||
free(t->constants);
|
||||
free(t->immediates);
|
||||
|
||||
if (t->error) {
|
||||
debug_printf("%s: translate error flag set\n", __FUNCTION__);
|
||||
}
|
||||
|
||||
FREE(t);
|
||||
free(t);
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
@@ -430,7 +430,7 @@ st_framebuffer_create(struct st_framebuffer_iface *stfbi)
|
||||
/* add the color buffer */
|
||||
idx = stfb->Base._ColorDrawBufferIndexes[0];
|
||||
if (!st_framebuffer_add_renderbuffer(stfb, idx)) {
|
||||
FREE(stfb);
|
||||
free(stfb);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@@ -1259,9 +1259,9 @@ st_translate_mesa_program(
|
||||
}
|
||||
|
||||
out:
|
||||
FREE(t->insn);
|
||||
FREE(t->labels);
|
||||
FREE(t->constants);
|
||||
free(t->insn);
|
||||
free(t->labels);
|
||||
free(t->constants);
|
||||
|
||||
if (t->error) {
|
||||
debug_printf("%s: translate error flag set\n", __FUNCTION__);
|
||||
@@ -1278,5 +1278,5 @@ out:
|
||||
void
|
||||
st_free_tokens(const struct tgsi_token *tokens)
|
||||
{
|
||||
FREE((void *)tokens);
|
||||
free((void *)tokens);
|
||||
}
|
||||
|
@@ -74,7 +74,7 @@ delete_vp_variant(struct st_context *st, struct st_vp_variant *vpv)
|
||||
if (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);
|
||||
if (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)
|
||||
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 );
|
||||
if (ureg == NULL) {
|
||||
FREE(vpv);
|
||||
free(vpv);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -676,7 +676,7 @@ st_translate_fragment_program(struct st_context *st,
|
||||
|
||||
ureg = ureg_create( TGSI_PROCESSOR_FRAGMENT );
|
||||
if (ureg == NULL) {
|
||||
FREE(variant);
|
||||
free(variant);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -836,7 +836,7 @@ st_translate_geometry_program(struct st_context *st,
|
||||
|
||||
ureg = ureg_create( TGSI_PROCESSOR_GEOMETRY );
|
||||
if (ureg == NULL) {
|
||||
FREE(gpv);
|
||||
free(gpv);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@@ -777,7 +777,7 @@ _swrast_CreateContext( struct gl_context *ctx )
|
||||
*/
|
||||
swrast->SpanArrays = (SWspanarrays *) malloc(maxThreads * sizeof(SWspanarrays));
|
||||
if (!swrast->SpanArrays) {
|
||||
FREE(swrast);
|
||||
free(swrast);
|
||||
return GL_FALSE;
|
||||
}
|
||||
for(i = 0; i < maxThreads; i++) {
|
||||
@@ -828,17 +828,17 @@ _swrast_DestroyContext( struct gl_context *ctx )
|
||||
_mesa_debug(ctx, "_swrast_DestroyContext\n");
|
||||
}
|
||||
|
||||
FREE( swrast->SpanArrays );
|
||||
free( swrast->SpanArrays );
|
||||
if (swrast->ZoomedArrays)
|
||||
FREE( swrast->ZoomedArrays );
|
||||
FREE( swrast->TexelBuffer );
|
||||
free( swrast->ZoomedArrays );
|
||||
free( swrast->TexelBuffer );
|
||||
|
||||
free(swrast->stencil_temp.buf1);
|
||||
free(swrast->stencil_temp.buf2);
|
||||
free(swrast->stencil_temp.buf3);
|
||||
free(swrast->stencil_temp.buf4);
|
||||
|
||||
FREE( swrast );
|
||||
free( swrast );
|
||||
|
||||
ctx->swrast_context = 0;
|
||||
}
|
||||
|
@@ -72,7 +72,7 @@ _swsetup_DestroyContext( struct gl_context *ctx )
|
||||
SScontext *swsetup = SWSETUP_CONTEXT(ctx);
|
||||
|
||||
if (swsetup) {
|
||||
FREE(swsetup);
|
||||
free(swsetup);
|
||||
ctx->swsetup_context = 0;
|
||||
}
|
||||
|
||||
|
@@ -116,7 +116,7 @@ _tnl_DestroyContext( struct gl_context *ctx )
|
||||
|
||||
_tnl_destroy_pipeline( ctx );
|
||||
|
||||
FREE(tnl);
|
||||
free(tnl);
|
||||
ctx->swtnl_context = NULL;
|
||||
}
|
||||
|
||||
|
@@ -259,7 +259,7 @@ free_fog_data(struct tnl_pipeline_stage *stage)
|
||||
struct fog_stage_data *store = FOG_STAGE_DATA(stage);
|
||||
if (store) {
|
||||
_mesa_vector4f_free( &store->fogcoord );
|
||||
FREE( store );
|
||||
free( store );
|
||||
stage->privatePtr = NULL;
|
||||
}
|
||||
}
|
||||
|
@@ -457,7 +457,7 @@ static void dtr( struct tnl_pipeline_stage *stage )
|
||||
_mesa_vector4f_free( &store->LitColor[1] );
|
||||
_mesa_vector4f_free( &store->LitSecondary[0] );
|
||||
_mesa_vector4f_free( &store->LitSecondary[1] );
|
||||
FREE( store );
|
||||
free( store );
|
||||
stage->privatePtr = NULL;
|
||||
}
|
||||
}
|
||||
|
@@ -546,7 +546,7 @@ dtr(struct tnl_pipeline_stage *stage)
|
||||
_mesa_vector4f_free( &store->ndcCoords );
|
||||
_mesa_align_free( store->clipmask );
|
||||
|
||||
FREE( store );
|
||||
free( store );
|
||||
stage->privatePtr = NULL;
|
||||
}
|
||||
}
|
||||
|
@@ -589,9 +589,9 @@ static void free_texgen_data( struct tnl_pipeline_stage *stage )
|
||||
_mesa_vector4f_free( &store->texcoord[i] );
|
||||
|
||||
|
||||
if (store->tmp_f) FREE( store->tmp_f );
|
||||
if (store->tmp_m) FREE( store->tmp_m );
|
||||
FREE( store );
|
||||
if (store->tmp_f) free( store->tmp_f );
|
||||
if (store->tmp_m) free( store->tmp_m );
|
||||
free( store );
|
||||
stage->privatePtr = NULL;
|
||||
}
|
||||
}
|
||||
|
@@ -110,7 +110,7 @@ static void free_texmat_data( struct tnl_pipeline_stage *stage )
|
||||
for (i = 0; i < MAX_TEXTURE_COORD_UNITS; i++)
|
||||
if (store->texcoord[i].data)
|
||||
_mesa_vector4f_free( &store->texcoord[i] );
|
||||
FREE( store );
|
||||
free( store );
|
||||
stage->privatePtr = NULL;
|
||||
}
|
||||
}
|
||||
|
@@ -265,7 +265,7 @@ static void dtr( struct tnl_pipeline_stage *stage )
|
||||
_mesa_vector4f_free( &store->clip );
|
||||
_mesa_vector4f_free( &store->proj );
|
||||
_mesa_align_free( store->clipmask );
|
||||
FREE(store);
|
||||
free(store);
|
||||
stage->privatePtr = NULL;
|
||||
stage->run = init_vertex_stage;
|
||||
}
|
||||
|
@@ -548,7 +548,7 @@ void _tnl_free_vertices( struct gl_context *ctx )
|
||||
|
||||
for (fp = vtx->fastpath ; fp ; fp = tmp) {
|
||||
tmp = fp->next;
|
||||
FREE(fp->attr);
|
||||
free(fp->attr);
|
||||
|
||||
/* KW: At the moment, fp->func is constrained to be allocated by
|
||||
* _mesa_exec_alloc(), as the hardwired fastpaths in
|
||||
@@ -557,7 +557,7 @@ void _tnl_free_vertices( struct gl_context *ctx )
|
||||
* module gets another overhaul.
|
||||
*/
|
||||
_mesa_exec_free((void *) fp->func);
|
||||
FREE(fp);
|
||||
free(fp);
|
||||
}
|
||||
|
||||
vtx->fastpath = NULL;
|
||||
|
@@ -223,7 +223,7 @@ void _vbo_DestroyContext( struct gl_context *ctx )
|
||||
vbo_exec_destroy(ctx);
|
||||
if (ctx->API == API_OPENGL)
|
||||
vbo_save_destroy(ctx);
|
||||
FREE(vbo);
|
||||
free(vbo);
|
||||
ctx->swtnl_im = NULL;
|
||||
}
|
||||
}
|
||||
|
@@ -101,13 +101,13 @@ void vbo_save_destroy( struct gl_context *ctx )
|
||||
|
||||
if (save->prim_store) {
|
||||
if ( --save->prim_store->refcount == 0 ) {
|
||||
FREE( save->prim_store );
|
||||
free(save->prim_store);
|
||||
save->prim_store = NULL;
|
||||
}
|
||||
if ( --save->vertex_store->refcount == 0 ) {
|
||||
_mesa_reference_buffer_object(ctx,
|
||||
&save->vertex_store->bufferobj, NULL);
|
||||
FREE( save->vertex_store );
|
||||
free(save->vertex_store);
|
||||
save->vertex_store = NULL;
|
||||
}
|
||||
}
|
||||
|
@@ -233,7 +233,7 @@ free_vertex_store(struct gl_context *ctx,
|
||||
_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);
|
||||
|
||||
if (--node->prim_store->refcount == 0)
|
||||
FREE(node->prim_store);
|
||||
free(node->prim_store);
|
||||
|
||||
if (node->current_data) {
|
||||
FREE(node->current_data);
|
||||
free(node->current_data);
|
||||
node->current_data = NULL;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user