summaryrefslogtreecommitdiff
path: root/glx
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
parent0b7b89fbac0b3865b2cf51295c68a5f4c7523f28 (diff)
xalloc+memset(0) -> xcalloc
Diffstat (limited to 'glx')
-rw-r--r--glx/glxcmds.c3
-rw-r--r--glx/glxdri.c10
-rw-r--r--glx/glxdri2.c10
-rw-r--r--glx/glxdriswrast.c10
4 files changed, 10 insertions, 23 deletions
diff --git a/glx/glxcmds.c b/glx/glxcmds.c
index 6e7637ebe..ab2d91b1b 100644
--- a/glx/glxcmds.c
+++ b/glx/glxcmds.c
@@ -164,11 +164,10 @@ static __GLXcontext *__glXdirectContextCreate(__GLXscreen *screen,
{
__GLXcontext *context;
- context = xalloc (sizeof (__GLXcontext));
+ context = xcalloc (1, sizeof (__GLXcontext));
if (context == NULL)
return NULL;
- memset(context, 0, sizeof *context);
context->destroy = __glXdirectContextDestroy;
return context;
diff --git a/glx/glxdri.c b/glx/glxdri.c
index c33b5bd9b..ce098e1e6 100644
--- a/glx/glxdri.c
+++ b/glx/glxdri.c
@@ -613,11 +613,10 @@ __glXDRIscreenCreateContext(__GLXscreen *baseScreen,
if (baseShareContext && baseShareContext->isDirect)
return 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;
@@ -672,12 +671,10 @@ __glXDRIscreenCreateDrawable(__GLXscreen *screen,
GLboolean retval;
drm_drawable_t hwDrawable;
- private = xalloc(sizeof *private);
+ private = xcalloc(1, sizeof *private);
if (private == NULL)
return NULL;
- memset(private, 0, sizeof *private);
-
if (!__glXDrawableInit(&private->base, screen,
pDraw, type, drawId, glxConfig)) {
xfree(private);
@@ -950,10 +947,9 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
return NULL;
}
- screen = xalloc(sizeof *screen);
+ screen = xcalloc(1, sizeof *screen);
if (screen == NULL)
return NULL;
- memset(screen, 0, sizeof *screen);
screen->base.destroy = __glXDRIscreenDestroy;
screen->base.createContext = __glXDRIscreenCreateContext;
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)) {
diff --git a/glx/glxdriswrast.c b/glx/glxdriswrast.c
index 28597044f..b42501280 100644
--- a/glx/glxdriswrast.c
+++ b/glx/glxdriswrast.c
@@ -265,11 +265,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;
@@ -305,12 +304,10 @@ __glXDRIscreenCreateDrawable(__GLXscreen *screen,
ScreenPtr pScreen = driScreen->base.pScreen;
- 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)) {
@@ -442,10 +439,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);
screen->base.destroy = __glXDRIscreenDestroy;
screen->base.createContext = __glXDRIscreenCreateContext;