summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2008-02-06 09:35:33 -0700
committerBen Skeggs <skeggsb@gmail.com>2008-02-15 13:50:32 +1100
commit8ce9d29df9a8b0a43c60d946c85e2c871e12e911 (patch)
treeaab11dea4df20c4a444f21289e6d08c8bb5e19c9 /src
parent2a3b31c1c4e73529c93476161973dae13b31aee5 (diff)
Cell: use mem_dup()
Diffstat (limited to 'src')
-rw-r--r--src/mesa/pipe/cell/ppu/cell_state_blend.c9
-rw-r--r--src/mesa/pipe/cell/ppu/cell_state_sampler.c4
2 files changed, 3 insertions, 10 deletions
diff --git a/src/mesa/pipe/cell/ppu/cell_state_blend.c b/src/mesa/pipe/cell/ppu/cell_state_blend.c
index 2c19aa3971..4fc60548c8 100644
--- a/src/mesa/pipe/cell/ppu/cell_state_blend.c
+++ b/src/mesa/pipe/cell/ppu/cell_state_blend.c
@@ -39,9 +39,7 @@ void *
cell_create_blend_state(struct pipe_context *pipe,
const struct pipe_blend_state *blend)
{
- struct pipe_blend_state *state = MALLOC(sizeof(struct pipe_blend_state));
- memcpy(state, blend, sizeof(struct pipe_blend_state));
- return state;
+ return mem_dup(blend, sizeof(*blend));
}
@@ -85,10 +83,7 @@ void *
cell_create_depth_stencil_alpha_state(struct pipe_context *pipe,
const struct pipe_depth_stencil_alpha_state *depth_stencil)
{
- struct pipe_depth_stencil_alpha_state *state =
- MALLOC(sizeof(struct pipe_depth_stencil_alpha_state));
- memcpy(state, depth_stencil, sizeof(struct pipe_depth_stencil_alpha_state));
- return state;
+ return mem_dup(depth_stencil, sizeof(*depth_stencil));
}
diff --git a/src/mesa/pipe/cell/ppu/cell_state_sampler.c b/src/mesa/pipe/cell/ppu/cell_state_sampler.c
index 317f7603bb..ade6cc8338 100644
--- a/src/mesa/pipe/cell/ppu/cell_state_sampler.c
+++ b/src/mesa/pipe/cell/ppu/cell_state_sampler.c
@@ -40,9 +40,7 @@ void *
cell_create_sampler_state(struct pipe_context *pipe,
const struct pipe_sampler_state *sampler)
{
- struct pipe_sampler_state *state = MALLOC( sizeof(struct pipe_sampler_state) );
- memcpy(state, sampler, sizeof(struct pipe_sampler_state));
- return state;
+ return mem_dup(sampler, sizeof(*sampler));
}
void