gallium: s/free/FREE/ and same for friends.
authorJosé Fonseca <jfonseca@vmware.com>
Fri, 23 Apr 2010 20:52:44 +0000 (21:52 +0100)
committerJosé Fonseca <jfonseca@vmware.com>
Fri, 23 Apr 2010 20:53:08 +0000 (21:53 +0100)
Based on Stephen Johnson's feedback.

src/gallium/auxiliary/util/u_surfaces.c
src/gallium/drivers/failover/fo_context.c
src/gallium/drivers/failover/fo_state.c
src/gallium/drivers/i965/brw_curbe.c
src/gallium/drivers/i965/brw_state_batch.c
src/gallium/drivers/identity/id_context.c
src/gallium/drivers/identity/id_drm.c
src/gallium/drivers/llvmpipe/lp_scene.c
src/gallium/drivers/trace/tr_context.c
src/gallium/drivers/trace/tr_drm.c
src/gallium/winsys/i915/sw/i915_sw_buffer.c

index 0be4609a2076720786122a09bb4e2694b8a02f36..0248120f5571f9346f66aec0d27308ffb3c3691e 100644 (file)
@@ -105,7 +105,7 @@ util_surfaces_destroy(struct util_surfaces *us, struct pipe_resource *pt, void (
            if(ps)
               destroy_surface(ps);
         }
-        free(us->u.array);
+        FREE(us->u.array);
         us->u.array = NULL;
       }
    }
index 236c50f4d98ab8f354005fd8c95f93115306c440..9515cd8938c5d76449c6b02889870bb036561f25 100644 (file)
@@ -39,7 +39,7 @@ static void failover_destroy( struct pipe_context *pipe )
 {
    struct failover_context *failover = failover_context( pipe );
 
-   free( failover );
+   FREE( failover );
 }
 
 
