From 8a5b89e8e184f4cbf33c6dee0b06e61d8f857576 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Mon, 6 Oct 2008 15:36:51 -0400 Subject: xalloc+memset(0) -> xcalloc --- render/glyph.c | 3 +-- render/picture.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'render') diff --git a/render/glyph.c b/render/glyph.c index ae04f6029..87b332e2a 100644 --- a/render/glyph.c +++ b/render/glyph.c @@ -441,10 +441,9 @@ bail: Bool AllocateGlyphHash (GlyphHashPtr hash, GlyphHashSetPtr hashSet) { - hash->table = (GlyphRefPtr) xalloc (hashSet->size * sizeof (GlyphRefRec)); + hash->table = xcalloc (hashSet->size, sizeof (GlyphRefRec)); if (!hash->table) return FALSE; - memset (hash->table, 0, hashSet->size * sizeof (GlyphRefRec)); hash->hashSet = hashSet; hash->tableEntries = 0; return TRUE; diff --git a/render/picture.c b/render/picture.c index 9def47b0f..fc2bf43d5 100644 --- a/render/picture.c +++ b/render/picture.c @@ -316,10 +316,9 @@ PictureCreateDefaultFormats (ScreenPtr pScreen, int *nformatp) } - pFormats = (PictFormatPtr) xalloc (nformats * sizeof (PictFormatRec)); + pFormats = xcalloc (nformats, sizeof (PictFormatRec)); if (!pFormats) return 0; - memset (pFormats, '\0', nformats * sizeof (PictFormatRec)); for (f = 0; f < nformats; f++) { pFormats[f].id = FakeClientID (0); -- cgit v1.2.3