summaryrefslogtreecommitdiff
path: root/glx/glxdri2.c
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2008-10-06 15:36:51 -0400
committerAdam Jackson <ajax@redhat.com>2008-10-06 15:36:51 -0400
commit8a5b89e8e184f4cbf33c6dee0b06e61d8f857576 (patch)
treeb042833775d237a3971eae7a7192400e064ad50d /glx/glxdri2.c
parent0b7b89fbac0b3865b2cf51295c68a5f4c7523f28 (diff)
xalloc+memset(0) -> xcalloc
Diffstat (limited to 'glx/glxdri2.c')
-rw-r--r--glx/glxdri2.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/glx/glxdri2.c b/glx/glxdri2.c
index 495de8197..65138cd0f 100644
--- a/glx/glxdri2.c
+++ b/glx/glxdri2.c
@@ -279,11 +279,10 @@ __glXDRIscreenCreateContext(__GLXscreen *baseScreen,
else
driShare = NULL;
- context = xalloc(sizeof *context);
+ context = xcalloc(1, sizeof *context);
if (context == NULL)
return NULL;
- memset(context, 0, sizeof *context);
context->base.destroy = __glXDRIcontextDestroy;
context->base.makeCurrent = __glXDRIcontextMakeCurrent;
context->base.loseCurrent = __glXDRIcontextLoseCurrent;
@@ -310,12 +309,10 @@ __glXDRIscreenCreateDrawable(__GLXscreen *screen,
__GLXDRIconfig *config = (__GLXDRIconfig *) glxConfig;
__GLXDRIdrawable *private;
- private = xalloc(sizeof *private);
+ private = xcalloc(1, sizeof *private);
if (private == NULL)
return NULL;
- memset(private, 0, sizeof *private);
-
private->screen = driScreen;
if (!__glXDrawableInit(&private->base, screen,
pDraw, type, drawId, glxConfig)) {
@@ -464,10 +461,9 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
const __DRIconfig **driConfigs;
int i;
- screen = xalloc(sizeof *screen);
+ screen = xcalloc(1, sizeof *screen);
if (screen == NULL)
return NULL;
- memset(screen, 0, sizeof *screen);
if (!xf86LoaderCheckSymbol("DRI2Connect") ||
!DRI2Connect(pScreen, &screen->fd, &driverName)) {