index b682ce6750e2bb797b90fb23a60ee3b4ecffca3b..ff6c59f410964e3cf8731bd4860518dda44bfc78 100644 (file)
@@ -53,7 +53,7 @@ static void *
 failover_create_blend_state( struct pipe_context *pipe,
                              const struct pipe_blend_state *blend )
 {
-   struct fo_state *state = malloc(sizeof(struct fo_state));
+   struct fo_state *state = MALLOC(sizeof(struct fo_state));
    struct failover_context *failover = failover_context(pipe);
 
    state->sw_state = failover->sw->create_blend_state(failover->sw, blend);
@@ -85,7 +85,7 @@ failover_delete_blend_state( struct pipe_context *pipe,
    failover->hw->delete_blend_state(failover->hw, state->hw_state);
    state->sw_state = 0;
    state->hw_state = 0;
-   free(state);
+   FREE(state);
 }
 
 static void
@@ -129,7 +129,7 @@ static void *
 failover_create_depth_stencil_state(struct pipe_context *pipe,
                               const struct pipe_depth_stencil_alpha_state *templ)
 {
-   struct fo_state *state = malloc(sizeof(struct fo_state));
+   struct fo_state *state = MALLOC(sizeof(struct fo_state));
    struct failover_context *failover = failover_context(pipe);
 
    state->sw_state = failover->sw->create_depth_stencil_alpha_state(failover->sw, templ);
@@ -161,7 +161,7 @@ failover_delete_depth_stencil_state(struct pipe_context *pipe,
    failover->hw->delete_depth_stencil_alpha_state(failover->hw, state->hw_state);
    state->sw_state = 0;
    state->hw_state = 0;
-   free(state);
+   FREE(state);
 }
 
 static void
@@ -181,7 +181,7 @@ static void *
 failover_create_fs_state(struct pipe_context *pipe,
                          const struct pipe_shader_state *templ)
 {
-   struct fo_state *state = malloc(sizeof(struct fo_state));
+   struct fo_state *state = MALLOC(sizeof(struct fo_state));
    struct failover_context *failover = failover_context(pipe);
 
    state->sw_state = failover->sw->create_fs_state(failover->sw, templ);
@@ -212,14 +212,14 @@ failover_delete_fs_state(struct pipe_context *pipe,
    failover->hw->delete_fs_state(failover->hw, state->hw_state);
    state->sw_state = 0;
    state->hw_state = 0;
-   free(state);
+   FREE(state);
 }
 
 static void *
 failover_create_vs_state(struct pipe_context *pipe,
                          const struct pipe_shader_state *templ)
 {
-   struct fo_state *state = malloc(sizeof(struct fo_state));
+   struct fo_state *state = MALLOC(sizeof(struct fo_state));
    struct failover_context *failover = failover_context(pipe);
 
    state->sw_state = failover->sw->create_vs_state(failover->sw, templ);
@@ -252,7 +252,7 @@ failover_delete_vs_state(struct pipe_context *pipe,
    failover->hw->delete_vs_state(failover->hw, state->hw_state);
    state->sw_state = 0;
    state->hw_state = 0;
-   free(state);
+   FREE(state);
 }
 
 
@@ -262,7 +262,7 @@ failover_create_vertex_elements_state( struct pipe_context *pipe,
                                        unsigned count,
                                        const struct pipe_vertex_element *velems )
 {
-   struct fo_state *state = malloc(sizeof(struct fo_state));
+   struct fo_state *state = MALLOC(sizeof(struct fo_state));
    struct failover_context *failover = failover_context(pipe);
 
    state->sw_state = failover->sw->create_vertex_elements_state(failover->sw, count, velems);
@@ -295,7 +295,7 @@ failover_delete_vertex_elements_state( struct pipe_context *pipe,
    failover->hw->delete_vertex_elements_state(failover->hw, state->hw_state);
    state->sw_state = 0;
    state->hw_state = 0;
-   free(state);
+   FREE(state);
 }
 
 static void 
@@ -315,7 +315,7 @@ static void *
 failover_create_rasterizer_state(struct pipe_context *pipe,
                                  const struct pipe_rasterizer_state *templ)
 {
-   struct fo_state *state = malloc(sizeof(struct fo_state));
+   struct fo_state *state = MALLOC(sizeof(struct fo_state));
    struct failover_context *failover = failover_context(pipe);
 
    state->sw_state = failover->sw->create_rasterizer_state(failover->sw, templ);
@@ -348,7 +348,7 @@ failover_delete_rasterizer_state(struct pipe_context *pipe,
    failover->hw->delete_rasterizer_state(failover->hw, state->hw_state);
    state->sw_state = 0;
    state->hw_state = 0;
-   free(state);
+   FREE(state);
 }
 
 
@@ -369,7 +369,7 @@ static void *
 failover_create_sampler_state(struct pipe_context *pipe,
                               const struct pipe_sampler_state *templ)
 {
-   struct fo_state *state = malloc(sizeof(struct fo_state));
+   struct fo_state *state = MALLOC(sizeof(struct fo_state));
    struct failover_context *failover = failover_context(pipe);
 
    state->sw_state = failover->sw->create_sampler_state(failover->sw, templ);
@@ -443,7 +443,7 @@ failover_delete_sampler_state(struct pipe_context *pipe, void *sampler)
    failover->hw->delete_sampler_state(failover->hw, state->hw_state);
    state->sw_state = 0;
    state->hw_state = 0;
-   free(state);
+   FREE(state);
 }
 
 
@@ -452,7 +452,7 @@ failover_create_sampler_view(struct pipe_context *pipe,
                              struct pipe_resource *texture,
                              const struct pipe_sampler_view *templ)
 {
-   struct fo_sampler_view *view = malloc(sizeof(struct fo_sampler_view));
+   struct fo_sampler_view *view = MALLOC(sizeof(struct fo_sampler_view));
    struct failover_context *failover = failover_context(pipe);
 
    view->sw = failover->sw->create_sampler_view(failover->sw, texture, templ);
@@ -478,7 +478,7 @@ failover_sampler_view_destroy(struct pipe_context *pipe,
    failover->hw->sampler_view_destroy(failover->hw, fo_view->hw);
 
    pipe_resource_reference(&fo_view->base.texture, NULL);
-   free(fo_view);
+   FREE(fo_view);
 }
 
 static void
index 323af16b145270686a1307887351bf03f30d40ff..a701de33f5dd95b99f65006ae535ed722c40c08b 100644 (file)
@@ -168,7 +168,7 @@ static enum pipe_error prepare_curbe_buffer(struct brw_context *brw)
 
    if (sz == 0) {
       if (brw->curbe.last_buf) {
-        free(brw->curbe.last_buf);
+        FREE(brw->curbe.last_buf);
         brw->curbe.last_buf = NULL;
         brw->curbe.last_bufsz  = 0;
       }
index 7d212e5c247a50ca1ca73ca30529e0f47ec04e30..ce5ed0a9ed2c025c277f511dbe73ea8d0adbb211 100644 (file)
@@ -84,8 +84,8 @@ void brw_clear_batch_cache( struct brw_context *brw )
 
    while (item) {
       struct brw_cached_batch_item *next = item->next;
-      free((void *)item->header);
-      free(item);
+      FREE((void *)item->header);
+      FREE(item);
       item = next;
    }
 
index 630cdb5e4916424317f87b6494d442790038b88d..0bc8bf21966b5d2b847f8de109d7cf363f8609f5 100644 (file)
@@ -42,7 +42,7 @@ identity_destroy(struct pipe_context *_pipe)
 
    pipe->destroy(pipe);
 
-   free(id_pipe);
+   FREE(id_pipe);
 }
 
 static void
@@ -708,7 +708,7 @@ identity_create_sampler_view(struct pipe_context *pipe,
    struct identity_resource *id_resource = identity_resource(texture);
    struct pipe_context *pipe_unwrapped = id_pipe->pipe;
    struct pipe_resource *texture_unwrapped = id_resource->resource;
-   struct identity_sampler_view *view = malloc(sizeof(struct identity_sampler_view));
+   struct identity_sampler_view *view = MALLOC(sizeof(struct identity_sampler_view));
 
    view->sampler_view = pipe_unwrapped->create_sampler_view(pipe_unwrapped,
                                                             texture_unwrapped,
@@ -736,7 +736,7 @@ identity_sampler_view_destroy(struct pipe_context *pipe,
                                         view_unwrapped);
 
    pipe_resource_reference(&view->texture, NULL);
-   free(view);
+   FREE(view);
 }
 
 static struct pipe_transfer *
index d332c36af261eb35cfca86b12f73f68b807d7415..a9d41af18c7d7887721fc43e0a457414270f8209 100644 (file)
@@ -68,7 +68,7 @@ identity_drm_destroy(struct drm_api *_api)
    struct drm_api *api = id_api->api;
    api->destroy(api);
 
-   free(id_api);
+   FREE(id_api);
 }
 
 struct drm_api *
index 0b185c4c412717f58f51bea4ad128bff2fd59cca..71d9529230be70e4f9ec86522cea5274b00145fe 100644 (file)
@@ -74,7 +74,7 @@ lp_scene_create( struct pipe_context *pipe,
 
 
 /**
- * Free all data associated with the given scene, and free(scene).
+ * Free all data associated with the given scene, and the scene itself.
  */
 void
 lp_scene_destroy(struct lp_scene *scene)
index 8216c06260f2c2c2d4e67ad651043bf304ef9cf3..71ba1e909dfabbcfb92290674221b3ede7bc04ee 100644 (file)
@@ -1142,12 +1142,12 @@ trace_context_set_vertex_buffers(struct pipe_context *_pipe,
    trace_dump_arg_end();
 
    if (num_buffers) {
-      struct pipe_vertex_buffer *_buffers = malloc(num_buffers * sizeof(*_buffers));
+      struct pipe_vertex_buffer *_buffers = MALLOC(num_buffers * sizeof(*_buffers));
       memcpy(_buffers, buffers, num_buffers * sizeof(*_buffers));
       for (i = 0; i < num_buffers; i++)
          _buffers[i].buffer = trace_resource_unwrap(tr_ctx, buffers[i].buffer);
       pipe->set_vertex_buffers(pipe, num_buffers, _buffers);
-      free(_buffers);
+      FREE(_buffers);
    } else {
       pipe->set_vertex_buffers(pipe, num_buffers, NULL);
    }
index eaa47df4066e28c8cc820ac6ff411c3f52ce651c..0dc8cca2648232faa7fa87785b57610a544b00fb 100644 (file)
@@ -73,7 +73,7 @@ trace_drm_destroy(struct drm_api *_api)
    if (api->destroy)
       api->destroy(api);
 
-   free(tr_api);
+   FREE(tr_api);
 }
 
 struct drm_api *
index 9a27da5e1a27b9dce6904a06bd9b00b26bfe144d..df175688861579fd04a74ff36f24096a4131ecb9 100644 (file)
@@ -27,7 +27,7 @@ i915_sw_buffer_create(struct i915_winsys *iws,
    buf->magic = 0xDEAD1337;
    buf->name = name;
    buf->type = type;
-   buf->ptr = calloc(size, 1);
+   buf->ptr = CALLOC(size, 1);
 
    if (!buf->ptr)
       goto err;