From 95111433853850345e4c3103b3bdf28a525ebb92 Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Wed, 22 Feb 2012 07:01:35 +0100 Subject: [PATCH] Prepare source code for amalgamation (4/6). * src/smooth/ftgrays.c, src/raster/ftraster.c: Undefine RAS_ARG, RAS_ARGS, RAS_VAR, and RAS_VARS before defining it. * src/smooth/ftgrays.c: s/TRaster/black_TRaster/, s/PRaster/black_PRaster/. * src/raster/ftraster.c: s/TRaster/gray_TRaster/, s/PRaster/gray_PRaster/. --- ChangeLog | 14 +++++++++++++- src/raster/ftraster.c | 37 ++++++++++++++++++++++--------------- src/smooth/ftgrays.c | 25 +++++++++++++++---------- 3 files changed, 50 insertions(+), 26 deletions(-) diff --git a/ChangeLog b/ChangeLog index eec0a5a00..e8763e5a4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2012-02-22  Vinnie Falco + + Prepare source code for amalgamation (4/6). + + * src/smooth/ftgrays.c, src/raster/ftraster.c: Undefine RAS_ARG, + RAS_ARGS, RAS_VAR, and RAS_VARS before defining it. + + * src/smooth/ftgrays.c: s/TRaster/black_TRaster/, + s/PRaster/black_PRaster/. + * src/raster/ftraster.c: s/TRaster/gray_TRaster/, + s/PRaster/gray_PRaster/. + 2012-02-20  Vinnie Falco Prepare source code for amalgamation (3/6). @@ -5,7 +17,7 @@ * src/smooth/ftgrays.c: s/TWorker/black_TWorker/, s/PWorker/black_PWorker/. * src/raster/ftraster.c: s/TWorker/gray_TWorker/, - s/PWorker/gray_PWorker/ + s/PWorker/gray_PWorker/. 2012-02-20  Vinnie Falco diff --git a/src/raster/ftraster.c b/src/raster/ftraster.c index f203b8252..f85845ec6 100644 --- a/src/raster/ftraster.c +++ b/src/raster/ftraster.c @@ -381,6 +381,11 @@ ( ( sizeof ( TProfile ) + sizeof ( Alignment ) - 1 ) / sizeof ( long ) ) +#undef RAS_ARG +#undef RAS_ARGS +#undef RAS_VAR +#undef RAS_VARS + #ifdef FT_STATIC_RASTER @@ -544,7 +549,7 @@ }; - typedef struct TRaster_ + typedef struct black_TRaster_ { char* buffer; long buffer_size; @@ -553,7 +558,7 @@ Byte grays[5]; Short gray_width; - } TRaster, *PRaster; + } black_TRaster, *black_PRaster; #ifdef FT_STATIC_RASTER @@ -3395,7 +3400,7 @@ static void - ft_black_init( PRaster raster ) + ft_black_init( black_PRaster raster ) { #ifdef FT_RASTER_OPTION_ANTI_ALIASING FT_UInt n; @@ -3423,7 +3428,7 @@ ft_black_new( void* memory, FT_Raster *araster ) { - static TRaster the_raster; + static black_TRaster the_raster; FT_UNUSED( memory ); @@ -3447,11 +3452,11 @@ static int - ft_black_new( FT_Memory memory, - PRaster *araster ) + ft_black_new( FT_Memory memory, + black_PRaster *araster ) { - FT_Error error; - PRaster raster = NULL; + FT_Error error; + black_PRaster raster = NULL; *araster = 0; @@ -3468,9 +3473,11 @@ static void - ft_black_done( PRaster raster ) + ft_black_done( black_PRaster raster ) { FT_Memory memory = (FT_Memory)raster->memory; + + FT_FREE( raster ); } @@ -3479,9 +3486,9 @@ static void - ft_black_reset( PRaster raster, - char* pool_base, - long pool_size ) + ft_black_reset( black_PRaster raster, + char* pool_base, + long pool_size ) { if ( raster ) { @@ -3505,7 +3512,7 @@ static void - ft_black_set_mode( PRaster raster, + ft_black_set_mode( black_PRaster raster, unsigned long mode, const char* palette ) { @@ -3532,12 +3539,12 @@ static int - ft_black_render( PRaster raster, + ft_black_render( black_PRaster raster, const FT_Raster_Params* params ) { const FT_Outline* outline = (const FT_Outline*)params->source; const FT_Bitmap* target_map = params->target; - black_PWorker worker; + black_PWorker worker; if ( !raster || !raster->buffer || !raster->buffer_size ) diff --git a/src/smooth/ftgrays.c b/src/smooth/ftgrays.c index db6890f87..4c0eea596 100644 --- a/src/smooth/ftgrays.c +++ b/src/smooth/ftgrays.c @@ -232,6 +232,11 @@ typedef ptrdiff_t FT_PtrDist; /* as usual, for the speed hungry :-) */ +#undef RAS_ARG +#undef RAS_ARG_ +#undef RAS_VAR +#undef RAS_VAR_ + #ifndef FT_STATIC_RASTER #define RAS_ARG gray_PWorker worker @@ -378,7 +383,7 @@ typedef ptrdiff_t FT_PtrDist; #endif - typedef struct TRaster_ + typedef struct gray_TRaster_ { void* buffer; long buffer_size; @@ -386,7 +391,7 @@ typedef ptrdiff_t FT_PtrDist; void* memory; gray_PWorker worker; - } TRaster, *PRaster; + } gray_TRaster, *gray_PRaster; @@ -1857,7 +1862,7 @@ typedef ptrdiff_t FT_PtrDist; static int - gray_raster_render( PRaster raster, + gray_raster_render( gray_PRaster raster, const FT_Raster_Params* params ) { const FT_Outline* outline = (const FT_Outline*)params->source; @@ -1954,7 +1959,7 @@ typedef ptrdiff_t FT_PtrDist; gray_raster_new( void* memory, FT_Raster* araster ) { - static TRaster the_raster; + static gray_TRaster the_raster; FT_UNUSED( memory ); @@ -1979,15 +1984,15 @@ typedef ptrdiff_t FT_PtrDist; gray_raster_new( FT_Memory memory, FT_Raster* araster ) { - FT_Error error; - PRaster raster = NULL; + FT_Error error; + gray_PRaster raster = NULL; *araster = 0; - if ( !FT_ALLOC( raster, sizeof ( TRaster ) ) ) + if ( !FT_ALLOC( raster, sizeof ( gray_TRaster ) ) ) { raster->memory = memory; - *araster = (FT_Raster)raster; + *araster = (FT_Raster)raster; } return error; @@ -1997,7 +2002,7 @@ typedef ptrdiff_t FT_PtrDist; static void gray_raster_done( FT_Raster raster ) { - FT_Memory memory = (FT_Memory)((PRaster)raster)->memory; + FT_Memory memory = (FT_Memory)((gray_PRaster)raster)->memory; FT_FREE( raster ); @@ -2011,7 +2016,7 @@ typedef ptrdiff_t FT_PtrDist; char* pool_base, long pool_size ) { - PRaster rast = (PRaster)raster; + gray_PRaster rast = (gray_PRaster)raster; if ( raster )