(void) args;
- dri2_drv = malloc(sizeof *dri2_drv);
+ dri2_drv = calloc(1, sizeof *dri2_drv);
if (!dri2_drv)
return NULL;
- memset(dri2_drv, 0, sizeof *dri2_drv);
-
if (!dri2_load(&dri2_drv->base)) {
free(dri2_drv);
return NULL;
(void) drv;
- dri2_surf = malloc(sizeof *dri2_surf);
+ dri2_surf = calloc(1, sizeof *dri2_surf);
if (!dri2_surf) {
_eglError(EGL_BAD_ALLOC, "dri2_create_surface");
return NULL;
}
- memset(dri2_surf, 0, sizeof *dri2_surf);
if (!_eglInitSurface(&dri2_surf->base, disp, type, conf, attrib_list))
goto cleanup_surf;
int fd = -1;
int i;
- dri2_dpy = malloc(sizeof *dri2_dpy);
+ dri2_dpy = calloc(1, sizeof *dri2_dpy);
if (!dri2_dpy)
return _eglError(EGL_BAD_ALLOC, "eglInitialize");
- memset(dri2_dpy, 0, sizeof *dri2_dpy);
-
disp->DriverData = (void *) dri2_dpy;
gbm = disp->PlatformDisplay;
drv->API.CreateImageKHR = dri2_wayland_create_image_khr;
drv->API.Terminate = dri2_terminate;
- dri2_dpy = malloc(sizeof *dri2_dpy);
+ dri2_dpy = calloc(1, sizeof *dri2_dpy);
if (!dri2_dpy)
return _eglError(EGL_BAD_ALLOC, "eglInitialize");
- memset(dri2_dpy, 0, sizeof *dri2_dpy);
-
disp->DriverData = (void *) dri2_dpy;
if (disp->PlatformDisplay == NULL) {
dri2_dpy->wl_dpy = wl_display_connect(NULL);
drv->API.CreateDRMImageMESA = NULL;
drv->API.ExportDRMImageMESA = NULL;
- dri2_dpy = malloc(sizeof *dri2_dpy);
+ dri2_dpy = calloc(1, sizeof *dri2_dpy);
if (!dri2_dpy)
return _eglError(EGL_BAD_ALLOC, "eglInitialize");
- memset(dri2_dpy, 0, sizeof *dri2_dpy);
-
disp->DriverData = (void *) dri2_dpy;
if (disp->PlatformDisplay == NULL) {
dri2_dpy->conn = xcb_connect(0, 0);
drv->API.PostSubBufferNV = dri2_post_sub_buffer;
drv->API.SwapInterval = dri2_swap_interval;
- dri2_dpy = malloc(sizeof *dri2_dpy);
+ dri2_dpy = calloc(1, sizeof *dri2_dpy);
if (!dri2_dpy)
return _eglError(EGL_BAD_ALLOC, "eglInitialize");
- memset(dri2_dpy, 0, sizeof *dri2_dpy);
-
disp->DriverData = (void *) dri2_dpy;
if (disp->PlatformDisplay == NULL) {
dri2_dpy->conn = xcb_connect(0, 0);
{
struct glx_screen *psc;
- psc = malloc(sizeof *psc);
+ psc = calloc(1, sizeof *psc);
if (psc == NULL)
return NULL;
- memset(psc, 0, sizeof *psc);
glx_screen_init(psc, screen, priv);
psc->vtable = &applegl_screen_vtable;
shared = pcp_shared->driContext;
}
- pcp = malloc(sizeof *pcp);
+ pcp = calloc(1, sizeof *pcp);
if (pcp == NULL)
return NULL;
- memset(pcp, 0, sizeof *pcp);
if (!glx_context_init(&pcp->base, &psc->base, &config->base)) {
free(pcp);
return NULL;
shared = pcp_shared->driContext;
}
- pcp = malloc(sizeof *pcp);
+ pcp = calloc(1, sizeof *pcp);
if (pcp == NULL) {
*error = __DRI_CTX_ERROR_NO_MEMORY;
goto error_exit;
}
- memset(pcp, 0, sizeof *pcp);
if (!glx_context_init(&pcp->base, &psc->base, &config->base))
goto error_exit;
struct dri2_display *pdp;
GLint vblank_mode = DRI_CONF_VBLANK_DEF_INTERVAL_1;
- pdraw = malloc(sizeof(*pdraw));
+ pdraw = calloc(1, sizeof(*pdraw));
if (!pdraw)
return NULL;
- memset(pdraw, 0, sizeof *pdraw);
pdraw->base.destroyDrawable = dri2DestroyDrawable;
pdraw->base.xDrawable = xDrawable;
pdraw->base.drawable = drawable;
drm_magic_t magic;
int i;
- psc = malloc(sizeof *psc);
+ psc = calloc(1, sizeof *psc);
if (psc == NULL)
return NULL;
- memset(psc, 0, sizeof *psc);
psc->fd = -1;
if (!glx_screen_init(&psc->base, screen, priv)) {
shared = pcp_shared->driContext;
}
- pcp = malloc(sizeof *pcp);
+ pcp = calloc(1, sizeof *pcp);
if (pcp == NULL)
return NULL;
- memset(pcp, 0, sizeof *pcp);
if (!glx_context_init(&pcp->base, &psc->base, &config->base)) {
free(pcp);
return NULL;
if (xDrawable != drawable)
return NULL;
- pdp = malloc(sizeof *pdp);
+ pdp = calloc(1, sizeof *pdp);
if (!pdp)
return NULL;
- memset(pdp, 0, sizeof *pdp);
pdp->base.drawable = drawable;
pdp->base.psc = &psc->base;
shared = pcp_shared->driContext;
}
- pcp = malloc(sizeof *pcp);
+ pcp = calloc(1, sizeof *pcp);
if (pcp == NULL)
return NULL;
- memset(pcp, 0, sizeof *pcp);
if (!glx_context_init(&pcp->base, &psc->base, &config->base)) {
free(pcp);
return NULL;
shared = pcp_shared->driContext;
}
- pcp = malloc(sizeof *pcp);
+ pcp = calloc(1, sizeof *pcp);
if (pcp == NULL)
return NULL;
- memset(pcp, 0, sizeof *pcp);
if (!glx_context_init(&pcp->base, &psc->base, &config->base)) {
free(pcp);
return NULL;
Bool ret;
const __DRIswrastExtension *swrast = psc->swrast;
- pdp = malloc(sizeof(*pdp));
+ pdp = calloc(1, sizeof(*pdp));
if (!pdp)
return NULL;
- memset(pdp, 0, sizeof *pdp);
pdp->base.xDrawable = xDrawable;
pdp->base.drawable = drawable;
pdp->base.psc = &psc->base;
}
/* Allocate our context record */
- gc = malloc(sizeof *gc);
+ gc = calloc(1, sizeof *gc);
if (!gc) {
/* Out of memory */
return NULL;
}
- memset(gc, 0, sizeof *gc);
glx_context_init(gc, psc, mode);
gc->isDirect = GL_FALSE;
{
struct glx_screen *psc;
- psc = malloc(sizeof *psc);
+ psc = calloc(1, sizeof *psc);
if (psc == NULL)
return NULL;
- memset(psc, 0, sizeof *psc);
glx_screen_init(psc, screen, priv);
psc->vtable = &indirect_screen_vtable;