From ef1f481752fa6e478f649e826c96927c98f21981 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 25 Oct 2007 23:37:11 +0000 Subject: [PATCH] Even more cleanup and more type renames. 2007-10-25 Behdad Esfahbod * pango/opentype/*: Even more cleanup and more type renames. --- src/harfbuzz-buffer.h | 3 +-- src/harfbuzz-global.h | 6 ++++++ src/harfbuzz-impl.c | 16 ++++++++-------- src/harfbuzz-impl.h | 22 +++++++++++----------- src/harfbuzz-open.h | 3 --- 5 files changed, 26 insertions(+), 24 deletions(-) diff --git a/src/harfbuzz-buffer.h b/src/harfbuzz-buffer.h index 701d083ee..e659ce330 100644 --- a/src/harfbuzz-buffer.h +++ b/src/harfbuzz-buffer.h @@ -14,8 +14,7 @@ #ifndef HARFBUZZ_BUFFER_H #define HARFBUZZ_BUFFER_H -#include -#include FT_FREETYPE_H +#include "harfbuzz-global.h" HB_BEGIN_HEADER diff --git a/src/harfbuzz-global.h b/src/harfbuzz-global.h index 9aed8ca8d..bb35db07d 100644 --- a/src/harfbuzz-global.h +++ b/src/harfbuzz-global.h @@ -13,6 +13,9 @@ #ifndef HARFBUZZ_GLOBAL_H #define HARFBUZZ_GLOBAL_H +#include +#include FT_FREETYPE_H + #ifdef __cplusplus #define HB_BEGIN_HEADER extern "C" { #define HB_END_HEADER } @@ -23,11 +26,14 @@ HB_BEGIN_HEADER +typedef unsigned char HB_Byte; +typedef signed char HB_Char; typedef unsigned short HB_UShort; typedef signed short HB_Short; typedef unsigned int HB_UInt; typedef signed int HB_Int; typedef int HB_Bool; +typedef void *HB_Pointer; typedef enum { diff --git a/src/harfbuzz-impl.c b/src/harfbuzz-impl.c index 1d2b69905..fcdbc33af 100644 --- a/src/harfbuzz-impl.c +++ b/src/harfbuzz-impl.c @@ -25,12 +25,12 @@ _hb_log( const char* format, ... ) #endif /* only used internally */ -static FT_Pointer +static HB_Pointer _hb_qalloc( HB_UInt size, HB_Error *perror ) { HB_Error error = 0; - FT_Pointer block = NULL; + HB_Pointer block = NULL; if ( size > 0 ) { @@ -47,12 +47,12 @@ _hb_qalloc( HB_UInt size, #define QALLOC(ptr,size) ( (ptr) = _hb_qalloc( (size), &error ), error != 0 ) -HB_INTERNAL FT_Pointer +HB_INTERNAL HB_Pointer _hb_alloc( HB_UInt size, HB_Error *perror ) { HB_Error error = 0; - FT_Pointer block = NULL; + HB_Pointer block = NULL; if ( size > 0 ) { @@ -68,12 +68,12 @@ _hb_alloc( HB_UInt size, } -HB_INTERNAL FT_Pointer -_hb_realloc( FT_Pointer block, +HB_INTERNAL HB_Pointer +_hb_realloc( HB_Pointer block, HB_UInt new_size, HB_Error *perror ) { - FT_Pointer block2 = NULL; + HB_Pointer block2 = NULL; HB_Error error = 0; block2 = realloc( block, new_size ); @@ -89,7 +89,7 @@ _hb_realloc( FT_Pointer block, HB_INTERNAL void -_hb_free( FT_Pointer block ) +_hb_free( HB_Pointer block ) { if ( block ) free( block ); diff --git a/src/harfbuzz-impl.h b/src/harfbuzz-impl.h index 3e7ac1c00..69c9ea902 100644 --- a/src/harfbuzz-impl.h +++ b/src/harfbuzz-impl.h @@ -81,18 +81,18 @@ typedef FT_Stream HB_Stream; #define GET_Byte() (*stream->cursor++) #define GET_Short() (stream->cursor += 2, (HB_Short)( \ - (*(((FT_Byte*)stream->cursor)-2) << 8) | \ - *(((FT_Byte*)stream->cursor)-1) \ + (*(((HB_Byte*)stream->cursor)-2) << 8) | \ + *(((HB_Byte*)stream->cursor)-1) \ )) #define GET_Long() (stream->cursor += 4, (HB_Int)( \ - (*(((FT_Byte*)stream->cursor)-4) << 24) | \ - (*(((FT_Byte*)stream->cursor)-3) << 16) | \ - (*(((FT_Byte*)stream->cursor)-2) << 8) | \ - *(((FT_Byte*)stream->cursor)-1) \ + (*(((HB_Byte*)stream->cursor)-4) << 24) | \ + (*(((HB_Byte*)stream->cursor)-3) << 16) | \ + (*(((HB_Byte*)stream->cursor)-2) << 8) | \ + *(((HB_Byte*)stream->cursor)-1) \ )) -#define GET_Char() ((FT_Char)GET_Byte()) +#define GET_Char() ((HB_Char)GET_Byte()) #define GET_UShort() ((HB_UShort)GET_Short()) #define GET_ULong() ((HB_UInt)GET_Long()) #define GET_Tag4() GET_ULong() @@ -143,17 +143,17 @@ _hb_face_goto_table( FT_Face face, #define ERR(err) _hb_err (err) -HB_INTERNAL FT_Pointer +HB_INTERNAL HB_Pointer _hb_alloc( HB_UInt size, HB_Error *perror_ ); -HB_INTERNAL FT_Pointer -_hb_realloc( FT_Pointer block, +HB_INTERNAL HB_Pointer +_hb_realloc( HB_Pointer block, HB_UInt new_size, HB_Error *perror_ ); HB_INTERNAL void -_hb_free( FT_Pointer block ); +_hb_free( HB_Pointer block ); /* helper func to set a breakpoint on */ diff --git a/src/harfbuzz-open.h b/src/harfbuzz-open.h index d7cc9f01d..46ea68fcf 100644 --- a/src/harfbuzz-open.h +++ b/src/harfbuzz-open.h @@ -13,9 +13,6 @@ #ifndef HARFBUZZ_OPEN_H #define HARFBUZZ_OPEN_H -#include -#include FT_FREETYPE_H - #include "harfbuzz-global.h" HB_BEGIN_HEADER