src/java.desktop/share/native/libfreetype/src/base/ftstream.c
changeset 54876 da3834261f0c
parent 49234 3375a8039fde
--- a/src/java.desktop/share/native/libfreetype/src/base/ftstream.c	Wed May 08 22:59:20 2019 -0700
+++ b/src/java.desktop/share/native/libfreetype/src/base/ftstream.c	Thu May 09 16:09:39 2019 -0700
@@ -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;
   }