From e9f330adf6eddd1a70a3da33a585b55e0ecddd46 Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Thu, 24 Jan 2013 09:12:56 +0100 Subject: [PATCH] [base] Make `FT_Hypot' really internal. * include/freetype/fttrigon.h (FT_Hypot): Move to... * include/freetype/internal/ftcalc.h: This file. * src/base/fttrigon.c (FT_Hypot): Move to... * src/base/ftcalc.c: This file. Include FT_TRIGONOMETRY_H. * src/truetype/ttgload.c: Don't include FT_TRIGONOMETRY_H. --- ChangeLog | 15 ++++++++++++++- include/freetype/fttrigon.h | 8 -------- include/freetype/internal/ftcalc.h | 13 +++++++++++-- src/base/ftcalc.c | 19 ++++++++++++++++++- src/base/fttrigon.c | 15 --------------- src/truetype/ttgload.c | 1 - 6 files changed, 43 insertions(+), 28 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3f440e395..b6011ddea 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2013-01-23 Werner Lemberg + + [base] Make `FT_Hypot' really internal. + + * include/freetype/fttrigon.h (FT_Hypot): Move to... + * include/freetype/internal/ftcalc.h: This file. + + * src/base/fttrigon.c (FT_Hypot): Move to... + * src/base/ftcalc.c: This file. + Include FT_TRIGONOMETRY_H. + + * src/truetype/ttgload.c: Don't include FT_TRIGONOMETRY_H. + 2013-01-23 Werner Lemberg [truetype] Revert change from 2013-01-22. @@ -8,7 +21,7 @@ 2013-01-23 Alexei Podtelezhnikov - [base, truetype] New internal FT_Hypot function. + [base, truetype] New internal `FT_Hypot' function. * include/freetype/fttrigon.h (FT_Hypot): Declare it. * src/base/fttrigon.c (FT_Hypot): Define it. diff --git a/include/freetype/fttrigon.h b/include/freetype/fttrigon.h index f4d688abf..65143cb8c 100644 --- a/include/freetype/fttrigon.h +++ b/include/freetype/fttrigon.h @@ -339,14 +339,6 @@ FT_BEGIN_HEADER FT_Fixed length, FT_Angle angle ); - /* - * Return sqrt(x*x+y*y), which is the same as FT_Vector_Length but uses - * two fixed-point arguments instead. - */ - FT_BASE( FT_Fixed ) - FT_Hypot( FT_Fixed x, - FT_Fixed y ); - /* */ diff --git a/include/freetype/internal/ftcalc.h b/include/freetype/internal/ftcalc.h index e4924d05d..49631b930 100644 --- a/include/freetype/internal/ftcalc.h +++ b/include/freetype/internal/ftcalc.h @@ -4,7 +4,7 @@ /* */ /* Arithmetic computations (specification). */ /* */ -/* Copyright 1996-2006, 2008, 2009, 2012 by */ +/* Copyright 1996-2006, 2008, 2009, 2012-2013 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -159,7 +159,16 @@ FT_BEGIN_HEADER * Return the most significant bit index. */ FT_BASE( FT_Int ) - FT_MSB( FT_UInt32 z ); + FT_MSB( FT_UInt32 z ); + + + /* + * Return sqrt(x*x+y*y), which is the same as `FT_Vector_Length' but uses + * two fixed-point arguments instead. + */ + FT_BASE( FT_Fixed ) + FT_Hypot( FT_Fixed x, + FT_Fixed y ); #define INT_TO_F26DOT6( x ) ( (FT_Long)(x) << 6 ) diff --git a/src/base/ftcalc.c b/src/base/ftcalc.c index 4122fdad6..b6c592ff7 100644 --- a/src/base/ftcalc.c +++ b/src/base/ftcalc.c @@ -4,7 +4,7 @@ /* */ /* Arithmetic computations (body). */ /* */ -/* Copyright 1996-2006, 2008, 2012 by */ +/* Copyright 1996-2006, 2008, 2012-2013 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -34,6 +34,7 @@ #include #include FT_GLYPH_H +#include FT_TRIGONOMETRY_H #include FT_INTERNAL_CALC_H #include FT_INTERNAL_DEBUG_H #include FT_INTERNAL_OBJECTS_H @@ -139,6 +140,22 @@ } + /* documentation is in ftcalc.h */ + + FT_BASE_DEF( FT_Fixed ) + FT_Hypot( FT_Fixed x, + FT_Fixed y ) + { + FT_Vector v; + + + v.x = x; + v.y = y; + + return FT_Vector_Length( &v ); + } + + #ifdef FT_CONFIG_OPTION_OLD_INTERNALS /* documentation is in ftcalc.h */ diff --git a/src/base/fttrigon.c b/src/base/fttrigon.c index 25498f9ee..e8cc3e3a7 100644 --- a/src/base/fttrigon.c +++ b/src/base/fttrigon.c @@ -492,19 +492,4 @@ } - /* documentation is in fttrigon.h */ - - FT_BASE_DEF( FT_Fixed ) - FT_Hypot( FT_Fixed x, - FT_Fixed y ) - { - FT_Vector v; - - v.x = x; - v.y = y; - - return FT_Vector_Length( &v ); - } - - /* END */ diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c index f611f457b..008b850ab 100644 --- a/src/truetype/ttgload.c +++ b/src/truetype/ttgload.c @@ -22,7 +22,6 @@ #include FT_INTERNAL_STREAM_H #include FT_INTERNAL_SFNT_H #include FT_TRUETYPE_TAGS_H -#include FT_TRIGONOMETRY_H #include FT_OUTLINE_H #include "ttgload.h"