summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/freetype/src/lzw/ftlzw.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/freetype/src/lzw/ftlzw.c')
-rw-r--r--src/3rdparty/freetype/src/lzw/ftlzw.c75
1 files changed, 35 insertions, 40 deletions
diff --git a/src/3rdparty/freetype/src/lzw/ftlzw.c b/src/3rdparty/freetype/src/lzw/ftlzw.c
index cb46f93c68..88383792a8 100644
--- a/src/3rdparty/freetype/src/lzw/ftlzw.c
+++ b/src/3rdparty/freetype/src/lzw/ftlzw.c
@@ -1,35 +1,34 @@
-/***************************************************************************/
-/* */
-/* ftlzw.c */
-/* */
-/* FreeType support for .Z compressed files. */
-/* */
-/* This optional component relies on NetBSD's zopen(). It should mainly */
-/* be used to parse compressed PCF fonts, as found with many X11 server */
-/* distributions. */
-/* */
-/* Copyright 2004-2018 by */
-/* Albert Chin-A-Young. */
-/* */
-/* based on code in `src/gzip/ftgzip.c' */
-/* */
-/* 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>
-#include FT_INTERNAL_MEMORY_H
-#include FT_INTERNAL_STREAM_H
-#include FT_INTERNAL_DEBUG_H
-#include FT_LZW_H
+/****************************************************************************
+ *
+ * ftlzw.c
+ *
+ * FreeType support for .Z compressed files.
+ *
+ * This optional component relies on NetBSD's zopen(). It should mainly
+ * be used to parse compressed PCF fonts, as found with many X11 server
+ * distributions.
+ *
+ * Copyright (C) 2004-2023 by
+ * Albert Chin-A-Young.
+ *
+ * based on code in `src/gzip/ftgzip.c'
+ *
+ * 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 <freetype/internal/ftmemory.h>
+#include <freetype/internal/ftstream.h>
+#include <freetype/internal/ftdebug.h>
+#include <freetype/ftlzw.h>
#include FT_CONFIG_STANDARD_LIBRARY_H
-#include FT_MODULE_ERRORS_H
+#include <freetype/ftmoderr.h>
#undef FTERRORS_H_
@@ -37,15 +36,11 @@
#define FT_ERR_PREFIX LZW_Err_
#define FT_ERR_BASE FT_Mod_Err_LZW
-#include FT_ERRORS_H
+#include <freetype/fterrors.h>
#ifdef FT_CONFIG_OPTION_USE_LZW
-#ifdef FT_CONFIG_OPTION_PIC
-#error "lzw code does not support PIC yet"
-#endif
-
#include "ftzopen.h"
@@ -361,11 +356,11 @@
memory = source->memory;
/*
- * Check the header right now; this prevents allocation of a huge
- * LZWFile object (400 KByte of heap memory) if not necessary.
+ * Check the header right now; this prevents allocation of a huge
+ * LZWFile object (400 KByte of heap memory) if not necessary.
*
- * Did I mention that you should never use .Z compressed font
- * files?
+ * Did I mention that you should never use .Z compressed font
+ * files?
*/
error = ft_lzw_check_header( source );
if ( error )
@@ -374,7 +369,7 @@
FT_ZERO( stream );
stream->memory = memory;
- if ( !FT_NEW( zip ) )
+ if ( !FT_QNEW( zip ) )
{
error = ft_lzw_file_init( zip, stream, source );
if ( error )
@@ -388,7 +383,7 @@
stream->size = 0x7FFFFFFFL; /* don't know the real size! */
stream->pos = 0;
- stream->base = 0;
+ stream->base = NULL;
stream->read = ft_lzw_stream_io;
stream->close = ft_lzw_stream_close;