mirror of
https://github.com/X11Libre/xserver.git
synced 2026-10-16 00:19:55 +00:00
xalloc+memset(0) -> xcalloc
This commit is contained in:
parent
0b7b89fbac
commit
8a5b89e8e1
43 changed files with 68 additions and 179 deletions
|
|
@ -171,11 +171,9 @@ __glXAquaScreenCreateContext(__GLXscreen *screen,
|
|||
|
||||
GLAQUA_DEBUG_MSG("glXAquaScreenCreateContext\n");
|
||||
|
||||
context = malloc (sizeof (__GLXAquaContext));
|
||||
context = calloc (1, sizeof (__GLXAquaContext));
|
||||
if (context == NULL) return NULL;
|
||||
|
||||
memset(context, 0, sizeof *context);
|
||||
|
||||
context->base.pGlxScreen = screen;
|
||||
context->base.config = config;
|
||||
|
||||
|
|
@ -1099,8 +1097,7 @@ static void init_screen_visuals(__GLXAquaScreen *screen) {
|
|||
* FIXME: malloc / free. If nothing else, convert 'used' to
|
||||
* FIXME: array of bytes instead of ints!
|
||||
*/
|
||||
used = (int *)malloc(pScreen->numVisuals * sizeof(int));
|
||||
memset(used, 0, pScreen->numVisuals * sizeof(int));
|
||||
used = calloc(pScreen->numVisuals, sizeof(int));
|
||||
|
||||
i = 0;
|
||||
for ( modes = screen -> base.visuals
|
||||
|
|
@ -1184,11 +1181,9 @@ __glXAquaScreenCreateDrawable(__GLXscreen *screen,
|
|||
|
||||
GLAQUA_DEBUG_MSG("glAquaScreenCreateDrawable(%p,%p,%d,%p)\n", context, pDraw, drawId, modes);
|
||||
|
||||
glxPriv = xalloc(sizeof *glxPriv);
|
||||
glxPriv = calloc(1, sizeof *glxPriv);
|
||||
if (glxPriv == NULL) return NULL;
|
||||
|
||||
memset(glxPriv, 0, sizeof *glxPriv);
|
||||
|
||||
if (!__glXDrawableInit(&glxPriv->base, screen, pDraw, GLX_DRAWABLE_PIXMAP /*?*/, drawId, modes)) {
|
||||
xfree(glxPriv);
|
||||
return NULL;
|
||||
|
|
|
|||
Loading…
Reference in a new issue