summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/freetype/src/base/ftstream.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/freetype/src/base/ftstream.c')
-rw-r--r--src/3rdparty/freetype/src/base/ftstream.c58
1 files changed, 33 insertions, 25 deletions
diff --git a/src/3rdparty/freetype/src/base/ftstream.c b/src/3rdparty/freetype/src/base/ftstream.c
index 18df7dcfef..4b0890d7fd 100644
--- a/src/3rdparty/freetype/src/base/ftstream.c
+++ b/src/3rdparty/freetype/src/base/ftstream.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* ftstream.c */
-/* */
-/* I/O stream support (body). */
-/* */
-/* Copyright 2000-2018 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ftstream.c
+ *
+ * I/O stream support (body).
+ *
+ * Copyright (C) 2000-2019 by
+ * David Turner, Robert Wilhelm, and Werner Lemberg.
+ *
+ * This file is part of the FreeType project, and may only be used,
+ * modified, and distributed under the terms of the FreeType project
+ * license, LICENSE.TXT. By continuing to use, modify, or distribute
+ * this file you indicate that you have read the license and
+ * understand and accept it fully.
+ *
+ */
#include <ft2build.h>
@@ -21,14 +21,14 @@
#include FT_INTERNAL_DEBUG_H
- /*************************************************************************/
- /* */
- /* The macro FT_COMPONENT is used in trace mode. It is an implicit */
- /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */
- /* messages during execution. */
- /* */
+ /**************************************************************************
+ *
+ * The macro FT_COMPONENT is used in trace mode. It is an implicit
+ * parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log
+ * messages during execution.
+ */
#undef FT_COMPONENT
-#define FT_COMPONENT trace_stream
+#define FT_COMPONENT stream
FT_BASE_DEF( void )
@@ -219,13 +219,14 @@
{
FT_Memory memory = stream->memory;
+
#ifdef FT_DEBUG_MEMORY
ft_mem_free( memory, *pbytes );
- *pbytes = NULL;
#else
FT_FREE( *pbytes );
#endif
}
+
*pbytes = NULL;
}
@@ -238,6 +239,8 @@
FT_ULong read_bytes;
+ FT_TRACE7(( "FT_Stream_EnterFrame: %ld bytes\n", count ));
+
/* check for nested frame access */
FT_ASSERT( stream && stream->cursor == 0 );
@@ -281,6 +284,7 @@
FT_FREE( stream->base );
error = FT_THROW( Invalid_Stream_Operation );
}
+
stream->cursor = stream->base;
stream->limit = stream->cursor + count;
stream->pos += read_bytes;
@@ -321,13 +325,16 @@
/* In this case, the loader code handles the 0-length table */
/* gracefully; however, stream.cursor is really set to 0 by the */
/* FT_Stream_EnterFrame() call, and this is not an error. */
- /* */
+
+ FT_TRACE7(( "FT_Stream_ExitFrame\n" ));
+
FT_ASSERT( stream );
if ( stream->read )
{
FT_Memory memory = stream->memory;
+
#ifdef FT_DEBUG_MEMORY
ft_mem_free( memory, stream->base );
stream->base = NULL;
@@ -335,6 +342,7 @@
FT_FREE( stream->base );
#endif
}
+
stream->cursor = NULL;
stream->limit = NULL;
}