Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1028)

Unified Diff: include/freetype/internal/ftstream.h

Issue 89753003: Update freetype to latest version of ASOP. (Closed) Base URL: https://chromium.googlesource.com/chromium/src/third_party/freetype.git@master
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/freetype/internal/ftserv.h ('k') | include/freetype/internal/fttrace.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/freetype/internal/ftstream.h
diff --git a/include/freetype/internal/ftstream.h b/include/freetype/internal/ftstream.h
index 8b185005f530267e55d8b938fb1ae7cdb50bfce6..26618583209bc05fc6c380bf002dfa1e4b7aeb8a 100644
--- a/include/freetype/internal/ftstream.h
+++ b/include/freetype/internal/ftstream.h
@@ -4,7 +4,7 @@
/* */
/* Stream handling (specification). */
/* */
-/* Copyright 1996-2002, 2004-2006, 2011 by */
+/* Copyright 1996-2002, 2004-2006, 2011, 2013 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -154,67 +154,60 @@ FT_BEGIN_HEADER
/* */
#define FT_BYTE_( p, i ) ( ((const FT_Byte*)(p))[(i)] )
-#define FT_INT8_( p, i ) ( ((const FT_Char*)(p))[(i)] )
#define FT_INT16( x ) ( (FT_Int16)(x) )
#define FT_UINT16( x ) ( (FT_UInt16)(x) )
#define FT_INT32( x ) ( (FT_Int32)(x) )
#define FT_UINT32( x ) ( (FT_UInt32)(x) )
-#define FT_BYTE_I16( p, i, s ) ( FT_INT16( FT_BYTE_( p, i ) ) << (s) )
+
#define FT_BYTE_U16( p, i, s ) ( FT_UINT16( FT_BYTE_( p, i ) ) << (s) )
-#define FT_BYTE_I32( p, i, s ) ( FT_INT32( FT_BYTE_( p, i ) ) << (s) )
#define FT_BYTE_U32( p, i, s ) ( FT_UINT32( FT_BYTE_( p, i ) ) << (s) )
-#define FT_INT8_I16( p, i, s ) ( FT_INT16( FT_INT8_( p, i ) ) << (s) )
-#define FT_INT8_U16( p, i, s ) ( FT_UINT16( FT_INT8_( p, i ) ) << (s) )
-#define FT_INT8_I32( p, i, s ) ( FT_INT32( FT_INT8_( p, i ) ) << (s) )
-#define FT_INT8_U32( p, i, s ) ( FT_UINT32( FT_INT8_( p, i ) ) << (s) )
-
-#define FT_PEEK_SHORT( p ) FT_INT16( FT_INT8_I16( p, 0, 8) | \
- FT_BYTE_I16( p, 1, 0) )
+#define FT_PEEK_SHORT( p ) FT_INT16( FT_BYTE_U16( p, 0, 8) | \
+ FT_BYTE_U16( p, 1, 0) )
#define FT_PEEK_USHORT( p ) FT_UINT16( FT_BYTE_U16( p, 0, 8 ) | \
FT_BYTE_U16( p, 1, 0 ) )
-#define FT_PEEK_LONG( p ) FT_INT32( FT_INT8_I32( p, 0, 24 ) | \
- FT_BYTE_I32( p, 1, 16 ) | \
- FT_BYTE_I32( p, 2, 8 ) | \
- FT_BYTE_I32( p, 3, 0 ) )
+#define FT_PEEK_LONG( p ) FT_INT32( FT_BYTE_U32( p, 0, 24 ) | \
+ FT_BYTE_U32( p, 1, 16 ) | \
+ FT_BYTE_U32( p, 2, 8 ) | \
+ FT_BYTE_U32( p, 3, 0 ) )
#define FT_PEEK_ULONG( p ) FT_UINT32( FT_BYTE_U32( p, 0, 24 ) | \
FT_BYTE_U32( p, 1, 16 ) | \
FT_BYTE_U32( p, 2, 8 ) | \
FT_BYTE_U32( p, 3, 0 ) )
-#define FT_PEEK_OFF3( p ) FT_INT32( FT_INT8_I32( p, 0, 16 ) | \
- FT_BYTE_I32( p, 1, 8 ) | \
- FT_BYTE_I32( p, 2, 0 ) )
+#define FT_PEEK_OFF3( p ) FT_INT32( FT_BYTE_U32( p, 0, 16 ) | \
+ FT_BYTE_U32( p, 1, 8 ) | \
+ FT_BYTE_U32( p, 2, 0 ) )
#define FT_PEEK_UOFF3( p ) FT_UINT32( FT_BYTE_U32( p, 0, 16 ) | \
FT_BYTE_U32( p, 1, 8 ) | \
FT_BYTE_U32( p, 2, 0 ) )
-#define FT_PEEK_SHORT_LE( p ) FT_INT16( FT_INT8_I16( p, 1, 8 ) | \
- FT_BYTE_I16( p, 0, 0 ) )
+#define FT_PEEK_SHORT_LE( p ) FT_INT16( FT_BYTE_U16( p, 1, 8 ) | \
+ FT_BYTE_U16( p, 0, 0 ) )
#define FT_PEEK_USHORT_LE( p ) FT_UINT16( FT_BYTE_U16( p, 1, 8 ) | \
FT_BYTE_U16( p, 0, 0 ) )
-#define FT_PEEK_LONG_LE( p ) FT_INT32( FT_INT8_I32( p, 3, 24 ) | \
- FT_BYTE_I32( p, 2, 16 ) | \
- FT_BYTE_I32( p, 1, 8 ) | \
- FT_BYTE_I32( p, 0, 0 ) )
+#define FT_PEEK_LONG_LE( p ) FT_INT32( FT_BYTE_U32( p, 3, 24 ) | \
+ FT_BYTE_U32( p, 2, 16 ) | \
+ FT_BYTE_U32( p, 1, 8 ) | \
+ FT_BYTE_U32( p, 0, 0 ) )
#define FT_PEEK_ULONG_LE( p ) FT_UINT32( FT_BYTE_U32( p, 3, 24 ) | \
FT_BYTE_U32( p, 2, 16 ) | \
FT_BYTE_U32( p, 1, 8 ) | \
FT_BYTE_U32( p, 0, 0 ) )
-#define FT_PEEK_OFF3_LE( p ) FT_INT32( FT_INT8_I32( p, 2, 16 ) | \
- FT_BYTE_I32( p, 1, 8 ) | \
- FT_BYTE_I32( p, 0, 0 ) )
+#define FT_PEEK_OFF3_LE( p ) FT_INT32( FT_BYTE_U32( p, 2, 16 ) | \
+ FT_BYTE_U32( p, 1, 8 ) | \
+ FT_BYTE_U32( p, 0, 0 ) )
#define FT_PEEK_UOFF3_LE( p ) FT_UINT32( FT_BYTE_U32( p, 2, 16 ) | \
FT_BYTE_U32( p, 1, 8 ) | \
@@ -493,37 +486,41 @@ FT_BEGIN_HEADER
#define FT_STREAM_POS() \
FT_Stream_Pos( stream )
-#define FT_STREAM_SEEK( position ) \
- FT_SET_ERROR( FT_Stream_Seek( stream, position ) )
+#define FT_STREAM_SEEK( position ) \
+ FT_SET_ERROR( FT_Stream_Seek( stream, \
+ (FT_ULong)(position) ) )
-#define FT_STREAM_SKIP( distance ) \
- FT_SET_ERROR( FT_Stream_Skip( stream, distance ) )
+#define FT_STREAM_SKIP( distance ) \
+ FT_SET_ERROR( FT_Stream_Skip( stream, \
+ (FT_Long)(distance) ) )
-#define FT_STREAM_READ( buffer, count ) \
- FT_SET_ERROR( FT_Stream_Read( stream, \
- (FT_Byte*)buffer, \
- count ) )
+#define FT_STREAM_READ( buffer, count ) \
+ FT_SET_ERROR( FT_Stream_Read( stream, \
+ (FT_Byte*)(buffer), \
+ (FT_ULong)(count) ) )
-#define FT_STREAM_READ_AT( position, buffer, count ) \
- FT_SET_ERROR( FT_Stream_ReadAt( stream, \
- position, \
- (FT_Byte*)buffer, \
- count ) )
+#define FT_STREAM_READ_AT( position, buffer, count ) \
+ FT_SET_ERROR( FT_Stream_ReadAt( stream, \
+ (FT_ULong)(position), \
+ (FT_Byte*)buffer, \
+ (FT_ULong)(count) ) )
#define FT_STREAM_READ_FIELDS( fields, object ) \
FT_SET_ERROR( FT_Stream_ReadFields( stream, fields, object ) )
-#define FT_FRAME_ENTER( size ) \
- FT_SET_ERROR( \
- FT_DEBUG_INNER( FT_Stream_EnterFrame( stream, size ) ) )
+#define FT_FRAME_ENTER( size ) \
+ FT_SET_ERROR( \
+ FT_DEBUG_INNER( FT_Stream_EnterFrame( stream, \
+ (FT_ULong)(size) ) ) )
-#define FT_FRAME_EXIT() \
+#define FT_FRAME_EXIT() \
FT_DEBUG_INNER( FT_Stream_ExitFrame( stream ) )
#define FT_FRAME_EXTRACT( size, bytes ) \
FT_SET_ERROR( \
- FT_DEBUG_INNER( FT_Stream_ExtractFrame( stream, size, \
+ FT_DEBUG_INNER( FT_Stream_ExtractFrame( stream, \
+ (FT_ULong)(size), \
(FT_Byte**)&(bytes) ) ) )
#define FT_FRAME_RELEASE( bytes ) \
« no previous file with comments | « include/freetype/internal/ftserv.h ('k') | include/freetype/internal/fttrace.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698