From 4a3dbb926ae3f5410198d7cc4f4ebe4f62eebf05 Mon Sep 17 00:00:00 2001 From: marha Date: Sat, 25 Jul 2009 19:39:46 +0000 Subject: Added xorg-server-1.6.2.tar.gz --- xorg-server/render/glyph.c | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) (limited to 'xorg-server/render/glyph.c') diff --git a/xorg-server/render/glyph.c b/xorg-server/render/glyph.c index 286e39d63..87b332e2a 100644 --- a/xorg-server/render/glyph.c +++ b/xorg-server/render/glyph.c @@ -26,8 +26,12 @@ #include #endif -#include /* buggy openssl/sha.h wants size_t */ -#include +#ifdef HAVE_SHA1_IN_LIBMD /* Use libmd for SHA1 */ +# include +#else /* Use OpenSSL's libcrypto */ +# include /* buggy openssl/sha.h wants size_t */ +# include +#endif #include "misc.h" #include "scrnintstr.h" @@ -88,14 +92,6 @@ static GlyphHashRec globalGlyphs[GlyphFormatNum]; static void FreeGlyphPrivates (GlyphPtr glyph) { - ScreenPtr pScreen; - int i; - - for (i = 0; i < screenInfo.numScreens; i++) { - pScreen = screenInfo.screens[i]; - dixFreePrivates(*GetGlyphPrivatesForScreen(glyph, pScreen)); - } - dixFreePrivates(glyph->devPrivates); glyph->devPrivates = NULL; } @@ -202,6 +198,14 @@ HashGlyph (xGlyphInfo *gi, unsigned long size, unsigned char sha1[20]) { +#ifdef HAVE_SHA1_IN_LIBMD /* Use libmd for SHA1 */ + SHA1_CTX ctx; + + SHA1Init (&ctx); + SHA1Update (&ctx, gi, sizeof (xGlyphInfo)); + SHA1Update (&ctx, bits, size); + SHA1Final (sha1, &ctx); +#else /* Use OpenSSL's libcrypto */ SHA_CTX ctx; int success; @@ -220,6 +224,7 @@ HashGlyph (xGlyphInfo *gi, success = SHA1_Final (sha1, &ctx); if (! success) return BadAlloc; +#endif return Success; } @@ -436,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; @@ -508,10 +512,9 @@ AllocateGlyphSet (int fdepth, PictFormatPtr format) } size = sizeof (GlyphSetRec); - glyphSet = xalloc (size); + glyphSet = xcalloc (1, size); if (!glyphSet) return FALSE; - bzero((char *)glyphSet, size); if (!AllocateGlyphHash (&glyphSet->hash, &glyphHashSets[0])) { -- cgit v1.2.3