diff options
author | Adam Jackson <ajax@redhat.com> | 2008-10-06 15:36:51 -0400 |
---|---|---|
committer | Adam Jackson <ajax@redhat.com> | 2008-10-06 15:36:51 -0400 |
commit | 8a5b89e8e184f4cbf33c6dee0b06e61d8f857576 (patch) | |
tree | b042833775d237a3971eae7a7192400e064ad50d /render | |
parent | 0b7b89fbac0b3865b2cf51295c68a5f4c7523f28 (diff) |
xalloc+memset(0) -> xcalloc
Diffstat (limited to 'render')
-rw-r--r-- | render/glyph.c | 3 | ||||
-rw-r--r-- | render/picture.c | 3 |
2 files changed, 2 insertions, 4 deletions
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); |