diff options
author | Albert Astals Cid <aacid@kde.org> | 2009-04-11 00:31:57 +0200 |
---|---|---|
committer | Albert Astals Cid <aacid@kde.org> | 2009-04-11 00:31:57 +0200 |
commit | 9cf2325fb22f812b31858e519411f57747d39bd8 (patch) | |
tree | a3e03ba664475b379edec748d80ec75719e54678 | |
parent | c399b2d512aa073b0d7cd8eb5413a4b43f0d6aef (diff) |
More gmalloc → gmallocn
-rw-r--r-- | glib/poppler-page.cc | 2 | ||||
-rw-r--r-- | splash/Splash.cc | 8 | ||||
-rw-r--r-- | splash/SplashBitmap.cc | 6 | ||||
-rw-r--r-- | splash/SplashFTFont.cc | 2 |
4 files changed, 9 insertions, 9 deletions
diff --git a/glib/poppler-page.cc b/glib/poppler-page.cc index f1dd1336..225c97b2 100644 --- a/glib/poppler-page.cc +++ b/glib/poppler-page.cc @@ -313,13 +313,13 @@ poppler_page_prepare_output_dev (PopplerPage *page, cairo_width = (int) ceil(width * scale); cairo_height = (int) ceil(height * scale); output_dev = page->document->output_dev; cairo_rowstride = cairo_width * 4; - cairo_data = (guchar *) gmalloc (cairo_height * cairo_rowstride); + cairo_data = (guchar *) gmallocn (cairo_height, cairo_rowstride); if (transparent) memset (cairo_data, 0x00, cairo_height * cairo_rowstride); else memset (cairo_data, 0xff, cairo_height * cairo_rowstride); surface = cairo_image_surface_create_for_data(cairo_data, diff --git a/splash/Splash.cc b/splash/Splash.cc index c93ef408..a1deb854 100644 --- a/splash/Splash.cc +++ b/splash/Splash.cc @@ -8,13 +8,13 @@ // // Modified under the Poppler project - http://poppler.freedesktop.org // // All changes made under the Poppler project to this file are licensed // under GPL version 2 or later // -// Copyright (C) 2005-2008 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2005-2009 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2005 Marco Pesenti Gritti <mpg@redhat.com> // // To see a description of the changes please see the Changelog file that // came with your tarball or type make ChangeLog if you are building from git // //======================================================================== @@ -1998,13 +1998,13 @@ SplashError Splash::fillImageMask(SplashImageMaskSource src, void *srcData, yp = h / scaledHeight; yq = h % scaledHeight; xp = w / scaledWidth; xq = w % scaledWidth; // allocate pixel buffer - pixBuf = (SplashColorPtr)gmalloc((yp + 1) * w); + pixBuf = (SplashColorPtr)gmallocn((yp + 1), w); // initialize the pixel pipe pipeInit(&pipe, 0, 0, state->fillPattern, NULL, state->fillAlpha, gTrue, gFalse); if (vectorAntialias) { drawAAPixelInit(); @@ -2298,15 +2298,15 @@ SplashError Splash::drawImage(SplashImageSource src, void *srcData, yp = h / scaledHeight; yq = h % scaledHeight; xp = w / scaledWidth; xq = w % scaledWidth; // allocate pixel buffers - colorBuf = (SplashColorPtr)gmalloc((yp + 1) * w * nComps); + colorBuf = (SplashColorPtr)gmallocn3((yp + 1), w, nComps); if (srcAlpha) { - alphaBuf = (Guchar *)gmalloc((yp + 1) * w); + alphaBuf = (Guchar *)gmallocn((yp + 1), w); } else { alphaBuf = NULL; } pixAcc0 = pixAcc1 = pixAcc2 = 0; // make gcc happy #if SPLASH_CMYK diff --git a/splash/SplashBitmap.cc b/splash/SplashBitmap.cc index 97d622cf..6cf2aea9 100644 --- a/splash/SplashBitmap.cc +++ b/splash/SplashBitmap.cc @@ -8,13 +8,13 @@ // // Modified under the Poppler project - http://poppler.freedesktop.org // // All changes made under the Poppler project to this file are licensed // under GPL version 2 or later // -// Copyright (C) 2006 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2006, 2009 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2007 Ilmari Heikkinen <ilmari.heikkinen@gmail.com> // // To see a description of the changes please see the Changelog file that // came with your tarball or type make ChangeLog if you are building from git // //======================================================================== @@ -59,19 +59,19 @@ SplashBitmap::SplashBitmap(int widthA, int heightA, int rowPad, rowSize = width * 4; break; #endif } rowSize += rowPad - 1; rowSize -= rowSize % rowPad; - data = (SplashColorPtr)gmalloc(rowSize * height); + data = (SplashColorPtr)gmallocn(rowSize, height); if (!topDown) { data += (height - 1) * rowSize; rowSize = -rowSize; } if (alphaA) { - alpha = (Guchar *)gmalloc(width * height); + alpha = (Guchar *)gmallocn(width, height); } else { alpha = NULL; } } diff --git a/splash/SplashFTFont.cc b/splash/SplashFTFont.cc index 0039feb6..c3b298af 100644 --- a/splash/SplashFTFont.cc +++ b/splash/SplashFTFont.cc @@ -240,13 +240,13 @@ GBool SplashFTFont::makeGlyph(int c, int xFrac, int yFrac, bitmap->aa = aa; if (aa) { rowSize = bitmap->w; } else { rowSize = (bitmap->w + 7) >> 3; } - bitmap->data = (Guchar *)gmalloc(rowSize * bitmap->h); + bitmap->data = (Guchar *)gmallocn(rowSize, bitmap->h); bitmap->freeData = gTrue; for (i = 0, p = bitmap->data, q = slot->bitmap.buffer; i < bitmap->h; ++i, p += rowSize, q += slot->bitmap.pitch) { memcpy(p, q, rowSize); } |