From 727dee178a392d20eb050d0c446f2fcc29058fa1 Mon Sep 17 00:00:00 2001 From: Victoria Lease Date: Mon, 10 Jun 2013 13:55:54 -0700 Subject: Update freetype to 5e094c6fb2ddd6e8901a5679e2cbb8fa476a38ee Integrated patches from freetype2 git repository, up to hashval 5e094c6fb2ddd6e8901a5679e2cbb8fa476a38ee, which is post-2.4.12. Most recent commit message from freetype git: [truetype] Improve handling of broken sbit advance widths. Noteworthy patches included: [cff] Add a new Type 2 interpreter and hinter. Add support for color embedded bitmaps (eg. color emoji). Change-Id: Ia8b6a67bc18f841b24f44edf80f81f663185b598 --- include/freetype/internal/ftmemory.h | 176 +++++++++++++++++------------------ 1 file changed, 87 insertions(+), 89 deletions(-) (limited to 'include/freetype/internal/ftmemory.h') diff --git a/include/freetype/internal/ftmemory.h b/include/freetype/internal/ftmemory.h index 026aa63..3d51aee 100644 --- a/include/freetype/internal/ftmemory.h +++ b/include/freetype/internal/ftmemory.h @@ -4,7 +4,7 @@ /* */ /* The FreeType memory management macros (specification). */ /* */ -/* Copyright 1996-2001, 2002, 2004, 2005, 2006, 2007, 2010 by */ +/* Copyright 1996-2002, 2004-2007, 2010, 2013 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -141,8 +141,10 @@ FT_BEGIN_HEADER const void* P ); -#define FT_MEM_ALLOC( ptr, size ) \ - FT_ASSIGNP_INNER( ptr, ft_mem_alloc( memory, (size), &error ) ) +#define FT_MEM_ALLOC( ptr, size ) \ + FT_ASSIGNP_INNER( ptr, ft_mem_alloc( memory, \ + (FT_Long)(size), \ + &error ) ) #define FT_MEM_FREE( ptr ) \ FT_BEGIN_STMNT \ @@ -154,45 +156,60 @@ FT_BEGIN_HEADER FT_MEM_ALLOC( ptr, sizeof ( *(ptr) ) ) #define FT_MEM_REALLOC( ptr, cursz, newsz ) \ - FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, 1, \ - (cursz), (newsz), \ - (ptr), &error ) ) - -#define FT_MEM_QALLOC( ptr, size ) \ - FT_ASSIGNP_INNER( ptr, ft_mem_qalloc( memory, (size), &error ) ) + FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, \ + 1, \ + (FT_Long)(cursz), \ + (FT_Long)(newsz), \ + (ptr), \ + &error ) ) + +#define FT_MEM_QALLOC( ptr, size ) \ + FT_ASSIGNP_INNER( ptr, ft_mem_qalloc( memory, \ + (FT_Long)(size), \ + &error ) ) #define FT_MEM_QNEW( ptr ) \ FT_MEM_QALLOC( ptr, sizeof ( *(ptr) ) ) -#define FT_MEM_QREALLOC( ptr, cursz, newsz ) \ - FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, 1, \ - (cursz), (newsz), \ - (ptr), &error ) ) - -#define FT_MEM_QRENEW_ARRAY( ptr, cursz, newsz ) \ - FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, sizeof ( *(ptr) ), \ - (cursz), (newsz), \ - (ptr), &error ) ) - -#define FT_MEM_ALLOC_MULT( ptr, count, item_size ) \ - FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, (item_size), \ - 0, (count), \ - NULL, &error ) ) - -#define FT_MEM_REALLOC_MULT( ptr, oldcnt, newcnt, itmsz ) \ - FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, (itmsz), \ - (oldcnt), (newcnt), \ - (ptr), &error ) ) - -#define FT_MEM_QALLOC_MULT( ptr, count, item_size ) \ - FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, (item_size), \ - 0, (count), \ - NULL, &error ) ) - -#define FT_MEM_QREALLOC_MULT( ptr, oldcnt, newcnt, itmsz) \ - FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, (itmsz), \ - (oldcnt), (newcnt), \ - (ptr), &error ) ) +#define FT_MEM_QREALLOC( ptr, cursz, newsz ) \ + FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, \ + 1, \ + (FT_Long)(cursz), \ + (FT_Long)(newsz), \ + (ptr), \ + &error ) ) + +#define FT_MEM_ALLOC_MULT( ptr, count, item_size ) \ + FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, \ + (FT_Long)(item_size), \ + 0, \ + (FT_Long)(count), \ + NULL, \ + &error ) ) + +#define FT_MEM_REALLOC_MULT( ptr, oldcnt, newcnt, itmsz ) \ + FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, \ + (FT_Long)(itmsz), \ + (FT_Long)(oldcnt), \ + (FT_Long)(newcnt), \ + (ptr), \ + &error ) ) + +#define FT_MEM_QALLOC_MULT( ptr, count, item_size ) \ + FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, \ + (FT_Long)(item_size), \ + 0, \ + (FT_Long)(count), \ + NULL, \ + &error ) ) + +#define FT_MEM_QREALLOC_MULT( ptr, oldcnt, newcnt, itmsz) \ + FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, \ + (FT_Long)(itmsz), \ + (FT_Long)(oldcnt), \ + (FT_Long)(newcnt), \ + (ptr), \ + &error ) ) #define FT_MEM_SET_ERROR( cond ) ( (cond), error != 0 ) @@ -236,26 +253,37 @@ FT_BEGIN_HEADER /* _typed_ in order to automatically compute array element sizes. */ /* */ -#define FT_MEM_NEW_ARRAY( ptr, count ) \ - FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, sizeof ( *(ptr) ), \ - 0, (count), \ - NULL, &error ) ) - -#define FT_MEM_RENEW_ARRAY( ptr, cursz, newsz ) \ - FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, sizeof ( *(ptr) ), \ - (cursz), (newsz), \ - (ptr), &error ) ) - -#define FT_MEM_QNEW_ARRAY( ptr, count ) \ - FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, sizeof ( *(ptr) ), \ - 0, (count), \ - NULL, &error ) ) - -#define FT_MEM_QRENEW_ARRAY( ptr, cursz, newsz ) \ - FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, sizeof ( *(ptr) ), \ - (cursz), (newsz), \ - (ptr), &error ) ) - +#define FT_MEM_NEW_ARRAY( ptr, count ) \ + FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, \ + sizeof ( *(ptr) ), \ + 0, \ + (FT_Long)(count), \ + NULL, \ + &error ) ) + +#define FT_MEM_RENEW_ARRAY( ptr, cursz, newsz ) \ + FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, \ + sizeof ( *(ptr) ), \ + (FT_Long)(cursz), \ + (FT_Long)(newsz), \ + (ptr), \ + &error ) ) + +#define FT_MEM_QNEW_ARRAY( ptr, count ) \ + FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, \ + sizeof ( *(ptr) ), \ + 0, \ + (FT_Long)(count), \ + NULL, \ + &error ) ) + +#define FT_MEM_QRENEW_ARRAY( ptr, cursz, newsz ) \ + FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, \ + sizeof ( *(ptr) ), \ + (FT_Long)(cursz), \ + (FT_Long)(newsz), \ + (ptr), \ + &error ) ) #define FT_ALLOC( ptr, size ) \ FT_MEM_SET_ERROR( FT_MEM_ALLOC( ptr, size ) ) @@ -303,37 +331,6 @@ FT_BEGIN_HEADER FT_MEM_SET_ERROR( FT_MEM_RENEW_ARRAY( ptr, curcnt, newcnt ) ) -#ifdef FT_CONFIG_OPTION_OLD_INTERNALS - - FT_BASE( FT_Error ) - FT_Alloc( FT_Memory memory, - FT_Long size, - void* *P ); - - FT_BASE( FT_Error ) - FT_QAlloc( FT_Memory memory, - FT_Long size, - void* *p ); - - FT_BASE( FT_Error ) - FT_Realloc( FT_Memory memory, - FT_Long current, - FT_Long size, - void* *P ); - - FT_BASE( FT_Error ) - FT_QRealloc( FT_Memory memory, - FT_Long current, - FT_Long size, - void* *p ); - - FT_BASE( void ) - FT_Free( FT_Memory memory, - void* *P ); - -#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */ - - FT_BASE( FT_Pointer ) ft_mem_strdup( FT_Memory memory, const char* str, @@ -345,6 +342,7 @@ FT_BEGIN_HEADER FT_ULong size, FT_Error *p_error ); + #define FT_MEM_STRDUP( dst, str ) \ (dst) = (char*)ft_mem_strdup( memory, (const char*)(str), &error ) -- cgit v1.2.3