{
__DRIimage *image;
- image = CALLOC(sizeof *image);
+ image = calloc(1, sizeof *image);
if (image == NULL)
return NULL;
}
irb = intel_renderbuffer(rb);
- image = CALLOC(sizeof *image);
+ image = calloc(1, sizeof *image);
if (image == NULL)
return NULL;
{
__DRIimage *image;
- image = CALLOC(sizeof *image);
+ image = calloc(1, sizeof *image);
if (image == NULL)
return NULL;
}
/* Allocate the private area */
- intelScreen = CALLOC(sizeof *intelScreen);
+ intelScreen = calloc(1, sizeof *intelScreen);
if (!intelScreen) {
fprintf(stderr, "\nERROR! Allocating private area failed\n");
return false;
assert(attachment == __DRI_BUFFER_FRONT_LEFT ||
attachment == __DRI_BUFFER_BACK_LEFT);
- intelBuffer = CALLOC(sizeof *intelBuffer);
+ intelBuffer = calloc(1, sizeof *intelBuffer);
if (intelBuffer == NULL)
return NULL;
assert(screen);
/* Allocate the R200 context */
- rmesa = (r200ContextPtr) CALLOC( sizeof(*rmesa) );
+ rmesa = (r200ContextPtr) calloc(1, sizeof(*rmesa));
if ( !rmesa ) {
*error = __DRI_CTX_ERROR_NO_MEMORY;
return GL_FALSE;
#define ALLOC_STATE( ATOM, CHK, SZ, NM, IDX ) \
do { \
rmesa->hw.ATOM.cmd_size = SZ; \
- rmesa->hw.ATOM.cmd = (GLuint *)CALLOC(SZ * sizeof(int)); \
- rmesa->hw.ATOM.lastcmd = (GLuint *)CALLOC(SZ * sizeof(int)); \
+ rmesa->hw.ATOM.cmd = (GLuint *) calloc(SZ, sizeof(int)); \
+ rmesa->hw.ATOM.lastcmd = (GLuint *) calloc(SZ, sizeof(int)); \
rmesa->hw.ATOM.name = NM; \
rmesa->hw.ATOM.idx = IDX; \
if (check_##CHK != check_never) { \
assert(screen);
/* Allocate the Radeon context */
- rmesa = (r100ContextPtr) CALLOC( sizeof(*rmesa) );
+ rmesa = (r100ContextPtr) calloc(1, sizeof(*rmesa));
if ( !rmesa ) {
*error = __DRI_CTX_ERROR_NO_MEMORY;
return GL_FALSE;
static inline void radeon_init_query_stateobj(radeonContextPtr radeon, int SZ)
{
radeon->query.queryobj.cmd_size = (SZ);
- radeon->query.queryobj.cmd = (uint32_t*)CALLOC((SZ) * sizeof(uint32_t));
+ radeon->query.queryobj.cmd = (uint32_t*) calloc(SZ, sizeof(uint32_t));
radeon->query.queryobj.name = "queryobj";
radeon->query.queryobj.idx = 0;
radeon->query.queryobj.check = radeon_check_query_active;
if (name == 0)
return NULL;
- image = CALLOC(sizeof *image);
+ image = calloc(1, sizeof *image);
if (image == NULL)
return NULL;
}
rrb = radeon_renderbuffer(rb);
- image = CALLOC(sizeof *image);
+ image = calloc(1, sizeof *image);
if (image == NULL)
return NULL;
__DRIimage *image;
radeonScreenPtr radeonScreen = screen->driverPrivate;
- image = CALLOC(sizeof *image);
+ image = calloc(1, sizeof *image);
if (image == NULL)
return NULL;
uint32_t device_id = 0;
/* Allocate the private area */
- screen = (radeonScreenPtr) CALLOC( sizeof(*screen) );
+ screen = (radeonScreenPtr) calloc(1, sizeof(*screen));
if ( !screen ) {
fprintf(stderr, "%s: Could not allocate memory for screen structure", __FUNCTION__);
fprintf(stderr, "leaving here\n");
#define ALLOC_STATE_IDX( ATOM, CHK, SZ, NM, FLAG, IDX ) \
do { \
rmesa->hw.ATOM.cmd_size = SZ; \
- rmesa->hw.ATOM.cmd = (GLuint *)CALLOC(SZ * sizeof(int)); \
- rmesa->hw.ATOM.lastcmd = (GLuint *)CALLOC(SZ * sizeof(int)); \
+ rmesa->hw.ATOM.cmd = (GLuint *) calloc(SZ, sizeof(int)); \
+ rmesa->hw.ATOM.lastcmd = (GLuint *) calloc(SZ, sizeof(int)); \
rmesa->hw.ATOM.name = NM; \
rmesa->hw.ATOM.is_tcl = FLAG; \
rmesa->hw.ATOM.check = check_##CHK; \
*/
struct gl_texture_image *radeonNewTextureImage(struct gl_context *ctx)
{
- return CALLOC(sizeof(radeon_texture_image));
+ return calloc(1, sizeof(radeon_texture_image));
}
FogCoordFuncs[6] = _gloffset_FogCoordfvEXT;
FogCoordFuncs[7] = _gloffset_FogCoorddvEXT;
- ctx->aelt_context = CALLOC( sizeof(AEcontext) );
+ ctx->aelt_context = calloc(1, sizeof(AEcontext));
if (!ctx->aelt_context)
return GL_FALSE;
stack->MaxDepth = maxDepth;
stack->DirtyFlag = dirtyFlag;
/* The stack */
- stack->Stack = (GLmatrix *) CALLOC(maxDepth * sizeof(GLmatrix));
+ stack->Stack = (GLmatrix *) calloc(maxDepth, sizeof(GLmatrix));
for (i = 0; i < maxDepth; i++) {
_math_matrix_ctr(&stack->Stack[i]);
}
* so we put all the translated regs in t->constants.
*/
if (proginfo->Parameters) {
- t->constants = (struct ureg_src *)CALLOC(proginfo->Parameters->NumParameters * sizeof(t->constants[0]));
+ t->constants = (struct ureg_src *)
+ calloc(proginfo->Parameters->NumParameters, sizeof(t->constants[0]));
if (t->constants == NULL) {
ret = PIPE_ERROR_OUT_OF_MEMORY;
goto out;
/* Emit immediate values.
*/
- t->immediates = (struct ureg_src *)CALLOC(program->num_immediates * sizeof(struct ureg_src));
+ t->immediates = (struct ureg_src *)
+ calloc(program->num_immediates, sizeof(struct ureg_src));
if (t->immediates == NULL) {
ret = PIPE_ERROR_OUT_OF_MEMORY;
goto out;
_swrast_CreateContext( struct gl_context *ctx )
{
GLuint i;
- SWcontext *swrast = (SWcontext *)CALLOC(sizeof(SWcontext));
+ SWcontext *swrast = (SWcontext *) calloc(1, sizeof(SWcontext));
#ifdef _OPENMP
const GLuint maxThreads = omp_get_max_threads();
#else
if (!swrast->ZoomedArrays) {
/* allocate on demand */
- swrast->ZoomedArrays = (SWspanarrays *) CALLOC(sizeof(SWspanarrays));
+ swrast->ZoomedArrays = (SWspanarrays *) calloc(1, sizeof(SWspanarrays));
if (!swrast->ZoomedArrays)
return;
}
GLboolean
_swsetup_CreateContext( struct gl_context *ctx )
{
- SScontext *swsetup = (SScontext *)CALLOC(sizeof(SScontext));
+ SScontext *swsetup = (SScontext *) calloc(1, sizeof(SScontext));
if (!swsetup)
return GL_FALSE;
/* Create the TNLcontext structure
*/
- ctx->swtnl_context = tnl = (TNLcontext *) CALLOC( sizeof(TNLcontext) );
+ ctx->swtnl_context = tnl = (TNLcontext *) calloc(1, sizeof(TNLcontext));
if (!tnl) {
return GL_FALSE;
struct vp_stage_data *store;
const GLuint size = VB->Size;
- stage->privatePtr = CALLOC(sizeof(*store));
+ stage->privatePtr = calloc(1, sizeof(*store));
store = VP_STAGE_DATA(stage);
if (!store)
return GL_FALSE;
struct texgen_stage_data *store;
GLuint i;
- stage->privatePtr = CALLOC(sizeof(*store));
+ stage->privatePtr = calloc(1, sizeof(*store));
store = TEXGEN_STAGE_DATA(stage);
if (!store)
return GL_FALSE;
struct texmat_stage_data *store;
GLuint i;
- stage->privatePtr = CALLOC(sizeof(*store));
+ stage->privatePtr = calloc(1, sizeof(*store));
store = TEXMAT_STAGE_DATA(stage);
if (!store)
return GL_FALSE;
struct vertex_stage_data *store;
GLuint size = VB->Size;
- stage->privatePtr = CALLOC(sizeof(*store));
+ stage->privatePtr = calloc(1, sizeof(*store));
store = VERTEX_STAGE_DATA(stage);
if (!store)
return GL_FALSE;