diff options
author | Thomas E. Dickey <dickey@invisible-island.net> | 2022-06-24 20:26:31 -0400 |
---|---|---|
committer | Thomas E. Dickey <dickey@invisible-island.net> | 2022-07-06 04:27:24 -0400 |
commit | d4a554c9795b109085ec31eedacba6532c18d802 (patch) | |
tree | 0691109a1eee149062ad84e09ca160eddc8692f4 /src/xftdraw.c | |
parent | 42c6616499e6ca193a0b764576a6ed8650dd3d7b (diff) | |
download | xorg-lib-libXft-d4a554c9795b109085ec31eedacba6532c18d802.tar.gz |
reduce clutter with macros for allocating arrays
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
Diffstat (limited to 'src/xftdraw.c')
-rw-r--r-- | src/xftdraw.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/xftdraw.c b/src/xftdraw.c index c1bd9a4..4054714 100644 --- a/src/xftdraw.c +++ b/src/xftdraw.c @@ -525,7 +525,7 @@ XftDrawString8 (XftDraw *draw, glyphs = glyphs_local; else { - glyphs = malloc ((size_t)len * sizeof (FT_UInt)); + glyphs = AllocUIntArray (len); if (!glyphs) return; } @@ -555,7 +555,7 @@ XftDrawString16 (XftDraw *draw, glyphs = glyphs_local; else { - glyphs = malloc ((size_t)len * sizeof (FT_UInt)); + glyphs = AllocUIntArray (len); if (!glyphs) return; } @@ -586,7 +586,7 @@ XftDrawString32 (XftDraw *draw, glyphs = glyphs_local; else { - glyphs = malloc ((size_t)len * sizeof (FT_UInt)); + glyphs = AllocUIntArray (len); if (!glyphs) return; } @@ -623,7 +623,7 @@ XftDrawStringUtf8 (XftDraw *draw, { if (i == size) { - glyphs_new = malloc ((size_t)size * 2 * sizeof (FT_UInt)); + glyphs_new = AllocUIntArray (size * 2); if (!glyphs_new) { if (glyphs != glyphs_local) @@ -671,7 +671,7 @@ XftDrawStringUtf16 (XftDraw *draw, { if (i == size) { - glyphs_new = malloc ((size_t)size * 2 * sizeof (FT_UInt)); + glyphs_new = AllocUIntArray (size * 2); if (!glyphs_new) { if (glyphs != glyphs_local) @@ -774,7 +774,7 @@ XftDrawCharSpec (XftDraw *draw, glyphs = glyphs_local; else { - glyphs = malloc ((size_t)len * sizeof (XftGlyphSpec)); + glyphs = AllocGlyphSpecArray (len); if (!glyphs) return; } @@ -806,7 +806,7 @@ XftDrawCharFontSpec (XftDraw *draw, glyphs = glyphs_local; else { - glyphs = malloc ((size_t)len * sizeof (XftGlyphFontSpec)); + glyphs = AllocGlyphFontSpecArray (len); if (!glyphs) return; } |