X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=src%2Ffcblanks.c;h=bab3066e82ae7cfbf0e16bc8053bb5db4a640f32;hb=dffcb2a083bc5f959ed96dbdf0f365ebc0e710cc;hp=8b3a9a926b16fefaf6d2438b0050631bb5ab7f0f;hpb=24330d27f88bbf387d92128d2c21e005f2563e93;p=fontconfig.git diff --git a/src/fcblanks.c b/src/fcblanks.c index 8b3a9a9..bab3066 100644 --- a/src/fcblanks.c +++ b/src/fcblanks.c @@ -1,7 +1,7 @@ /* - * $XFree86$ + * fontconfig/src/fcblanks.c * - * Copyright © 2002 Keith Packard, member of The XFree86 Project, Inc. + * Copyright © 2002 Keith Packard * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -13,9 +13,9 @@ * representations about the suitability of this software for any purpose. It * is provided "as is" without express or implied warranty. * - * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR @@ -32,6 +32,7 @@ FcBlanksCreate (void) b = malloc (sizeof (FcBlanks)); if (!b) return 0; + FcMemAlloc (FC_MEM_BLANKS, sizeof (FcBlanks)); b->nblank = 0; b->sblank = 0; b->blanks = 0; @@ -42,7 +43,11 @@ void FcBlanksDestroy (FcBlanks *b) { if (b->blanks) + { + FcMemFree (FC_MEM_BLANKS, b->sblank * sizeof (FcChar32)); free (b->blanks); + } + FcMemFree (FC_MEM_BLANKS, sizeof (FcBlanks)); free (b); } @@ -65,6 +70,9 @@ FcBlanksAdd (FcBlanks *b, FcChar32 ucs4) c = (FcChar32 *) malloc (sblank * sizeof (FcChar32)); if (!c) return FcFalse; + if (b->sblank) + FcMemFree (FC_MEM_BLANKS, b->sblank * sizeof (FcChar32)); + FcMemAlloc (FC_MEM_BLANKS, sblank * sizeof (FcChar32)); b->sblank = sblank; b->blanks = c; } @@ -82,3 +90,6 @@ FcBlanksIsMember (FcBlanks *b, FcChar32 ucs4) return FcTrue; return FcFalse; } +#define __fcblanks__ +#include "fcaliastail.h" +#undef __fcblanks__