diff options
author | Younes Manton <[email protected]> | 2008-12-20 17:09:55 -0500 |
---|---|---|
committer | Younes Manton <[email protected]> | 2009-01-10 13:52:07 -0500 |
commit | 1e9c3efcc783cee46268cc227234ed118f0cc08b (patch) | |
tree | ffbd201fa2eae04348797d74e2124f739858fe3d /src/gallium/state_trackers | |
parent | db1021a37c29a60c70ce294077680ca3e98a6460 (diff) |
g3dvl: Use Gallium MALLOC wrappers.
Diffstat (limited to 'src/gallium/state_trackers')
-rw-r--r-- | src/gallium/state_trackers/g3dvl/Makefile | 5 | ||||
-rw-r--r-- | src/gallium/state_trackers/g3dvl/vl_basic_csc.c | 14 | ||||
-rw-r--r-- | src/gallium/state_trackers/g3dvl/vl_context.c | 6 | ||||
-rw-r--r-- | src/gallium/state_trackers/g3dvl/vl_display.c | 6 | ||||
-rw-r--r-- | src/gallium/state_trackers/g3dvl/vl_r16snorm_mc_buf.c | 10 | ||||
-rw-r--r-- | src/gallium/state_trackers/g3dvl/vl_screen.c | 6 | ||||
-rw-r--r-- | src/gallium/state_trackers/g3dvl/vl_surface.c | 6 |
7 files changed, 28 insertions, 25 deletions
diff --git a/src/gallium/state_trackers/g3dvl/Makefile b/src/gallium/state_trackers/g3dvl/Makefile index 84a0b2c6d8c..cddfca54fe5 100644 --- a/src/gallium/state_trackers/g3dvl/Makefile +++ b/src/gallium/state_trackers/g3dvl/Makefile @@ -3,7 +3,10 @@ OBJECTS = vl_display.o vl_screen.o vl_context.o vl_surface.o vl_shader_build.o vl_r16snorm_mc_buf.o GALLIUMDIR = ../.. -CFLAGS += -g -Wall -fPIC -I${GALLIUMDIR}/include -I${GALLIUMDIR}/auxiliary -I${GALLIUMDIR}/winsys/g3dvl +CFLAGS += -g -Wall -Werror=implicit-function-declaration -fPIC \ + -I${GALLIUMDIR}/include \ + -I${GALLIUMDIR}/auxiliary \ + -I${GALLIUMDIR}/winsys/g3dvl \ ############################################# diff --git a/src/gallium/state_trackers/g3dvl/vl_basic_csc.c b/src/gallium/state_trackers/g3dvl/vl_basic_csc.c index 626d23cd468..3ce93cf49d1 100644 --- a/src/gallium/state_trackers/g3dvl/vl_basic_csc.c +++ b/src/gallium/state_trackers/g3dvl/vl_basic_csc.c @@ -1,13 +1,13 @@ #define VL_INTERNAL #include "vl_basic_csc.h" #include <assert.h> -#include <stdlib.h> #include <pipe/p_context.h> #include <pipe/p_winsys.h> #include <pipe/p_state.h> #include <pipe/p_inlines.h> #include <tgsi/tgsi_parse.h> #include <tgsi/tgsi_build.h> +#include <util/u_memory.h> #include "vl_csc.h" #include "vl_surface.h" #include "vl_shader_build.h" @@ -237,7 +237,7 @@ static int vlDestroy pipe->winsys->buffer_destroy(pipe->winsys, basic_csc->vs_const_buf.buffer); pipe->winsys->buffer_destroy(pipe->winsys, basic_csc->fs_const_buf.buffer); - free(basic_csc); + FREE(basic_csc); return 0; } @@ -369,7 +369,7 @@ static int vlCreateVertexShader assert(context); pipe = csc->pipe; - tokens = (struct tgsi_token*)malloc(max_tokens * sizeof(struct tgsi_token)); + tokens = (struct tgsi_token*)MALLOC(max_tokens * sizeof(struct tgsi_token)); /* Version */ *(struct tgsi_version*)&tokens[0] = tgsi_build_version(); @@ -430,7 +430,7 @@ static int vlCreateVertexShader vs.tokens = tokens; csc->vertex_shader = pipe->create_vs_state(pipe, &vs); - free(tokens); + FREE(tokens); return 0; } @@ -456,7 +456,7 @@ static int vlCreateFragmentShader assert(context); pipe = csc->pipe; - tokens = (struct tgsi_token*)malloc(max_tokens * sizeof(struct tgsi_token)); + tokens = (struct tgsi_token*)MALLOC(max_tokens * sizeof(struct tgsi_token)); /* Version */ *(struct tgsi_version*)&tokens[0] = tgsi_build_version(); @@ -517,7 +517,7 @@ static int vlCreateFragmentShader fs.tokens = tokens; csc->fragment_shader = pipe->create_fs_state(pipe, &fs); - free(tokens); + FREE(tokens); return 0; } @@ -691,7 +691,7 @@ int vlCreateBasicCSC assert(pipe); assert(csc); - basic_csc = calloc(1, sizeof(struct vlBasicCSC)); + basic_csc = CALLOC_STRUCT(vlBasicCSC); if (!basic_csc) return 1; diff --git a/src/gallium/state_trackers/g3dvl/vl_context.c b/src/gallium/state_trackers/g3dvl/vl_context.c index 5b7bb73b39e..fbea1363d87 100644 --- a/src/gallium/state_trackers/g3dvl/vl_context.c +++ b/src/gallium/state_trackers/g3dvl/vl_context.c @@ -1,9 +1,9 @@ #define VL_INTERNAL #include "vl_context.h" #include <assert.h> -#include <stdlib.h> #include <pipe/p_context.h> #include <pipe/p_state.h> +#include <util/u_memory.h> #include "vl_render.h" #include "vl_r16snorm_mc_buf.h" #include "vl_csc.h" @@ -111,7 +111,7 @@ int vlCreateContext assert(context); assert(pipe); - ctx = calloc(1, sizeof(struct vlContext)); + ctx = CALLOC_STRUCT(vlContext); if (!ctx) return 1; @@ -152,7 +152,7 @@ int vlDestroyContext context->pipe->delete_rasterizer_state(context->pipe, context->raster); context->pipe->delete_depth_stencil_alpha_state(context->pipe, context->dsa); - free(context); + FREE(context); return 0; } diff --git a/src/gallium/state_trackers/g3dvl/vl_display.c b/src/gallium/state_trackers/g3dvl/vl_display.c index af80faa7f52..dce06de7583 100644 --- a/src/gallium/state_trackers/g3dvl/vl_display.c +++ b/src/gallium/state_trackers/g3dvl/vl_display.c @@ -1,7 +1,7 @@ #define VL_INTERNAL #include "vl_display.h" #include <assert.h> -#include <stdlib.h> +#include <util/u_memory.h> int vlCreateDisplay ( @@ -14,7 +14,7 @@ int vlCreateDisplay assert(native_display); assert(display); - dpy = calloc(1, sizeof(struct vlDisplay)); + dpy = CALLOC_STRUCT(vlDisplay); if (!dpy) return 1; @@ -32,7 +32,7 @@ int vlDestroyDisplay { assert(display); - free(display); + FREE(display); return 0; } diff --git a/src/gallium/state_trackers/g3dvl/vl_r16snorm_mc_buf.c b/src/gallium/state_trackers/g3dvl/vl_r16snorm_mc_buf.c index a31f5c58f46..fcea899ef9c 100644 --- a/src/gallium/state_trackers/g3dvl/vl_r16snorm_mc_buf.c +++ b/src/gallium/state_trackers/g3dvl/vl_r16snorm_mc_buf.c @@ -1,7 +1,6 @@ #define VL_INTERNAL #include "vl_r16snorm_mc_buf.h" #include <assert.h> -#include <stdlib.h> #include <pipe/p_context.h> #include <pipe/p_winsys.h> #include <pipe/p_screen.h> @@ -10,6 +9,7 @@ #include <tgsi/tgsi_parse.h> #include <tgsi/tgsi_build.h> #include <util/u_math.h> +#include <util/u_memory.h> #include "vl_render.h" #include "vl_shader_build.h" #include "vl_surface.h" @@ -869,8 +869,8 @@ static int vlDestroy pipe->winsys->buffer_destroy(pipe->winsys, mc->vs_const_buf.buffer); pipe->winsys->buffer_destroy(pipe->winsys, mc->fs_const_buf.buffer); - free(mc->macroblocks); - free(mc); + FREE(mc->macroblocks); + FREE(mc); return 0; } @@ -1007,7 +1007,7 @@ static int vlCreateDataBufs pipe->winsys->buffer_unmap(pipe->winsys, mc->fs_const_buf.buffer); - mc->macroblocks = malloc(sizeof(struct vlMpeg2MacroBlock) * mc->macroblocks_per_picture); + mc->macroblocks = MALLOC(sizeof(struct vlMpeg2MacroBlock) * mc->macroblocks_per_picture); return 0; } @@ -1133,7 +1133,7 @@ int vlCreateR16SNormBufferedMC assert(pipe); assert(render); - mc = calloc(1, sizeof(struct vlR16SnormBufferedMC)); + mc = CALLOC_STRUCT(vlR16SnormBufferedMC); mc->base.vlBegin = &vlBegin; mc->base.vlRenderMacroBlocksMpeg2 = &vlRenderMacroBlocksMpeg2R16SnormBuffered; diff --git a/src/gallium/state_trackers/g3dvl/vl_screen.c b/src/gallium/state_trackers/g3dvl/vl_screen.c index 484f63b0d4d..ade8643a66a 100644 --- a/src/gallium/state_trackers/g3dvl/vl_screen.c +++ b/src/gallium/state_trackers/g3dvl/vl_screen.c @@ -1,7 +1,7 @@ #define VL_INTERNAL #include "vl_screen.h" #include <assert.h> -#include <stdlib.h> +#include <util/u_memory.h> int vlCreateScreen ( @@ -17,7 +17,7 @@ int vlCreateScreen assert(pscreen); assert(vl_screen); - scrn = calloc(1, sizeof(struct vlScreen)); + scrn = CALLOC_STRUCT(vlScreen); if (!scrn) return 1; @@ -37,7 +37,7 @@ int vlDestroyScreen { assert(screen); - free(screen); + FREE(screen); return 0; } diff --git a/src/gallium/state_trackers/g3dvl/vl_surface.c b/src/gallium/state_trackers/g3dvl/vl_surface.c index 076bd40d414..911469f966a 100644 --- a/src/gallium/state_trackers/g3dvl/vl_surface.c +++ b/src/gallium/state_trackers/g3dvl/vl_surface.c @@ -1,11 +1,11 @@ #define VL_INTERNAL #include "vl_surface.h" #include <assert.h> -#include <stdlib.h> #include <string.h> #include <pipe/p_screen.h> #include <pipe/p_state.h> #include <pipe/p_inlines.h> +#include <util/u_memory.h> #include <vl_winsys.h> #include "vl_screen.h" #include "vl_context.h" @@ -28,7 +28,7 @@ int vlCreateSurface assert(screen); assert(surface); - sfc = calloc(1, sizeof(struct vlSurface)); + sfc = CALLOC_STRUCT(vlSurface); if (!sfc) return 1; @@ -64,7 +64,7 @@ int vlDestroySurface assert(surface); pipe_texture_release(&surface->texture); - free(surface); + FREE(surface); return 0; } |