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 \
#############################################
#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"
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;
}
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();
vs.tokens = tokens;
csc->vertex_shader = pipe->create_vs_state(pipe, &vs);
- free(tokens);
+ FREE(tokens);
return 0;
}
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();
fs.tokens = tokens;
csc->fragment_shader = pipe->create_fs_state(pipe, &fs);
- free(tokens);
+ FREE(tokens);
return 0;
}
assert(pipe);
assert(csc);
- basic_csc = calloc(1, sizeof(struct vlBasicCSC));
+ basic_csc = CALLOC_STRUCT(vlBasicCSC);
if (!basic_csc)
return 1;
#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"
assert(context);
assert(pipe);
- ctx = calloc(1, sizeof(struct vlContext));
+ ctx = CALLOC_STRUCT(vlContext);
if (!ctx)
return 1;
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;
}
#define VL_INTERNAL
#include "vl_display.h"
#include <assert.h>
-#include <stdlib.h>
+#include <util/u_memory.h>
int vlCreateDisplay
(
assert(native_display);
assert(display);
- dpy = calloc(1, sizeof(struct vlDisplay));
+ dpy = CALLOC_STRUCT(vlDisplay);
if (!dpy)
return 1;
{
assert(display);
- free(display);
+ FREE(display);
return 0;
}
#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>
#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"
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;
}
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;
}
assert(pipe);
assert(render);
- mc = calloc(1, sizeof(struct vlR16SnormBufferedMC));
+ mc = CALLOC_STRUCT(vlR16SnormBufferedMC);
mc->base.vlBegin = &vlBegin;
mc->base.vlRenderMacroBlocksMpeg2 = &vlRenderMacroBlocksMpeg2R16SnormBuffered;
#define VL_INTERNAL
#include "vl_screen.h"
#include <assert.h>
-#include <stdlib.h>
+#include <util/u_memory.h>
int vlCreateScreen
(
assert(pscreen);
assert(vl_screen);
- scrn = calloc(1, sizeof(struct vlScreen));
+ scrn = CALLOC_STRUCT(vlScreen);
if (!scrn)
return 1;
{
assert(screen);
- free(screen);
+ FREE(screen);
return 0;
}
#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"
assert(screen);
assert(surface);
- sfc = calloc(1, sizeof(struct vlSurface));
+ sfc = CALLOC_STRUCT(vlSurface);
if (!sfc)
return 1;
assert(surface);
pipe_texture_release(&surface->texture);
- free(surface);
+ FREE(surface);
return 0;
}
OBJECTS += ${GALLIUMDIR}/winsys/g3dvl/xsp_winsys.o
endif
-CFLAGS += -g -fPIC -Wall \
+CFLAGS += -g -fPIC -Wall -Werror=implicit-function-declaration \
-I${GALLIUMDIR}/state_trackers/g3dvl \
-I${GALLIUMDIR}/winsys/g3dvl \
-I${GALLIUMDIR}/include \
#include <assert.h>
-#include <stdlib.h>
#include <X11/Xlib.h>
#include <X11/extensions/XvMC.h>
+#include <util/u_memory.h>
#include <vl_display.h>
#include <vl_screen.h>
#include <vl_context.h>
blocks->context_id = context->context_id;
blocks->num_blocks = num_blocks;
- blocks->blocks = malloc(BLOCK_SIZE * num_blocks);
+ blocks->blocks = MALLOC(BLOCK_SIZE * num_blocks);
/* Since we don't have a VL type for blocks, set privData to the display so we can catch mismatches */
blocks->privData = display;
assert(display);
assert(blocks);
assert(display == blocks->privData);
- free(blocks->blocks);
+ FREE(blocks->blocks);
return Success;
}
blocks->context_id = context->context_id;
blocks->num_blocks = num_blocks;
- blocks->macro_blocks = malloc(sizeof(XvMCMacroBlock) * num_blocks);
+ blocks->macro_blocks = MALLOC(sizeof(XvMCMacroBlock) * num_blocks);
/* Since we don't have a VL type for blocks, set privData to the display so we can catch mismatches */
blocks->privData = display;
assert(display);
assert(blocks);
assert(display == blocks->privData);
- free(blocks->macro_blocks);
+ FREE(blocks->macro_blocks);
return Success;
}