From cec3f6878e37fcd1c6c15e0e2ab011931d55549e Mon Sep 17 00:00:00 2001 From: Oliver Chang Date: Thu, 5 Nov 2015 16:00:40 -0800 Subject: Merge to XFA: Update bundled freetype to 2.6.1 Also adds a README.pdfium and 0000-include.patch that details the local modifications made. Also rolls testing/corpus to 45f88c6914fcac26ad930bb0ebbfa468c21db0a5 which includes regenerated corpus expectations. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1413673003 . (cherry picked from commit 87ee069d05ca06f60d6cfacd9e426739d8f2053d) Review URL: https://codereview.chromium.org/1416993005 . --- third_party/freetype/src/base/ftstream.c | 88 +++++++++++++++----------------- 1 file changed, 40 insertions(+), 48 deletions(-) (limited to 'third_party/freetype/src/base/ftstream.c') diff --git a/third_party/freetype/src/base/ftstream.c b/third_party/freetype/src/base/ftstream.c index 759fd8fc07..b68f3f82d2 100644 --- a/third_party/freetype/src/base/ftstream.c +++ b/third_party/freetype/src/base/ftstream.c @@ -4,7 +4,7 @@ /* */ /* I/O stream support (body). */ /* */ -/* Copyright 2000-2002, 2004-2006, 2008-2011, 2013 by */ +/* Copyright 2000-2015 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -39,9 +39,9 @@ stream->base = (FT_Byte*) base; stream->size = size; stream->pos = 0; - stream->cursor = 0; - stream->read = 0; - stream->close = 0; + stream->cursor = NULL; + stream->read = NULL; + stream->close = NULL; } @@ -95,11 +95,11 @@ if ( distance < 0 ) return FT_THROW( Invalid_Stream_Operation ); - return FT_Stream_Seek( stream, (FT_ULong)( stream->pos + distance ) ); + return FT_Stream_Seek( stream, stream->pos + (FT_ULong)distance ); } - FT_BASE_DEF( FT_Long ) + FT_BASE_DEF( FT_ULong ) FT_Stream_Pos( FT_Stream stream ) { return stream->pos; @@ -203,8 +203,8 @@ *pbytes = (FT_Byte*)stream->cursor; /* equivalent to FT_Stream_ExitFrame(), with no memory block release */ - stream->cursor = 0; - stream->limit = 0; + stream->cursor = NULL; + stream->limit = NULL; } return error; @@ -226,7 +226,7 @@ FT_FREE( *pbytes ); #endif } - *pbytes = 0; + *pbytes = NULL; } @@ -260,7 +260,9 @@ #ifdef FT_DEBUG_MEMORY /* assume _ft_debug_file and _ft_debug_lineno are already set */ - stream->base = (unsigned char*)ft_mem_qalloc( memory, count, &error ); + stream->base = (unsigned char*)ft_mem_qalloc( memory, + (FT_Long)count, + &error ); if ( error ) goto Exit; #else @@ -333,8 +335,8 @@ FT_FREE( stream->base ); #endif } - stream->cursor = 0; - stream->limit = 0; + stream->cursor = NULL; + stream->limit = NULL; } @@ -348,7 +350,7 @@ result = 0; if ( stream->cursor < stream->limit ) - result = *stream->cursor++; + result = (FT_Char)*stream->cursor++; return result; } @@ -357,8 +359,8 @@ FT_BASE_DEF( FT_UShort ) FT_Stream_GetUShort( FT_Stream stream ) { - FT_Byte* p; - FT_Short result; + FT_Byte* p; + FT_UShort result; FT_ASSERT( stream && stream->cursor ); @@ -376,8 +378,8 @@ FT_BASE_DEF( FT_UShort ) FT_Stream_GetUShortLE( FT_Stream stream ) { - FT_Byte* p; - FT_Short result; + FT_Byte* p; + FT_UShort result; FT_ASSERT( stream && stream->cursor ); @@ -396,7 +398,7 @@ FT_Stream_GetUOffset( FT_Stream stream ) { FT_Byte* p; - FT_Long result; + FT_ULong result; FT_ASSERT( stream && stream->cursor ); @@ -414,7 +416,7 @@ FT_Stream_GetULong( FT_Stream stream ) { FT_Byte* p; - FT_Long result; + FT_ULong result; FT_ASSERT( stream && stream->cursor ); @@ -432,7 +434,7 @@ FT_Stream_GetULongLE( FT_Stream stream ) { FT_Byte* p; - FT_Long result; + FT_ULong result; FT_ASSERT( stream && stream->cursor ); @@ -471,7 +473,7 @@ } stream->pos++; - return result; + return (FT_Char)result; Fail: *error = FT_THROW( Invalid_Stream_Operation ); @@ -485,11 +487,11 @@ FT_BASE_DEF( FT_UShort ) FT_Stream_ReadUShort( FT_Stream stream, - FT_Error* error ) + FT_Error* error ) { - FT_Byte reads[2]; - FT_Byte* p = 0; - FT_Short result = 0; + FT_Byte reads[2]; + FT_Byte* p = 0; + FT_UShort result = 0; FT_ASSERT( stream ); @@ -506,9 +508,7 @@ p = reads; } else - { p = stream->base + stream->pos; - } if ( p ) result = FT_NEXT_USHORT( p ); @@ -532,11 +532,11 @@ FT_BASE_DEF( FT_UShort ) FT_Stream_ReadUShortLE( FT_Stream stream, - FT_Error* error ) + FT_Error* error ) { - FT_Byte reads[2]; - FT_Byte* p = 0; - FT_Short result = 0; + FT_Byte reads[2]; + FT_Byte* p = 0; + FT_UShort result = 0; FT_ASSERT( stream ); @@ -553,9 +553,7 @@ p = reads; } else - { p = stream->base + stream->pos; - } if ( p ) result = FT_NEXT_USHORT_LE( p ); @@ -579,11 +577,11 @@ FT_BASE_DEF( FT_ULong ) FT_Stream_ReadUOffset( FT_Stream stream, - FT_Error* error ) + FT_Error* error ) { FT_Byte reads[3]; - FT_Byte* p = 0; - FT_Long result = 0; + FT_Byte* p = 0; + FT_ULong result = 0; FT_ASSERT( stream ); @@ -600,9 +598,7 @@ p = reads; } else - { p = stream->base + stream->pos; - } if ( p ) result = FT_NEXT_UOFF3( p ); @@ -626,11 +622,11 @@ FT_BASE_DEF( FT_ULong ) FT_Stream_ReadULong( FT_Stream stream, - FT_Error* error ) + FT_Error* error ) { FT_Byte reads[4]; - FT_Byte* p = 0; - FT_Long result = 0; + FT_Byte* p = 0; + FT_ULong result = 0; FT_ASSERT( stream ); @@ -647,9 +643,7 @@ p = reads; } else - { p = stream->base + stream->pos; - } if ( p ) result = FT_NEXT_ULONG( p ); @@ -673,11 +667,11 @@ FT_BASE_DEF( FT_ULong ) FT_Stream_ReadULongLE( FT_Stream stream, - FT_Error* error ) + FT_Error* error ) { FT_Byte reads[4]; - FT_Byte* p = 0; - FT_Long result = 0; + FT_Byte* p = 0; + FT_ULong result = 0; FT_ASSERT( stream ); @@ -694,9 +688,7 @@ p = reads; } else - { p = stream->base + stream->pos; - } if ( p ) result = FT_NEXT_ULONG_LE( p ); -- cgit v1.2.3