summaryrefslogtreecommitdiff
path: root/Build/source
diff options
context:
space:
mode:
authorAkira Kakuto <kakuto@fuk.kindai.ac.jp>2018-07-08 08:06:14 +0000
committerAkira Kakuto <kakuto@fuk.kindai.ac.jp>2018-07-08 08:06:14 +0000
commitef00973c93c9ddf04b1951a0369b997814d1b1b5 (patch)
tree58948c1b1ef6e19f0ed9a99e2ee5c51083c289be /Build/source
parentddc0b443d002136928658824446de006d03c9c24 (diff)
dvisvgm 2.4.1
git-svn-id: svn://tug.org/texlive/trunk@48164 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source')
-rw-r--r--Build/source/texk/README2
-rw-r--r--Build/source/texk/dvisvgm/ChangeLog4
-rw-r--r--Build/source/texk/dvisvgm/TLpatches/ChangeLog5
-rw-r--r--Build/source/texk/dvisvgm/TLpatches/patch-08-makefiles12
-rwxr-xr-xBuild/source/texk/dvisvgm/configure22
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-src/NEWS7
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-src/README2
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-src/configure.ac4
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-src/doc/conf-dblatex-pdf.xsl15
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-src/doc/dvisvgm.190
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-src/doc/dvisvgm.txt.in53
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/Makefile.am3
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/Makefile.in11
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/common/dictionary.c2
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/common/platform.h276
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/common/transform.c235
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/common/version.h4
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/enc/backward_references.c15
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/enc/brotli_bit_stream.h5
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/enc/command.h12
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/enc/compress_fragment.c10
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/enc/compress_fragment_two_pass.c146
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/enc/encode.c6
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/enc/encoder_dict.h1
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/enc/fast_log.h4
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/enc/hash.h62
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/enc/hash_composite_inc.h133
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/enc/hash_rolling_inc.h215
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/enc/quality.h18
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/enc/static_dict.c10
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/enc/write_bits.h2
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/include/brotli/port.h260
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/include/brotli/types.h7
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-src/libs/woff2/include/woff2/version.h2
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-src/libs/woff2/src/font.cc3
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-src/libs/woff2/src/normalize.cc5
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-src/src/DVIToSVGActions.cpp2
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-src/src/FileSystem.cpp4
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-src/src/FontCache.cpp6
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-src/src/FontMap.cpp2
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-src/src/GFGlyphTracer.cpp4
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-src/src/ImageToSVG.cpp2
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-src/src/MetafontWrapper.cpp8
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-src/src/PsSpecialHandler.cpp2
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-src/src/SourceInput.cpp72
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-src/src/SourceInput.hpp26
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-src/src/StreamReader.cpp6
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-src/src/utility.cpp4
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-src/src/version.hpp2
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-src/tests/DVIReaderTest.cpp2
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-src/tests/GFReaderTest.cpp8
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-src/tests/JFMReaderTest.cpp2
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-src/tests/TFMReaderTest.cpp2
-rw-r--r--Build/source/texk/dvisvgm/version.ac2
54 files changed, 1423 insertions, 396 deletions
diff --git a/Build/source/texk/README b/Build/source/texk/README
index b6ade7b15a0..8eaee381e53 100644
--- a/Build/source/texk/README
+++ b/Build/source/texk/README
@@ -60,7 +60,7 @@ dvipos - maintained here, by us
dvipsk - maintained here, by us
-dvisvgm 2.4 - checked 04may18
+dvisvgm 2.4.1 - checked 08jul18
http://dvisvgm.bplaced.net/Downloads
gregorio 5.1.1 - checked 25mar18
diff --git a/Build/source/texk/dvisvgm/ChangeLog b/Build/source/texk/dvisvgm/ChangeLog
index 174e600413b..5edb62c52ed 100644
--- a/Build/source/texk/dvisvgm/ChangeLog
+++ b/Build/source/texk/dvisvgm/ChangeLog
@@ -1,3 +1,7 @@
+2018-07-08 Akira Kakuto <kakuto@fuk.kindai.ac.jp>
+
+ * Import 2.4.1
+
2018-05-04 Akira Kakuto <kakuto@fuk.kindai.ac.jp>
* Import 2.4.
diff --git a/Build/source/texk/dvisvgm/TLpatches/ChangeLog b/Build/source/texk/dvisvgm/TLpatches/ChangeLog
index 6b5085a6a10..9a3d2190e96 100644
--- a/Build/source/texk/dvisvgm/TLpatches/ChangeLog
+++ b/Build/source/texk/dvisvgm/TLpatches/ChangeLog
@@ -1,3 +1,8 @@
+2018-07-08 Akira Kakuto <kakuto@fuk.kindai.ac.jp>
+
+ * Import 2.4.1.
+ * patch-08-makefiles: adapt.
+
2018-05-04 Akira Kakuto <kakuto@fuk.kindai.ac.jp>
* Import 2.4.
diff --git a/Build/source/texk/dvisvgm/TLpatches/patch-08-makefiles b/Build/source/texk/dvisvgm/TLpatches/patch-08-makefiles
index bef9eaed511..dc9102c0316 100644
--- a/Build/source/texk/dvisvgm/TLpatches/patch-08-makefiles
+++ b/Build/source/texk/dvisvgm/TLpatches/patch-08-makefiles
@@ -1,6 +1,6 @@
-diff -u2r dvisvgm-2.4/Makefile.am dvisvgm-src/Makefile.am
---- dvisvgm-2.4/Makefile.am Tue Jan 02 18:32:38 2018
-+++ dvisvgm-src/Makefile.am Fri May 04 13:03:43 2018
+diff -u2r dvisvgm-2.4.1/Makefile.am dvisvgm-src/Makefile.am
+--- dvisvgm-2.4.1/Makefile.am Tue Jan 02 18:32:38 2018
++++ dvisvgm-src/Makefile.am Sun Jul 08 16:29:11 2018
@@ -6,5 +6,5 @@
AUTOMAKE_OPTIONS = foreign
EXTRA_DIST = COPYING
@@ -8,9 +8,9 @@ diff -u2r dvisvgm-2.4/Makefile.am dvisvgm-src/Makefile.am
+SUBDIRS = libs src #not for TL: tests doc
ACLOCAL_AMFLAGS = -I m4
-diff -u2r dvisvgm-2.4/src/Makefile.am dvisvgm-src/src/Makefile.am
---- dvisvgm-2.4/src/Makefile.am Thu May 03 17:27:18 2018
-+++ dvisvgm-src/src/Makefile.am Fri May 04 13:12:50 2018
+diff -u2r dvisvgm-2.4.1/src/Makefile.am dvisvgm-src/src/Makefile.am
+--- dvisvgm-2.4.1/src/Makefile.am Thu May 03 17:27:18 2018
++++ dvisvgm-src/src/Makefile.am Sun Jul 08 16:39:42 2018
@@ -14,8 +14,5 @@
$(noinst_LIBRARIES) \
../libs/clipper/libclipper.a \
diff --git a/Build/source/texk/dvisvgm/configure b/Build/source/texk/dvisvgm/configure
index c273e40a757..473e63eb50e 100755
--- a/Build/source/texk/dvisvgm/configure
+++ b/Build/source/texk/dvisvgm/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for dvisvgm (TeX Live) 2.4.
+# Generated by GNU Autoconf 2.69 for dvisvgm (TeX Live) 2.4.1.
#
# Report bugs to <tex-k@tug.org>.
#
@@ -590,8 +590,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='dvisvgm (TeX Live)'
PACKAGE_TARNAME='dvisvgm--tex-live-'
-PACKAGE_VERSION='2.4'
-PACKAGE_STRING='dvisvgm (TeX Live) 2.4'
+PACKAGE_VERSION='2.4.1'
+PACKAGE_STRING='dvisvgm (TeX Live) 2.4.1'
PACKAGE_BUGREPORT='tex-k@tug.org'
PACKAGE_URL=''
@@ -1375,7 +1375,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures dvisvgm (TeX Live) 2.4 to adapt to many kinds of systems.
+\`configure' configures dvisvgm (TeX Live) 2.4.1 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1446,7 +1446,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of dvisvgm (TeX Live) 2.4:";;
+ short | recursive ) echo "Configuration of dvisvgm (TeX Live) 2.4.1:";;
esac
cat <<\_ACEOF
@@ -1581,7 +1581,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-dvisvgm (TeX Live) configure 2.4
+dvisvgm (TeX Live) configure 2.4.1
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2449,7 +2449,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by dvisvgm (TeX Live) $as_me 2.4, which was
+It was created by dvisvgm (TeX Live) $as_me 2.4.1, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -8188,7 +8188,7 @@ fi
# Define the identity of the package.
PACKAGE='dvisvgm--tex-live-'
- VERSION='2.4'
+ VERSION='2.4.1'
cat >>confdefs.h <<_ACEOF
@@ -20189,7 +20189,7 @@ Usage: $0 [OPTIONS]
Report bugs to <bug-libtool@gnu.org>."
lt_cl_version="\
-dvisvgm (TeX Live) config.lt 2.4
+dvisvgm (TeX Live) config.lt 2.4.1
configured by $0, generated by GNU Autoconf 2.69.
Copyright (C) 2011 Free Software Foundation, Inc.
@@ -23585,7 +23585,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by dvisvgm (TeX Live) $as_me 2.4, which was
+This file was extended by dvisvgm (TeX Live) $as_me 2.4.1, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -23651,7 +23651,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-dvisvgm (TeX Live) config.status 2.4
+dvisvgm (TeX Live) config.status 2.4.1
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/NEWS b/Build/source/texk/dvisvgm/dvisvgm-src/NEWS
index 5a789c53a0d..b7b2a835d26 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-src/NEWS
+++ b/Build/source/texk/dvisvgm/dvisvgm-src/NEWS
@@ -1,3 +1,10 @@
+dvisvgm-2.4.1 (2018-07-07)
+- fixed handling of delay parameter of option --progress
+- updated brotli library to version 1.0.5
+- updated woff2 library to version 1.0.2
+- updated URLs in manual page
+- several minor code refactorings
+
dvisvgm-2.4 (2018-05-03)
- added special 'pdffile' similar to 'psfile' to embed PDF graphics
- added option --pdf to convert single-page PDF documents to SVG
diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/README b/Build/source/texk/dvisvgm/dvisvgm-src/README
index 101888ffa99..611bdba3324 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-src/README
+++ b/Build/source/texk/dvisvgm/dvisvgm-src/README
@@ -109,7 +109,7 @@ ADDITIONAL INFORMATION
This package is available from CTAN (dviware/dvisvgm) and can be downloaded
from the project website as well:
- http://dvisvgm.bplaced.net
+ https://dvisvgm.de
Here you can find the sources, pre-compiled binaries and further additional
information about the converter and related topics.
diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/configure.ac b/Build/source/texk/dvisvgm/dvisvgm-src/configure.ac
index 22e0a4367fc..8de39262402 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-src/configure.ac
+++ b/Build/source/texk/dvisvgm/dvisvgm-src/configure.ac
@@ -4,8 +4,8 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)
-AC_INIT([dvisvgm],[2.4],[martin.gieseking@uos.de])
-DATE="April 2018"
+AC_INIT([dvisvgm],[2.4.1],[martin.gieseking@uos.de])
+DATE="July 2018"
AC_CONFIG_SRCDIR(src)
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/doc/conf-dblatex-pdf.xsl b/Build/source/texk/dvisvgm/dvisvgm-src/doc/conf-dblatex-pdf.xsl
index 07e75b2e88e..37e41f6c21b 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-src/doc/conf-dblatex-pdf.xsl
+++ b/Build/source/texk/dvisvgm/dvisvgm-src/doc/conf-dblatex-pdf.xsl
@@ -49,4 +49,19 @@
</xsl:call-template>
<xsl:apply-templates/>
</xsl:template>
+
+ <!-- add named list items (e.g. command-line options, specials) to PDF bookmarks -->
+ <xsl:template match="refsect1/variablelist/varlistentry/term[emphasis]">
+ <xsl:text>\phantomsection\pdfbookmark[3]{</xsl:text>
+ <xsl:choose>
+ <xsl:when test="contains(emphasis, '--')">
+ <xsl:value-of select="concat('-{}-', substring-after(emphasis, '--'))"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="emphasis"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:value-of select="concat('}{', generate-id(emphasis), '}&#10;')"/>
+ <xsl:apply-imports/>
+ </xsl:template>
</xsl:stylesheet>
diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/doc/dvisvgm.1 b/Build/source/texk/dvisvgm/dvisvgm-src/doc/dvisvgm.1
index 8c707db8cb0..e49e2b1e6cd 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-src/doc/dvisvgm.1
+++ b/Build/source/texk/dvisvgm/dvisvgm-src/doc/dvisvgm.1
@@ -2,12 +2,12 @@
.\" Title: dvisvgm
.\" Author: Martin Gieseking <martin.gieseking@uos.de>
.\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
-.\" Date: 05/03/2018
+.\" Date: 07/07/2018
.\" Manual: dvisvgm Manual
-.\" Source: dvisvgm 2.4
+.\" Source: dvisvgm 2.4.1
.\" Language: English
.\"
-.TH "DVISVGM" "1" "05/03/2018" "dvisvgm 2\&.4" "dvisvgm Manual"
+.TH "DVISVGM" "1" "07/07/2018" "dvisvgm 2\&.4\&.1" "dvisvgm Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -51,37 +51,6 @@ When running dvisvgm without option \fB\-\-no\-fonts\fR, it creates \fIfont\fR e
.sp
dvisvgm provides a POSIX\-compliant command\-line interface with short and long option names\&. They may be given before and/or after the name of the file to be converted\&. Also, the order of specifying the options is not significant, i\&.e\&. you can add them in any order without changing dvisvgm\(cqs behavior\&. Certain options accept or require additional parameters which are directly appended to or separated by whitespace from a short option (e\&.g\&. \fB\-v0\fR or \fB\-v 0\fR)\&. Long options require an additional equals sign (\fB=\fR) between option name and argument but without any surrounding whitespace (e\&.g\&. \fB\-\-verbosity=0\fR)\&. Multiple short options that don\(cqt expect a further parameter can be combined after a single dash (e\&.g\&. \fB\-ejs\fR rather than \fB\-e \-j \-s\fR)\&.
.PP
-\fB\-a, \-\-trace\-all\fR=[\fIretrace\fR]
-.RS 4
-This option forces dvisvgm to vectorize not only the glyphs actually required to render the SVG file correctly \(en which is the default \(en, but processes all glyphs of all fonts referenced in the DVI file\&. Because dvisvgm stores the tracing results in a font cache, all following conversions of these fonts will speed up significantly\&. The boolean option
-\fIretrace\fR
-determines how to handle glyphs already stored in the cache\&. By default, these glyphs are skipped\&. Setting argument
-\fIretrace\fR
-to
-\fIyes\fR
-or
-\fItrue\fR
-forces dvisvgm to retrace the corresponding bitmaps again\&.
-.if n \{\
-.sp
-.\}
-.RS 4
-.it 1 an-trap
-.nr an-no-space-flag 1
-.nr an-break-flag 1
-.br
-.ps +1
-\fBNote\fR
-.ps -1
-.br
-This option only takes effect if font caching is active\&. Therefore,
-\fB\-\-trace\-all\fR
-cannot be combined with option
-\fB\-\-cache=none\fR\&.
-.sp .5v
-.RE
-.RE
-.PP
\fB\-b, \-\-bbox\fR=\fIfmt\fR
.RS 4
Sets the bounding box of the generated graphic to the specified format\&. The parameter
@@ -214,7 +183,7 @@ attribute\&.
.PP
\fB\-\-color\fR
.RS 4
-Enables colorization of messages printed during the conversion process\&. The colors can be customized via the environment variable
+Enables colorization of messages printed during the conversion process\&. The colors can be customized via environment variable
\fBDVISVGM_COLORS\fR\&. See the
Environment section
below for further information\&.
@@ -400,7 +369,7 @@ tells dvisvgm not to add any visible objects to hyperlinks\&. The lines and boxe
\fIcolor specifier\fR
is either a hexadecimal RGB value of the form
\fI#RRGGBB\fR, or a
-dvips color name (\m[blue]http://en.wikibooks.org/wiki/LaTeX/Colors#The_68_standard_colors_known_to_dvips\m[])\&.
+dvips color name (\m[blue]https://en.wikibooks.org/wiki/LaTeX/Colors#The_68_standard_colors_known_to_dvips\m[])\&.
.sp
Moreover, argument
\fIstyle\fR
@@ -623,6 +592,37 @@ If the optional parameter
is omitted, dvisvgm prints the location of the system\(cqs temp folder and exits\&.
.RE
.PP
+\fB\-a, \-\-trace\-all\fR=[\fIretrace\fR]
+.RS 4
+This option forces dvisvgm to vectorize not only the glyphs actually required to render the SVG file correctly \(en which is the default \(en, but processes all glyphs of all fonts referenced in the DVI file\&. Because dvisvgm stores the tracing results in a font cache, all following conversions of these fonts will speed up significantly\&. The boolean option
+\fIretrace\fR
+determines how to handle glyphs already stored in the cache\&. By default, these glyphs are skipped\&. Setting argument
+\fIretrace\fR
+to
+\fIyes\fR
+or
+\fItrue\fR
+forces dvisvgm to retrace the corresponding bitmaps again\&.
+.if n \{\
+.sp
+.\}
+.RS 4
+.it 1 an-trap
+.nr an-no-space-flag 1
+.nr an-break-flag 1
+.br
+.ps +1
+\fBNote\fR
+.ps -1
+.br
+This option only takes effect if font caching is active\&. Therefore,
+\fB\-\-trace\-all\fR
+cannot be combined with option
+\fB\-\-cache=none\fR\&.
+.sp .5v
+.RE
+.RE
+.PP
\fB\-T, \-\-transform\fR=\fIcommands\fR
.RS 4
Applies a sequence of transformations to the SVG content\&. Each transformation is described by a
@@ -859,9 +859,9 @@ Prints the version of dvisvgm and exits\&. If the optional argument is set to
Creates a compressed SVG file with suffix \&.svgz\&. The optional argument specifies the compression level\&. Valid values are in the range of 1 to 9 (default value is 9)\&. Larger values cause better compression results but may take slightly more computation time\&.
.RE
.PP
-\fB\-Z, \-\-zoom\fR[=\fIfactor\fR]
+\fB\-Z, \-\-zoom\fR=\fIfactor\fR
.RS 4
-Multiplies the
+Multiplies the values of the
\fIwidth\fR
and
\fIheight\fR
@@ -1041,7 +1041,7 @@ The following TeX snippet adds two raw SVG elements to the output and updates th
These specials were introduced with the
\fIemTeX\fR
distribution by Eberhard Mattes\&. They provide line drawing statements, instructions for embedding MSP, PCX, and BMP image files, as well as two PCL commands\&. dvisvgm supports only the line drawing statements and ignores all other em specials silently\&. A description of the command syntax can be found in the DVI driver documentation coming with
-emTeX (\m[blue]http://www.ctan.org/pkg/emtex\m[])\&.
+emTeX (\m[blue]https://ctan.org/pkg/emtex\m[])\&.
.RE
.PP
\fBhtml\fR
@@ -1050,7 +1050,7 @@ The hyperref specification defines several variants on how to mark hyperlinked a
\fIhypertex\fR\&. By default, all linked areas of the document are marked by a rectangle\&. Option
\fB\-\-linkmark\fR
allows to change this behavior\&. See above for further details\&. Information on syntax and semantics of the HyperTeX specials can be found in the
-hyperref manual (\m[blue]http://www.ctan.org/pkg/hyperref\m[])\&.
+hyperref manual (\m[blue]https://ctan.org/pkg/hyperref\m[])\&.
.RE
.PP
\fBpapersize\fR
@@ -1082,7 +1082,7 @@ and
allow for modifying the font map tree while processing the DVI file\&. They are used by CTeX, for example\&. dvisvgm supports both, the dvips and dvipdfm font map format\&. For further information on the command syntax and semantics, see the documentation of
\fB\epdfmapfile\fR
in the
-pdfTeX user manual (\m[blue]http://www.ctan.org/pkg/pdftex\m[])\&.
+pdfTeX user manual (\m[blue]https://ctan.org/pkg/pdftex\m[])\&.
.RE
.PP
\fBps\fR
@@ -1092,7 +1092,7 @@ The famous DVI driver
introduced its own set of specials in order to embed PostScript code into DVI files, which greatly improves the capabilities of DVI documents\&. One aim of dvisvgm is to completely evaluate all PostScript snippets and to convert as many of them as possible to SVG\&. In contrast to dvips, dvisvgm uses floating point arithmetics to compute the precise position of each graphic element, i\&.e\&. it doesn\(cqt round the coordinates\&. Therefore, the relative locations of the graphic elements may slightly differ from those computed by dvips\&.
.sp
Since PostScript is a rather complex language, dvisvgm does not implement its own PostScript interpreter but relies on
-Ghostscript (\m[blue]http://ghostscript.com\m[])
+Ghostscript (\m[blue]https://ghostscript.com\m[])
instead\&. If the Ghostscript library was not linked to the dvisvgm binary, it is looked up and loaded dynamically during runtime\&. In this case, dvisvgm looks for
\fIlibgs\&.so\&.X\fR
on Unix\-like systems (supported ABI versions: 7,8,9), for
@@ -1111,7 +1111,7 @@ to check whether PostScript support is available, i\&.e\&. entry
is present\&.
.sp
The PostScript handler also recognizes and evaluates bounding box data generated by the
-preview package (\m[blue]http://www.ctan.org/pkg/preview\m[])
+preview package (\m[blue]https://ctan.org/pkg/preview\m[])
with option
\fItightpage\fR\&. If such data is present in the DVI file and if dvisvgm is called with option
\fB\-\-bbox=preview\fR, dvisvgm sets the width and total height of the SVG file to the values derived from the preview data\&. Additionally, it prints a message showing the width, height, and depth of the box in TeX point units to the console\&. Especially, the depth value can be read by a post\-processor to vertically align the SVG graphics with the baseline of surrounding text in HTML or XSL\-FO documents, for example\&. Please note that SVG bounding boxes are defined by a width and (total) height\&. In contrast to TeX, SVG provides no means to differentiate between height and depth, i\&.e\&. the vertical extents above and below the baseline, respectively\&. Therefore, it is generally not possible to retrieve the depth value from the SVG file itself\&.
@@ -1192,7 +1192,7 @@ dvisvgm uses the \fBkpathsea\fR library for locating the files that it opens\&.
.sp
If dvisvgm was linked without the Ghostscript library, and if PostScript support has not been disabled, the shared Ghostscript library is looked up during runtime via dlopen()\&. The environment variable \fBLIBGS\fR can be used to specify path and file name of the library\&.
.sp
-The pre\-compiled Windows versions of dvisvgm require a working installation of MiKTeX 2\&.9 or above\&. dvisvgm does not work together with the portable edition of MiKTeX because it relies on MiKTeX\(cqs COM interface that is only accessible in a local installation\&. To enable the evaluation of PostScript specials, the original Ghostscript DLL \fIgsdll32\&.dll\fR must be present and reachable through the search path\&. 64\-bit Windows builds require the 64\-bit Ghostscript DLL \fIgsdll64\&.dll\fR\&. Both DLLs come with the corresponding Ghostscript installers available from \m[blue]\fBhttp://ghostscript\&.com\fR\m[]\&.
+The pre\-compiled Windows versions of dvisvgm require a working installation of MiKTeX 2\&.9 or above\&. dvisvgm does not work together with the portable edition of MiKTeX because it relies on MiKTeX\(cqs COM interface that is only accessible in a local installation\&. To enable the evaluation of PostScript specials, the original Ghostscript DLL \fIgsdll32\&.dll\fR must be present and reachable through the search path\&. 64\-bit Windows builds require the 64\-bit Ghostscript DLL \fIgsdll64\&.dll\fR\&. Both DLLs come with the corresponding Ghostscript installers available from \m[blue]\fBhttps://ghostscript\&.com\fR\m[]\&.
.sp
The environment variable \fBDVISVGM_COLORS\fR specifies the colors used to highlight various parts of dvisvgm\(cqs message output\&. It is only evaluated if option \fB\-\-color\fR is given\&. The value of \fBDVISVGM_COLORS\fR is a list of colon\-separated entries of the form \fIgg\fR=\fIBF\fR, where \fIgg\fR denotes one of the color group indicators listed below, and \fIBF\fR are two hexadecimal digits specifying the background (first digit) and foreground/text color (second digit)\&. The color values are defined as follows: 0=black, 1=red, 2=green, 3=yellow, 4=blue, 5=magenta, 6=cyan, 7=gray, 8=bright red, 9=bright green, A=bright yellow, B=bright blue, C=bright magenta, D=bright cyan, E=bright gray, F=white\&. Depending on the terminal, the colors may differ\&. Rather than changing both the text and background color, it\(cqs also possible to change only one of them: An asterisk (*) in place of a hexadecimal digit indicates the default text or background color of the terminal\&.
.sp
@@ -1353,7 +1353,7 @@ T}
.PP
Project home page
.RS 4
-\m[blue]\fBhttp://dvisvgm\&.bplaced\&.net\fR\m[]
+\m[blue]\fBhttps://dvisvgm\&.de\fR\m[]
.RE
.PP
Code repository
diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/doc/dvisvgm.txt.in b/Build/source/texk/dvisvgm/dvisvgm-src/doc/dvisvgm.txt.in
index ee982c442c3..dff70dd0ceb 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-src/doc/dvisvgm.txt.in
+++ b/Build/source/texk/dvisvgm/dvisvgm-src/doc/dvisvgm.txt.in
@@ -82,21 +82,6 @@ require an additional equals sign (+=+) between option name and argument but wit
whitespace (e.g. +--verbosity=0+). Multiple short options that don't expect a further parameter can
be combined after a single dash (e.g. +-ejs+ rather than +-e -j -s+).
-*-a, --trace-all*=['retrace']::
-This option forces dvisvgm to vectorize not only the glyphs actually required to render the
-SVG file correctly – which is the default –, but processes all glyphs of all fonts referenced in
-the DVI file. Because dvisvgm stores the tracing results in a font cache, all following conversions
-of these fonts will speed up significantly.
-The boolean option 'retrace' determines how to handle glyphs already stored in the cache.
-By default, these glyphs are skipped. Setting argument 'retrace' to 'yes' or 'true' forces dvisvgm
-to retrace the corresponding bitmaps again.
-+
-[NOTE]
-This option only takes effect if font caching is active. Therefore, *--trace-all* cannot be
-combined with option *--cache=none*.
-+
-
-
*-b, --bbox*='fmt'::
Sets the bounding box of the generated graphic to the specified format. The parameter 'fmt'
takes either one of the format specifiers listed below, or a sequence of four comma- or
@@ -159,7 +144,7 @@ elements containing a 'clip-path' attribute.
*--color*::
Enables colorization of messages printed during the conversion process. The colors can be
-customized via the environment variable *DVISVGM_COLORS*. See the <<environment, Environment section>>
+customized via environment variable *DVISVGM_COLORS*. See the <<environment, Environment section>>
below for further information.
*--colornames*::
@@ -299,7 +284,7 @@ the bounding rectangle, and 'none' tells dvisvgm not to add any visible objects
The lines and boxes get the current text color selected. In order to apply a different, constant color,
a colon followed by a color specifier can be appended to the style string. A 'color specifier' is either
a hexadecimal RGB value of the form '#RRGGBB', or a
-http://en.wikibooks.org/wiki/LaTeX/Colors#The_68_standard_colors_known_to_dvips[dvips color name].
+https://en.wikibooks.org/wiki/LaTeX/Colors#The_68_standard_colors_known_to_dvips[dvips color name].
+
Moreover, argument 'style' can take a single color specifier to highlight the linked region by
a frameless box filled with that color. An optional second color specifier separated by a colon
@@ -444,6 +429,20 @@ does not create this folder, so you must ensure that it actually exists before r
If the optional parameter 'path' is omitted, dvisvgm prints the location of the system's
temp folder and exits.
+*-a, --trace-all*=['retrace']::
+This option forces dvisvgm to vectorize not only the glyphs actually required to render the
+SVG file correctly – which is the default –, but processes all glyphs of all fonts referenced in
+the DVI file. Because dvisvgm stores the tracing results in a font cache, all following conversions
+of these fonts will speed up significantly.
+The boolean option 'retrace' determines how to handle glyphs already stored in the cache.
+By default, these glyphs are skipped. Setting argument 'retrace' to 'yes' or 'true' forces dvisvgm
+to retrace the corresponding bitmaps again.
++
+[NOTE]
+This option only takes effect if font caching is active. Therefore, *--trace-all* cannot be
+combined with option *--cache=none*.
++
+
*-T, --transform*='commands'::
Applies a sequence of transformations to the SVG content. Each transformation is described
by a 'command' beginning with a capital letter followed by a list of comma-separated
@@ -544,9 +543,9 @@ Creates a compressed SVG file with suffix .svgz. The optional argument specifies
level. Valid values are in the range of 1 to 9 (default value is 9). Larger values cause better
compression results but may take slightly more computation time.
-*-Z, --zoom*[='factor']::
-Multiplies the 'width' and 'height' attributes of the SVG root element by argument 'factor' while
-the coordinate system of the graphic content is retained. As a result, most SVG viewers zoom the
+*-Z, --zoom*='factor'::
+Multiplies the values of the 'width' and 'height' attributes of the SVG root element by argument 'factor'
+while the coordinate system of the graphic content is retained. As a result, most SVG viewers zoom the
graphics accordingly. If a negative zoom factor is given, the 'width' and 'height' attributes are omitted.
[[specials]]
@@ -652,14 +651,14 @@ These specials were introduced with the 'emTeX' distribution by Eberhard Mattes.
statements, instructions for embedding MSP, PCX, and BMP image files, as well as two PCL commands.
dvisvgm supports only the line drawing statements and ignores all other em specials silently.
A description of the command syntax can be found in the DVI driver documentation coming with
-http://www.ctan.org/pkg/emtex[emTeX].
+https://ctan.org/pkg/emtex[emTeX].
*html*::
The hyperref specification defines several variants on how to mark hyperlinked areas in a DVI file. dvisvgm
supports the plain HyperTeX special constructs as created with hyperref package option 'hypertex'.
By default, all linked areas of the document are marked by a rectangle. Option *--linkmark* allows to change
this behavior. See above for further details. Information on syntax and semantics of the HyperTeX specials can be
-found in the http://www.ctan.org/pkg/hyperref[hyperref manual].
+found in the https://ctan.org/pkg/hyperref[hyperref manual].
*papersize*::
The 'papersize' special, which is an extension introduced by dvips, can be used to specify the widths and
@@ -681,7 +680,7 @@ option *--bbox=papersize* must be given.
'pdf:mapfile' and 'pdf:mapline' allow for modifying the font map tree while processing the DVI file.
They are used by CTeX, for example. dvisvgm supports both, the dvips and dvipdfm font map format. For further
information on the command syntax and semantics, see the documentation of +\pdfmapfile+ in the
-http://www.ctan.org/pkg/pdftex[pdfTeX user manual].
+https://ctan.org/pkg/pdftex[pdfTeX user manual].
*ps*::
The famous DVI driver 'dvips' introduced its own set of specials in order to embed PostScript code into DVI files,
@@ -692,7 +691,7 @@ coordinates. Therefore, the relative locations of the graphic elements may sligh
by dvips.
+
Since PostScript is a rather complex language, dvisvgm does not implement its own PostScript interpreter
-but relies on http://ghostscript.com[Ghostscript] instead. If the Ghostscript library was not linked to the
+but relies on https://ghostscript.com[Ghostscript] instead. If the Ghostscript library was not linked to the
dvisvgm binary, it is looked up and loaded dynamically during runtime. In this case, dvisvgm looks for
'libgs.so.X' on Unix-like systems (supported ABI versions: 7,8,9), for 'libgs.X.dylib' on macOS, and for
'gsdll32.dll' or 'gsdll64.dll' on Windows. You can override the default file names with environment variable
@@ -702,7 +701,7 @@ cannot be found, dvisvgm disables the processing of PostScript specials and prin
Use option *--list-specials* to check whether PostScript support is available, i.e. entry 'ps' is present.
+
The PostScript handler also recognizes and evaluates bounding box data generated by the
-http://www.ctan.org/pkg/preview[preview package] with option 'tightpage'. If such data is present in the DVI file
+https://ctan.org/pkg/preview[preview package] with option 'tightpage'. If such data is present in the DVI file
and if dvisvgm is called with option *--bbox=preview*, dvisvgm sets the width and total height of the SVG file to
the values derived from the preview data. Additionally, it prints a message showing the width, height,
and depth of the box in TeX point units to the console. Especially, the depth value can be read by a post-processor
@@ -764,7 +763,7 @@ dvisvgm does not work together with the portable edition of MiKTeX because it re
interface that is only accessible in a local installation.
To enable the evaluation of PostScript specials, the original Ghostscript DLL 'gsdll32.dll' must be present
and reachable through the search path. 64-bit Windows builds require the 64-bit Ghostscript DLL 'gsdll64.dll'.
-Both DLLs come with the corresponding Ghostscript installers available from http://ghostscript.com.
+Both DLLs come with the corresponding Ghostscript installers available from https://ghostscript.com.
The environment variable *DVISVGM_COLORS* specifies the colors used to highlight various parts of dvisvgm's
message output. It is only evaluated if option *--color* is given. The value of *DVISVGM_COLORS* is a list of
@@ -813,7 +812,7 @@ See also
Resources
---------
-Project home page::: http://dvisvgm.bplaced.net
+Project home page::: https://dvisvgm.de
Code repository::: https://github.com/mgieseki/dvisvgm
Bugs
diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/Makefile.am b/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/Makefile.am
index 0d003184008..e6a446d333c 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/Makefile.am
+++ b/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/Makefile.am
@@ -5,6 +5,7 @@ libbrotli_a_SOURCES = \
common/dictionary.c \
common/dictionary.h \
common/platform.h \
+ common/transform.c \
common/transform.h \
common/version.h \
enc/backward_references.c \
@@ -39,11 +40,13 @@ libbrotli_a_SOURCES = \
enc/entropy_encode_static.h \
enc/fast_log.h \
enc/find_match_length.h \
+ enc/hash_composite_inc.h \
enc/hash_forgetful_chain_inc.h \
enc/hash.h \
enc/hash_longest_match64_inc.h \
enc/hash_longest_match_inc.h \
enc/hash_longest_match_quickly_inc.h \
+ enc/hash_rolling_inc.h \
enc/hash_to_binary_tree_inc.h \
enc/histogram.c \
enc/histogram.h \
diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/Makefile.in b/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/Makefile.in
index c4d165141a3..9f8132a404c 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/Makefile.in
+++ b/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/Makefile.in
@@ -122,7 +122,7 @@ libbrotli_a_AR = $(AR) $(ARFLAGS)
libbrotli_a_LIBADD =
am__dirstamp = $(am__leading_dot)dirstamp
am_libbrotli_a_OBJECTS = common/dictionary.$(OBJEXT) \
- enc/backward_references.$(OBJEXT) \
+ common/transform.$(OBJEXT) enc/backward_references.$(OBJEXT) \
enc/backward_references_hq.$(OBJEXT) enc/bit_cost.$(OBJEXT) \
enc/block_splitter.$(OBJEXT) enc/brotli_bit_stream.$(OBJEXT) \
enc/cluster.$(OBJEXT) enc/compress_fragment.$(OBJEXT) \
@@ -149,6 +149,7 @@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/../../build-aux/depcomp
am__maybe_remake_depfiles = depfiles
am__depfiles_remade = common/$(DEPDIR)/dictionary.Po \
+ common/$(DEPDIR)/transform.Po \
enc/$(DEPDIR)/backward_references.Po \
enc/$(DEPDIR)/backward_references_hq.Po \
enc/$(DEPDIR)/bit_cost.Po enc/$(DEPDIR)/block_splitter.Po \
@@ -363,6 +364,7 @@ libbrotli_a_SOURCES = \
common/dictionary.c \
common/dictionary.h \
common/platform.h \
+ common/transform.c \
common/transform.h \
common/version.h \
enc/backward_references.c \
@@ -397,11 +399,13 @@ libbrotli_a_SOURCES = \
enc/entropy_encode_static.h \
enc/fast_log.h \
enc/find_match_length.h \
+ enc/hash_composite_inc.h \
enc/hash_forgetful_chain_inc.h \
enc/hash.h \
enc/hash_longest_match64_inc.h \
enc/hash_longest_match_inc.h \
enc/hash_longest_match_quickly_inc.h \
+ enc/hash_rolling_inc.h \
enc/hash_to_binary_tree_inc.h \
enc/histogram.c \
enc/histogram.h \
@@ -475,6 +479,8 @@ common/$(DEPDIR)/$(am__dirstamp):
@: > common/$(DEPDIR)/$(am__dirstamp)
common/dictionary.$(OBJEXT): common/$(am__dirstamp) \
common/$(DEPDIR)/$(am__dirstamp)
+common/transform.$(OBJEXT): common/$(am__dirstamp) \
+ common/$(DEPDIR)/$(am__dirstamp)
enc/$(am__dirstamp):
@$(MKDIR_P) enc
@: > enc/$(am__dirstamp)
@@ -532,6 +538,7 @@ distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@common/$(DEPDIR)/dictionary.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@common/$(DEPDIR)/transform.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@enc/$(DEPDIR)/backward_references.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@enc/$(DEPDIR)/backward_references_hq.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@enc/$(DEPDIR)/bit_cost.Po@am__quote@ # am--include-marker
@@ -718,6 +725,7 @@ clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \
distclean: distclean-am
-rm -f common/$(DEPDIR)/dictionary.Po
+ -rm -f common/$(DEPDIR)/transform.Po
-rm -f enc/$(DEPDIR)/backward_references.Po
-rm -f enc/$(DEPDIR)/backward_references_hq.Po
-rm -f enc/$(DEPDIR)/bit_cost.Po
@@ -782,6 +790,7 @@ installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f common/$(DEPDIR)/dictionary.Po
+ -rm -f common/$(DEPDIR)/transform.Po
-rm -f enc/$(DEPDIR)/backward_references.Po
-rm -f enc/$(DEPDIR)/backward_references_hq.Po
-rm -f enc/$(DEPDIR)/bit_cost.Po
diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/common/dictionary.c b/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/common/dictionary.c
index d0872bdd8c9..64822a381bb 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/common/dictionary.c
+++ b/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/common/dictionary.c
@@ -5883,7 +5883,7 @@ static BrotliDictionary kBrotliDictionary = {
122784,
/* data */
-#ifdef BROTLI_EXTERNAL_DICTIONARY_DATA
+#if defined(BROTLI_EXTERNAL_DICTIONARY_DATA)
NULL
#else
kBrotliDictionaryData
diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/common/platform.h b/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/common/platform.h
index 8d1429094c8..9f303bcb67e 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/common/platform.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/common/platform.h
@@ -4,7 +4,21 @@
See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
*/
-/* Macros for compiler / platform specific features and build options. */
+/* Macros for compiler / platform specific features and build options.
+
+ Build options are:
+ * BROTLI_BUILD_32_BIT disables 64-bit optimizations
+ * BROTLI_BUILD_64_BIT forces to use 64-bit optimizations
+ * BROTLI_BUILD_BIG_ENDIAN forces to use big-endian optimizations
+ * BROTLI_BUILD_ENDIAN_NEUTRAL disables endian-aware optimizations
+ * BROTLI_BUILD_LITTLE_ENDIAN forces to use little-endian optimizations
+ * BROTLI_BUILD_PORTABLE disables dangerous optimizations, like unaligned
+ read and overlapping memcpy; this reduces decompression speed by 5%
+ * BROTLI_BUILD_NO_RBIT disables "rbit" optimization for ARM CPUs
+ * BROTLI_DEBUG dumps file name and line number when decoder detects stream
+ or memory error
+ * BROTLI_ENABLE_LOG enables asserts and dumps various state information
+*/
#ifndef BROTLI_COMMON_PLATFORM_H_
#define BROTLI_COMMON_PLATFORM_H_
@@ -15,11 +29,11 @@
#include <brotli/port.h>
#include <brotli/types.h>
-#if defined OS_LINUX || defined OS_CYGWIN
+#if defined(OS_LINUX) || defined(OS_CYGWIN)
#include <endian.h>
-#elif defined OS_FREEBSD
+#elif defined(OS_FREEBSD)
#include <machine/endian.h>
-#elif defined OS_MACOSX
+#elif defined(OS_MACOSX)
#include <machine/endian.h>
/* Let's try and follow the Linux convention */
#define BROTLI_X_BYTE_ORDER BYTE_ORDER
@@ -32,71 +46,138 @@
#include <stdio.h>
#endif
-/* Macros for compiler / platform specific features and build options.
+/* The following macros were borrowed from https://github.com/nemequ/hedley
+ * with permission of original author - Evan Nemerson <evan@nemerson.com> */
- Build options are:
- * BROTLI_BUILD_32_BIT disables 64-bit optimizations
- * BROTLI_BUILD_64_BIT forces to use 64-bit optimizations
- * BROTLI_BUILD_BIG_ENDIAN forces to use big-endian optimizations
- * BROTLI_BUILD_ENDIAN_NEUTRAL disables endian-aware optimizations
- * BROTLI_BUILD_LITTLE_ENDIAN forces to use little-endian optimizations
- * BROTLI_BUILD_PORTABLE disables dangerous optimizations, like unaligned
- read and overlapping memcpy; this reduces decompression speed by 5%
- * BROTLI_BUILD_NO_RBIT disables "rbit" optimization for ARM CPUs
- * BROTLI_DEBUG dumps file name and line number when decoder detects stream
- or memory error
- * BROTLI_ENABLE_LOG enables asserts and dumps various state information
-*/
+/* >>> >>> >>> hedley macros */
+
+/* Define "BROTLI_PREDICT_TRUE" and "BROTLI_PREDICT_FALSE" macros for capable
+ compilers.
+
+To apply compiler hint, enclose the branching condition into macros, like this:
+
+ if (BROTLI_PREDICT_TRUE(zero == 0)) {
+ // main execution path
+ } else {
+ // compiler should place this code outside of main execution path
+ }
+
+OR:
-#if BROTLI_MODERN_COMPILER || __has_attribute(always_inline)
-#define BROTLI_ATTRIBUTE_ALWAYS_INLINE __attribute__ ((always_inline))
+ if (BROTLI_PREDICT_FALSE(something_rare_or_unexpected_happens)) {
+ // compiler should place this code outside of main execution path
+ }
+
+*/
+#if BROTLI_GNUC_HAS_BUILTIN(__builtin_expect, 3, 0, 0) || \
+ BROTLI_INTEL_VERSION_CHECK(16, 0, 0) || \
+ BROTLI_SUNPRO_VERSION_CHECK(5, 12, 0) || \
+ BROTLI_ARM_VERSION_CHECK(4, 1, 0) || \
+ BROTLI_IBM_VERSION_CHECK(10, 1, 0) || \
+ BROTLI_TI_VERSION_CHECK(7, 3, 0) || \
+ BROTLI_TINYC_VERSION_CHECK(0, 9, 27)
+#define BROTLI_PREDICT_TRUE(x) (__builtin_expect(!!(x), 1))
+#define BROTLI_PREDICT_FALSE(x) (__builtin_expect(x, 0))
#else
-#define BROTLI_ATTRIBUTE_ALWAYS_INLINE
+#define BROTLI_PREDICT_FALSE(x) (x)
+#define BROTLI_PREDICT_TRUE(x) (x)
#endif
-#if defined(_WIN32) || defined(__CYGWIN__)
-#define BROTLI_ATTRIBUTE_VISIBILITY_HIDDEN
-#elif BROTLI_MODERN_COMPILER || __has_attribute(visibility)
-#define BROTLI_ATTRIBUTE_VISIBILITY_HIDDEN \
- __attribute__ ((visibility ("hidden")))
+#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && \
+ !defined(__cplusplus)
+#define BROTLI_RESTRICT restrict
+#elif BROTLI_GNUC_VERSION_CHECK(3, 1, 0) || \
+ BROTLI_MSVC_VERSION_CHECK(14, 0, 0) || \
+ BROTLI_INTEL_VERSION_CHECK(16, 0, 0) || \
+ BROTLI_ARM_VERSION_CHECK(4, 1, 0) || \
+ BROTLI_IBM_VERSION_CHECK(10, 1, 0) || \
+ BROTLI_PGI_VERSION_CHECK(17, 10, 0) || \
+ BROTLI_TI_VERSION_CHECK(8, 0, 0) || \
+ BROTLI_IAR_VERSION_CHECK(8, 0, 0) || \
+ (BROTLI_SUNPRO_VERSION_CHECK(5, 14, 0) && defined(__cplusplus))
+#define BROTLI_RESTRICT __restrict
+#elif BROTLI_SUNPRO_VERSION_CHECK(5, 3, 0) && !defined(__cplusplus)
+#define BROTLI_RESTRICT _Restrict
#else
-#define BROTLI_ATTRIBUTE_VISIBILITY_HIDDEN
+#define BROTLI_RESTRICT
#endif
-#ifndef BROTLI_INTERNAL
-#define BROTLI_INTERNAL BROTLI_ATTRIBUTE_VISIBILITY_HIDDEN
+#if (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) || \
+ (defined(__cplusplus) && (__cplusplus >= 199711L))
+#define BROTLI_MAYBE_INLINE inline
+#elif defined(__GNUC_STDC_INLINE__) || defined(__GNUC_GNU_INLINE__) || \
+ BROTLI_ARM_VERSION_CHECK(6, 2, 0)
+#define BROTLI_MAYBE_INLINE __inline__
+#elif BROTLI_MSVC_VERSION_CHECK(12, 0, 0) || \
+ BROTLI_ARM_VERSION_CHECK(4, 1, 0) || BROTLI_TI_VERSION_CHECK(8, 0, 0)
+#define BROTLI_MAYBE_INLINE __inline
+#else
+#define BROTLI_MAYBE_INLINE
#endif
-#ifndef _MSC_VER
-#if defined(__cplusplus) || !defined(__STRICT_ANSI__) || \
- (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L)
-#define BROTLI_INLINE inline BROTLI_ATTRIBUTE_ALWAYS_INLINE
+#if BROTLI_GNUC_HAS_ATTRIBUTE(always_inline, 4, 0, 0) || \
+ BROTLI_INTEL_VERSION_CHECK(16, 0, 0) || \
+ BROTLI_SUNPRO_VERSION_CHECK(5, 11, 0) || \
+ BROTLI_ARM_VERSION_CHECK(4, 1, 0) || \
+ BROTLI_IBM_VERSION_CHECK(10, 1, 0) || \
+ BROTLI_TI_VERSION_CHECK(8, 0, 0) || \
+ (BROTLI_TI_VERSION_CHECK(7, 3, 0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__))
+#define BROTLI_INLINE BROTLI_MAYBE_INLINE __attribute__((__always_inline__))
+#elif BROTLI_MSVC_VERSION_CHECK(12, 0, 0)
+#define BROTLI_INLINE BROTLI_MAYBE_INLINE __forceinline
+#elif BROTLI_TI_VERSION_CHECK(7, 0, 0) && defined(__cplusplus)
+#define BROTLI_INLINE BROTLI_MAYBE_INLINE _Pragma("FUNC_ALWAYS_INLINE;")
+#elif BROTLI_IAR_VERSION_CHECK(8, 0, 0)
+#define BROTLI_INLINE BROTLI_MAYBE_INLINE _Pragma("inline=forced")
#else
-#define BROTLI_INLINE
+#define BROTLI_INLINE BROTLI_MAYBE_INLINE
#endif
-#else /* _MSC_VER */
-#define BROTLI_INLINE __forceinline
-#endif /* _MSC_VER */
-#if BROTLI_MODERN_COMPILER || __has_attribute(unused)
-#define BROTLI_UNUSED_FUNCTION static BROTLI_INLINE __attribute__ ((unused))
+#if BROTLI_GNUC_HAS_ATTRIBUTE(noinline, 4, 0, 0) || \
+ BROTLI_INTEL_VERSION_CHECK(16, 0, 0) || \
+ BROTLI_SUNPRO_VERSION_CHECK(5, 11, 0) || \
+ BROTLI_ARM_VERSION_CHECK(4, 1, 0) || \
+ BROTLI_IBM_VERSION_CHECK(10, 1, 0) || \
+ BROTLI_TI_VERSION_CHECK(8, 0, 0) || \
+ (BROTLI_TI_VERSION_CHECK(7, 3, 0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__))
+#define BROTLI_NOINLINE __attribute__((__noinline__))
+#elif BROTLI_MSVC_VERSION_CHECK(13, 10, 0)
+#define BROTLI_NOINLINE __declspec(noinline)
+#elif BROTLI_PGI_VERSION_CHECK(10, 2, 0)
+#define BROTLI_NOINLINE _Pragma("noinline")
+#elif BROTLI_TI_VERSION_CHECK(6, 0, 0) && defined(__cplusplus)
+#define BROTLI_NOINLINE _Pragma("FUNC_CANNOT_INLINE;")
+#elif BROTLI_IAR_VERSION_CHECK(8, 0, 0)
+#define BROTLI_NOINLINE _Pragma("inline=never")
#else
-#define BROTLI_UNUSED_FUNCTION static BROTLI_INLINE
+#define BROTLI_NOINLINE
#endif
-#if !defined(__cplusplus) && !defined(c_plusplus) && \
- (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L)
-#define BROTLI_RESTRICT restrict
-#elif BROTLI_GCC_VERSION > 295 || defined(__llvm__)
-#define BROTLI_RESTRICT __restrict
+/* BROTLI_INTERNAL could be defined to override visibility, e.g. for tests. */
+#if !defined(BROTLI_INTERNAL)
+#if defined(_WIN32) || defined(__CYGWIN__)
+#define BROTLI_INTERNAL
+#elif BROTLI_GNUC_VERSION_CHECK(3, 3, 0) || \
+ BROTLI_TI_VERSION_CHECK(8, 0, 0) || \
+ BROTLI_INTEL_VERSION_CHECK(16, 0, 0) || \
+ BROTLI_ARM_VERSION_CHECK(4, 1, 0) || \
+ BROTLI_IBM_VERSION_CHECK(13, 1, 0) || \
+ BROTLI_SUNPRO_VERSION_CHECK(5, 11, 0) || \
+ (BROTLI_TI_VERSION_CHECK(7, 3, 0) && \
+ defined(__TI_GNU_ATTRIBUTE_SUPPORT__) && defined(__TI_EABI__))
+#define BROTLI_INTERNAL __attribute__ ((visibility ("hidden")))
#else
-#define BROTLI_RESTRICT
+#define BROTLI_INTERNAL
#endif
+#endif
+
+/* <<< <<< <<< end of hedley macros. */
-#if BROTLI_MODERN_COMPILER || __has_attribute(noinline)
-#define BROTLI_NOINLINE __attribute__((noinline))
+#if BROTLI_GNUC_HAS_ATTRIBUTE(unused, 2, 7, 0) || \
+ BROTLI_INTEL_VERSION_CHECK(16, 0, 0)
+#define BROTLI_UNUSED_FUNCTION static BROTLI_INLINE __attribute__ ((unused))
#else
-#define BROTLI_NOINLINE
+#define BROTLI_UNUSED_FUNCTION static BROTLI_INLINE
#endif
#if (defined(__ARM_ARCH) && (__ARM_ARCH == 7)) || \
@@ -121,12 +202,16 @@
#define BROTLI_TARGET_POWERPC64
#endif
+#if defined(__riscv) && defined(__riscv_xlen) && __riscv_xlen == 64
+#define BROTLI_TARGET_RISCV64
+#endif
+
#if defined(BROTLI_BUILD_64_BIT)
#define BROTLI_64_BITS 1
#elif defined(BROTLI_BUILD_32_BIT)
#define BROTLI_64_BITS 0
#elif defined(BROTLI_TARGET_X64) || defined(BROTLI_TARGET_ARMV8) || \
- defined(BROTLI_TARGET_POWERPC64)
+ defined(BROTLI_TARGET_POWERPC64) || defined(BROTLI_TARGET_RISCV64)
#define BROTLI_64_BITS 1
#else
#define BROTLI_64_BITS 0
@@ -167,16 +252,17 @@
#define BROTLI_BIG_ENDIAN 0
#endif
-#ifdef BROTLI_X_BYTE_ORDER
+#if defined(BROTLI_X_BYTE_ORDER)
#undef BROTLI_X_BYTE_ORDER
#undef BROTLI_X_LITTLE_ENDIAN
#undef BROTLI_X_BIG_ENDIAN
#endif
-#ifdef BROTLI_BUILD_PORTABLE
+#if defined(BROTLI_BUILD_PORTABLE)
#define BROTLI_ALIGNED_READ (!!1)
#elif defined(BROTLI_TARGET_X86) || defined(BROTLI_TARGET_X64) || \
- defined(BROTLI_TARGET_ARMV7) || defined(BROTLI_TARGET_ARMV8)
+ defined(BROTLI_TARGET_ARMV7) || defined(BROTLI_TARGET_ARMV8) || \
+ defined(BROTLI_TARGET_RISCV64)
/* Allow unaligned read only for white-listed CPUs. */
#define BROTLI_ALIGNED_READ (!!0)
#else
@@ -306,34 +392,9 @@ static BROTLI_INLINE void BROTLI_UNALIGNED_STORE64LE(void* p, uint64_t v) {
}
#endif /* BROTLI_LITTLE_ENDIAN */
-/* Define "BROTLI_PREDICT_TRUE" and "BROTLI_PREDICT_FALSE" macros for capable
- compilers.
-
-To apply compiler hint, enclose the branching condition into macros, like this:
-
- if (BROTLI_PREDICT_TRUE(zero == 0)) {
- // main execution path
- } else {
- // compiler should place this code outside of main execution path
- }
-
-OR:
-
- if (BROTLI_PREDICT_FALSE(something_rare_or_unexpected_happens)) {
- // compiler should place this code outside of main execution path
- }
-
-*/
-#if BROTLI_MODERN_COMPILER || __has_builtin(__builtin_expect)
-#define BROTLI_PREDICT_TRUE(x) (__builtin_expect(!!(x), 1))
-#define BROTLI_PREDICT_FALSE(x) (__builtin_expect(x, 0))
-#else
-#define BROTLI_PREDICT_FALSE(x) (x)
-#define BROTLI_PREDICT_TRUE(x) (x)
-#endif
-
/* BROTLI_IS_CONSTANT macros returns true for compile-time constants. */
-#if BROTLI_MODERN_COMPILER || __has_builtin(__builtin_constant_p)
+#if BROTLI_GNUC_HAS_BUILTIN(__builtin_constant_p, 3, 0, 1) || \
+ BROTLI_INTEL_VERSION_CHECK(16, 0, 0)
#define BROTLI_IS_CONSTANT(x) (!!__builtin_constant_p(x))
#else
#define BROTLI_IS_CONSTANT(x) (!!0)
@@ -345,7 +406,7 @@ OR:
#define BROTLI_HAS_UBFX (!!0)
#endif
-#ifdef BROTLI_ENABLE_LOG
+#if defined(BROTLI_ENABLE_LOG)
#define BROTLI_DCHECK(x) assert(x)
#define BROTLI_LOG(x) printf x
#else
@@ -363,7 +424,8 @@ static BROTLI_INLINE void BrotliDump(const char* f, int l, const char* fn) {
#define BROTLI_DUMP() (void)(0)
#endif
-#if (BROTLI_MODERN_COMPILER || defined(__llvm__)) && \
+/* TODO: add appropriate icc/sunpro/arm/ibm/ti checks. */
+#if (BROTLI_GNUC_VERSION_CHECK(3, 0, 0) || defined(__llvm__)) && \
!defined(BROTLI_BUILD_NO_RBIT)
#if defined(BROTLI_TARGET_ARMV7) || defined(BROTLI_TARGET_ARMV8)
/* TODO: detect ARMv6T2 and enable this code for it. */
@@ -415,32 +477,32 @@ static void BrotliDefaultFreeFunc(void* opaque, void* address) {
}
BROTLI_UNUSED_FUNCTION void BrotliSuppressUnusedFunctions(void) {
- BROTLI_UNUSED(BrotliSuppressUnusedFunctions);
- BROTLI_UNUSED(BrotliUnalignedRead16);
- BROTLI_UNUSED(BrotliUnalignedRead32);
- BROTLI_UNUSED(BrotliUnalignedRead64);
- BROTLI_UNUSED(BrotliUnalignedWrite64);
- BROTLI_UNUSED(BROTLI_UNALIGNED_LOAD16LE);
- BROTLI_UNUSED(BROTLI_UNALIGNED_LOAD32LE);
- BROTLI_UNUSED(BROTLI_UNALIGNED_LOAD64LE);
- BROTLI_UNUSED(BROTLI_UNALIGNED_STORE64LE);
- BROTLI_UNUSED(BrotliRBit);
- BROTLI_UNUSED(brotli_min_double);
- BROTLI_UNUSED(brotli_max_double);
- BROTLI_UNUSED(brotli_min_float);
- BROTLI_UNUSED(brotli_max_float);
- BROTLI_UNUSED(brotli_min_int);
- BROTLI_UNUSED(brotli_max_int);
- BROTLI_UNUSED(brotli_min_size_t);
- BROTLI_UNUSED(brotli_max_size_t);
- BROTLI_UNUSED(brotli_min_uint32_t);
- BROTLI_UNUSED(brotli_max_uint32_t);
- BROTLI_UNUSED(brotli_min_uint8_t);
- BROTLI_UNUSED(brotli_max_uint8_t);
- BROTLI_UNUSED(BrotliDefaultAllocFunc);
- BROTLI_UNUSED(BrotliDefaultFreeFunc);
+ BROTLI_UNUSED(&BrotliSuppressUnusedFunctions);
+ BROTLI_UNUSED(&BrotliUnalignedRead16);
+ BROTLI_UNUSED(&BrotliUnalignedRead32);
+ BROTLI_UNUSED(&BrotliUnalignedRead64);
+ BROTLI_UNUSED(&BrotliUnalignedWrite64);
+ BROTLI_UNUSED(&BROTLI_UNALIGNED_LOAD16LE);
+ BROTLI_UNUSED(&BROTLI_UNALIGNED_LOAD32LE);
+ BROTLI_UNUSED(&BROTLI_UNALIGNED_LOAD64LE);
+ BROTLI_UNUSED(&BROTLI_UNALIGNED_STORE64LE);
+ BROTLI_UNUSED(&BrotliRBit);
+ BROTLI_UNUSED(&brotli_min_double);
+ BROTLI_UNUSED(&brotli_max_double);
+ BROTLI_UNUSED(&brotli_min_float);
+ BROTLI_UNUSED(&brotli_max_float);
+ BROTLI_UNUSED(&brotli_min_int);
+ BROTLI_UNUSED(&brotli_max_int);
+ BROTLI_UNUSED(&brotli_min_size_t);
+ BROTLI_UNUSED(&brotli_max_size_t);
+ BROTLI_UNUSED(&brotli_min_uint32_t);
+ BROTLI_UNUSED(&brotli_max_uint32_t);
+ BROTLI_UNUSED(&brotli_min_uint8_t);
+ BROTLI_UNUSED(&brotli_max_uint8_t);
+ BROTLI_UNUSED(&BrotliDefaultAllocFunc);
+ BROTLI_UNUSED(&BrotliDefaultFreeFunc);
#if defined(BROTLI_DEBUG) || defined(BROTLI_ENABLE_LOG)
- BROTLI_UNUSED(BrotliDump);
+ BROTLI_UNUSED(&BrotliDump);
#endif
}
diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/common/transform.c b/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/common/transform.c
new file mode 100644
index 00000000000..4184ae53814
--- /dev/null
+++ b/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/common/transform.c
@@ -0,0 +1,235 @@
+/* Copyright 2013 Google Inc. All Rights Reserved.
+
+ Distributed under MIT license.
+ See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
+*/
+
+#include "./transform.h"
+
+#if defined(__cplusplus) || defined(c_plusplus)
+extern "C" {
+#endif
+
+/* RFC 7932 transforms string data */
+static const char kPrefixSuffix[217] =
+ "\1 \2, \10 of the \4 of \2s \1.\5 and \4 "
+/* 0x _0 _2 __5 _E _3 _6 _8 _E */
+ "in \1\"\4 to \2\">\1\n\2. \1]\5 for \3 a \6 "
+/* 2x _3_ _5 _A_ _D_ _F _2 _4 _A _E */
+ "that \1\'\6 with \6 from \4 by \1(\6. T"
+/* 4x _5_ _7 _E _5 _A _C */
+ "he \4 on \4 as \4 is \4ing \2\n\t\1:\3ed "
+/* 6x _3 _8 _D _2 _7_ _ _A _C */
+ "\2=\"\4 at \3ly \1,\2=\'\5.com/\7. This \5"
+/* 8x _0 _ _3 _8 _C _E _ _1 _7 _F */
+ " not \3er \3al \4ful \4ive \5less \4es"
+/* Ax _5 _9 _D _2 _7 _D */
+ "t \4ize \2\xc2\xa0\4ous \5 the \2e \0";
+/* Cx _2 _7___ ___ _A _F _5 _8 */
+
+static const uint16_t kPrefixSuffixMap[50] = {
+ 0x00, 0x02, 0x05, 0x0E, 0x13, 0x16, 0x18, 0x1E, 0x23, 0x25,
+ 0x2A, 0x2D, 0x2F, 0x32, 0x34, 0x3A, 0x3E, 0x45, 0x47, 0x4E,
+ 0x55, 0x5A, 0x5C, 0x63, 0x68, 0x6D, 0x72, 0x77, 0x7A, 0x7C,
+ 0x80, 0x83, 0x88, 0x8C, 0x8E, 0x91, 0x97, 0x9F, 0xA5, 0xA9,
+ 0xAD, 0xB2, 0xB7, 0xBD, 0xC2, 0xC7, 0xCA, 0xCF, 0xD5, 0xD8
+};
+
+/* RFC 7932 transforms */
+static const uint8_t kTransformsData[] = {
+ 49, BROTLI_TRANSFORM_IDENTITY, 49,
+ 49, BROTLI_TRANSFORM_IDENTITY, 0,
+ 0, BROTLI_TRANSFORM_IDENTITY, 0,
+ 49, BROTLI_TRANSFORM_OMIT_FIRST_1, 49,
+ 49, BROTLI_TRANSFORM_UPPERCASE_FIRST, 0,
+ 49, BROTLI_TRANSFORM_IDENTITY, 47,
+ 0, BROTLI_TRANSFORM_IDENTITY, 49,
+ 4, BROTLI_TRANSFORM_IDENTITY, 0,
+ 49, BROTLI_TRANSFORM_IDENTITY, 3,
+ 49, BROTLI_TRANSFORM_UPPERCASE_FIRST, 49,
+ 49, BROTLI_TRANSFORM_IDENTITY, 6,
+ 49, BROTLI_TRANSFORM_OMIT_FIRST_2, 49,
+ 49, BROTLI_TRANSFORM_OMIT_LAST_1, 49,
+ 1, BROTLI_TRANSFORM_IDENTITY, 0,
+ 49, BROTLI_TRANSFORM_IDENTITY, 1,
+ 0, BROTLI_TRANSFORM_UPPERCASE_FIRST, 0,
+ 49, BROTLI_TRANSFORM_IDENTITY, 7,
+ 49, BROTLI_TRANSFORM_IDENTITY, 9,
+ 48, BROTLI_TRANSFORM_IDENTITY, 0,
+ 49, BROTLI_TRANSFORM_IDENTITY, 8,
+ 49, BROTLI_TRANSFORM_IDENTITY, 5,
+ 49, BROTLI_TRANSFORM_IDENTITY, 10,
+ 49, BROTLI_TRANSFORM_IDENTITY, 11,
+ 49, BROTLI_TRANSFORM_OMIT_LAST_3, 49,
+ 49, BROTLI_TRANSFORM_IDENTITY, 13,
+ 49, BROTLI_TRANSFORM_IDENTITY, 14,
+ 49, BROTLI_TRANSFORM_OMIT_FIRST_3, 49,
+ 49, BROTLI_TRANSFORM_OMIT_LAST_2, 49,
+ 49, BROTLI_TRANSFORM_IDENTITY, 15,
+ 49, BROTLI_TRANSFORM_IDENTITY, 16,
+ 0, BROTLI_TRANSFORM_UPPERCASE_FIRST, 49,
+ 49, BROTLI_TRANSFORM_IDENTITY, 12,
+ 5, BROTLI_TRANSFORM_IDENTITY, 49,
+ 0, BROTLI_TRANSFORM_IDENTITY, 1,
+ 49, BROTLI_TRANSFORM_OMIT_FIRST_4, 49,
+ 49, BROTLI_TRANSFORM_IDENTITY, 18,
+ 49, BROTLI_TRANSFORM_IDENTITY, 17,
+ 49, BROTLI_TRANSFORM_IDENTITY, 19,
+ 49, BROTLI_TRANSFORM_IDENTITY, 20,
+ 49, BROTLI_TRANSFORM_OMIT_FIRST_5, 49,
+ 49, BROTLI_TRANSFORM_OMIT_FIRST_6, 49,
+ 47, BROTLI_TRANSFORM_IDENTITY, 49,
+ 49, BROTLI_TRANSFORM_OMIT_LAST_4, 49,
+ 49, BROTLI_TRANSFORM_IDENTITY, 22,
+ 49, BROTLI_TRANSFORM_UPPERCASE_ALL, 49,
+ 49, BROTLI_TRANSFORM_IDENTITY, 23,
+ 49, BROTLI_TRANSFORM_IDENTITY, 24,
+ 49, BROTLI_TRANSFORM_IDENTITY, 25,
+ 49, BROTLI_TRANSFORM_OMIT_LAST_7, 49,
+ 49, BROTLI_TRANSFORM_OMIT_LAST_1, 26,
+ 49, BROTLI_TRANSFORM_IDENTITY, 27,
+ 49, BROTLI_TRANSFORM_IDENTITY, 28,
+ 0, BROTLI_TRANSFORM_IDENTITY, 12,
+ 49, BROTLI_TRANSFORM_IDENTITY, 29,
+ 49, BROTLI_TRANSFORM_OMIT_FIRST_9, 49,
+ 49, BROTLI_TRANSFORM_OMIT_FIRST_7, 49,
+ 49, BROTLI_TRANSFORM_OMIT_LAST_6, 49,
+ 49, BROTLI_TRANSFORM_IDENTITY, 21,
+ 49, BROTLI_TRANSFORM_UPPERCASE_FIRST, 1,
+ 49, BROTLI_TRANSFORM_OMIT_LAST_8, 49,
+ 49, BROTLI_TRANSFORM_IDENTITY, 31,
+ 49, BROTLI_TRANSFORM_IDENTITY, 32,
+ 47, BROTLI_TRANSFORM_IDENTITY, 3,
+ 49, BROTLI_TRANSFORM_OMIT_LAST_5, 49,
+ 49, BROTLI_TRANSFORM_OMIT_LAST_9, 49,
+ 0, BROTLI_TRANSFORM_UPPERCASE_FIRST, 1,
+ 49, BROTLI_TRANSFORM_UPPERCASE_FIRST, 8,
+ 5, BROTLI_TRANSFORM_IDENTITY, 21,
+ 49, BROTLI_TRANSFORM_UPPERCASE_ALL, 0,
+ 49, BROTLI_TRANSFORM_UPPERCASE_FIRST, 10,
+ 49, BROTLI_TRANSFORM_IDENTITY, 30,
+ 0, BROTLI_TRANSFORM_IDENTITY, 5,
+ 35, BROTLI_TRANSFORM_IDENTITY, 49,
+ 47, BROTLI_TRANSFORM_IDENTITY, 2,
+ 49, BROTLI_TRANSFORM_UPPERCASE_FIRST, 17,
+ 49, BROTLI_TRANSFORM_IDENTITY, 36,
+ 49, BROTLI_TRANSFORM_IDENTITY, 33,
+ 5, BROTLI_TRANSFORM_IDENTITY, 0,
+ 49, BROTLI_TRANSFORM_UPPERCASE_FIRST, 21,
+ 49, BROTLI_TRANSFORM_UPPERCASE_FIRST, 5,
+ 49, BROTLI_TRANSFORM_IDENTITY, 37,
+ 0, BROTLI_TRANSFORM_IDENTITY, 30,
+ 49, BROTLI_TRANSFORM_IDENTITY, 38,
+ 0, BROTLI_TRANSFORM_UPPERCASE_ALL, 0,
+ 49, BROTLI_TRANSFORM_IDENTITY, 39,
+ 0, BROTLI_TRANSFORM_UPPERCASE_ALL, 49,
+ 49, BROTLI_TRANSFORM_IDENTITY, 34,
+ 49, BROTLI_TRANSFORM_UPPERCASE_ALL, 8,
+ 49, BROTLI_TRANSFORM_UPPERCASE_FIRST, 12,
+ 0, BROTLI_TRANSFORM_IDENTITY, 21,
+ 49, BROTLI_TRANSFORM_IDENTITY, 40,
+ 0, BROTLI_TRANSFORM_UPPERCASE_FIRST, 12,
+ 49, BROTLI_TRANSFORM_IDENTITY, 41,
+ 49, BROTLI_TRANSFORM_IDENTITY, 42,
+ 49, BROTLI_TRANSFORM_UPPERCASE_ALL, 17,
+ 49, BROTLI_TRANSFORM_IDENTITY, 43,
+ 0, BROTLI_TRANSFORM_UPPERCASE_FIRST, 5,
+ 49, BROTLI_TRANSFORM_UPPERCASE_ALL, 10,
+ 0, BROTLI_TRANSFORM_IDENTITY, 34,
+ 49, BROTLI_TRANSFORM_UPPERCASE_FIRST, 33,
+ 49, BROTLI_TRANSFORM_IDENTITY, 44,
+ 49, BROTLI_TRANSFORM_UPPERCASE_ALL, 5,
+ 45, BROTLI_TRANSFORM_IDENTITY, 49,
+ 0, BROTLI_TRANSFORM_IDENTITY, 33,
+ 49, BROTLI_TRANSFORM_UPPERCASE_FIRST, 30,
+ 49, BROTLI_TRANSFORM_UPPERCASE_ALL, 30,
+ 49, BROTLI_TRANSFORM_IDENTITY, 46,
+ 49, BROTLI_TRANSFORM_UPPERCASE_ALL, 1,
+ 49, BROTLI_TRANSFORM_UPPERCASE_FIRST, 34,
+ 0, BROTLI_TRANSFORM_UPPERCASE_FIRST, 33,
+ 0, BROTLI_TRANSFORM_UPPERCASE_ALL, 30,
+ 0, BROTLI_TRANSFORM_UPPERCASE_ALL, 1,
+ 49, BROTLI_TRANSFORM_UPPERCASE_ALL, 33,
+ 49, BROTLI_TRANSFORM_UPPERCASE_ALL, 21,
+ 49, BROTLI_TRANSFORM_UPPERCASE_ALL, 12,
+ 0, BROTLI_TRANSFORM_UPPERCASE_ALL, 5,
+ 49, BROTLI_TRANSFORM_UPPERCASE_ALL, 34,
+ 0, BROTLI_TRANSFORM_UPPERCASE_ALL, 12,
+ 0, BROTLI_TRANSFORM_UPPERCASE_FIRST, 30,
+ 0, BROTLI_TRANSFORM_UPPERCASE_ALL, 34,
+ 0, BROTLI_TRANSFORM_UPPERCASE_FIRST, 34,
+};
+
+static BrotliTransforms kBrotliTransforms = {
+ sizeof(kPrefixSuffix),
+ (const uint8_t*)kPrefixSuffix,
+ kPrefixSuffixMap,
+ sizeof(kTransformsData) / (3 * sizeof(kTransformsData[0])),
+ kTransformsData,
+ {0, 12, 27, 23, 42, 63, 56, 48, 59, 64}
+};
+
+const BrotliTransforms* BrotliGetTransforms(void) {
+ return &kBrotliTransforms;
+}
+
+static int ToUpperCase(uint8_t* p) {
+ if (p[0] < 0xC0) {
+ if (p[0] >= 'a' && p[0] <= 'z') {
+ p[0] ^= 32;
+ }
+ return 1;
+ }
+ /* An overly simplified uppercasing model for UTF-8. */
+ if (p[0] < 0xE0) {
+ p[1] ^= 32;
+ return 2;
+ }
+ /* An arbitrary transform for three byte characters. */
+ p[2] ^= 5;
+ return 3;
+}
+
+int BrotliTransformDictionaryWord(uint8_t* dst, const uint8_t* word, int len,
+ const BrotliTransforms* transforms, int transfom_idx) {
+ int idx = 0;
+ const uint8_t* prefix = BROTLI_TRANSFORM_PREFIX(transforms, transfom_idx);
+ uint8_t type = BROTLI_TRANSFORM_TYPE(transforms, transfom_idx);
+ const uint8_t* suffix = BROTLI_TRANSFORM_SUFFIX(transforms, transfom_idx);
+ {
+ int prefix_len = *prefix++;
+ while (prefix_len--) { dst[idx++] = *prefix++; }
+ }
+ {
+ const int t = type;
+ int i = 0;
+ if (t <= BROTLI_TRANSFORM_OMIT_LAST_9) {
+ len -= t;
+ } else if (t >= BROTLI_TRANSFORM_OMIT_FIRST_1
+ && t <= BROTLI_TRANSFORM_OMIT_FIRST_9) {
+ int skip = t - (BROTLI_TRANSFORM_OMIT_FIRST_1 - 1);
+ word += skip;
+ len -= skip;
+ }
+ while (i < len) { dst[idx++] = word[i++]; }
+ if (t == BROTLI_TRANSFORM_UPPERCASE_FIRST) {
+ ToUpperCase(&dst[idx - len]);
+ } else if (t == BROTLI_TRANSFORM_UPPERCASE_ALL) {
+ uint8_t* uppercase = &dst[idx - len];
+ while (len > 0) {
+ int step = ToUpperCase(uppercase);
+ uppercase += step;
+ len -= step;
+ }
+ }
+ }
+ {
+ int suffix_len = *suffix++;
+ while (suffix_len--) { dst[idx++] = *suffix++; }
+ return idx;
+ }
+}
+
+#if defined(__cplusplus) || defined(c_plusplus)
+} /* extern "C" */
+#endif
diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/common/version.h b/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/common/version.h
index 54470f6006f..f787d06a272 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/common/version.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/common/version.h
@@ -14,13 +14,13 @@
BrotliEncoderVersion methods. */
/* Semantic version, calculated as (MAJOR << 24) | (MINOR << 12) | PATCH */
-#define BROTLI_VERSION 0x1000004
+#define BROTLI_VERSION 0x1000005
/* This macro is used by build system to produce Libtool-friendly soname. See
https://www.gnu.org/software/libtool/manual/html_node/Libtool-versioning.html
*/
/* ABI version, calculated as (CURRENT << 24) | (REVISION << 12) | AGE */
-#define BROTLI_ABI_VERSION 0x1004000
+#define BROTLI_ABI_VERSION 0x1005000
#endif /* BROTLI_COMMON_VERSION_H_ */
diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/enc/backward_references.c b/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/enc/backward_references.c
index 3dd897b217a..cd023d9b41c 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/enc/backward_references.c
+++ b/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/enc/backward_references.c
@@ -97,6 +97,21 @@ static BROTLI_INLINE size_t ComputeDistanceCode(size_t distance,
#include "./backward_references_inc.h"
#undef HASHER
+#define HASHER() H35
+/* NOLINTNEXTLINE(build/include) */
+#include "./backward_references_inc.h"
+#undef HASHER
+
+#define HASHER() H55
+/* NOLINTNEXTLINE(build/include) */
+#include "./backward_references_inc.h"
+#undef HASHER
+
+#define HASHER() H65
+/* NOLINTNEXTLINE(build/include) */
+#include "./backward_references_inc.h"
+#undef HASHER
+
#undef PREFIX
#undef EXPORT_FN
diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/enc/brotli_bit_stream.h b/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/enc/brotli_bit_stream.h
index 9089b1dbafe..2ed703bf799 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/enc/brotli_bit_stream.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/enc/brotli_bit_stream.h
@@ -73,8 +73,9 @@ BROTLI_INTERNAL void BrotliStoreMetaBlockFast(MemoryManager* m,
REQUIRES: length > 0
REQUIRES: length <= (1 << 24) */
BROTLI_INTERNAL void BrotliStoreUncompressedMetaBlock(
- BROTLI_BOOL is_final_block, const uint8_t* input, size_t position,
- size_t mask, size_t len, size_t* storage_ix, uint8_t* storage);
+ BROTLI_BOOL is_final_block, const uint8_t* BROTLI_RESTRICT input,
+ size_t position, size_t mask, size_t len,
+ size_t* BROTLI_RESTRICT storage_ix, uint8_t* BROTLI_RESTRICT storage);
#if defined(__cplusplus) || defined(c_plusplus)
} /* extern "C" */
diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/enc/command.h b/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/enc/command.h
index 3fcf186b49f..1aac85689be 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/enc/command.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/enc/command.h
@@ -62,21 +62,21 @@ static BROTLI_INLINE uint16_t GetCopyLengthCode(size_t copylen) {
static BROTLI_INLINE uint16_t CombineLengthCodes(
uint16_t inscode, uint16_t copycode, BROTLI_BOOL use_last_distance) {
uint16_t bits64 =
- (uint16_t)((copycode & 0x7u) | ((inscode & 0x7u) << 3));
- if (use_last_distance && inscode < 8 && copycode < 16) {
- return (copycode < 8) ? bits64 : (bits64 | 64);
+ (uint16_t)((copycode & 0x7u) | ((inscode & 0x7u) << 3u));
+ if (use_last_distance && inscode < 8u && copycode < 16u) {
+ return (copycode < 8u) ? bits64 : (bits64 | 64u);
} else {
/* Specification: 5 Encoding of ... (last table) */
/* offset = 2 * index, where index is in range [0..8] */
- int offset = 2 * ((copycode >> 3) + 3 * (inscode >> 3));
+ uint32_t offset = 2u * ((copycode >> 3u) + 3u * (inscode >> 3u));
/* All values in specification are K * 64,
where K = [2, 3, 6, 4, 5, 8, 7, 9, 10],
i + 1 = [1, 2, 3, 4, 5, 6, 7, 8, 9],
K - i - 1 = [1, 1, 3, 0, 0, 2, 0, 1, 2] = D.
All values in D require only 2 bits to encode.
Magic constant is shifted 6 bits left, to avoid final multiplication. */
- offset = (offset << 5) + 0x40 + ((0x520D40 >> offset) & 0xC0);
- return (uint16_t)offset | bits64;
+ offset = (offset << 5u) + 0x40u + ((0x520D40u >> offset) & 0xC0u);
+ return (uint16_t)(offset | bits64);
}
}
diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/enc/compress_fragment.c b/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/enc/compress_fragment.c
index f75069bf3f5..9e50b2098a0 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/enc/compress_fragment.c
+++ b/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/enc/compress_fragment.c
@@ -202,7 +202,7 @@ static BROTLI_INLINE void EmitInsertLen(size_t insertlen,
} else {
BrotliWriteBits(depth[61], bits[61], storage_ix, storage);
BrotliWriteBits(12, insertlen - 2114, storage_ix, storage);
- ++histo[21];
+ ++histo[61];
}
}
@@ -215,11 +215,11 @@ static BROTLI_INLINE void EmitLongInsertLen(size_t insertlen,
if (insertlen < 22594) {
BrotliWriteBits(depth[62], bits[62], storage_ix, storage);
BrotliWriteBits(14, insertlen - 6210, storage_ix, storage);
- ++histo[22];
+ ++histo[62];
} else {
BrotliWriteBits(depth[63], bits[63], storage_ix, storage);
BrotliWriteBits(24, insertlen - 22594, storage_ix, storage);
- ++histo[23];
+ ++histo[63];
}
}
@@ -251,7 +251,7 @@ static BROTLI_INLINE void EmitCopyLen(size_t copylen,
} else {
BrotliWriteBits(depth[39], bits[39], storage_ix, storage);
BrotliWriteBits(24, copylen - 2118, storage_ix, storage);
- ++histo[47];
+ ++histo[39];
}
}
@@ -293,7 +293,7 @@ static BROTLI_INLINE void EmitCopyLenLastDistance(size_t copylen,
BrotliWriteBits(depth[39], bits[39], storage_ix, storage);
BrotliWriteBits(24, copylen - 2120, storage_ix, storage);
BrotliWriteBits(depth[64], bits[64], storage_ix, storage);
- ++histo[47];
+ ++histo[39];
++histo[64];
}
}
diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/enc/compress_fragment_two_pass.c b/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/enc/compress_fragment_two_pass.c
index b8bd6e838e9..f8a56063843 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/enc/compress_fragment_two_pass.c
+++ b/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/enc/compress_fragment_two_pass.c
@@ -39,26 +39,29 @@ extern "C" {
* The number has been tuned heuristically against compression benchmarks. */
static const uint32_t kHashMul32 = 0x1E35A7BD;
-static BROTLI_INLINE uint32_t Hash(const uint8_t* p, size_t shift) {
- const uint64_t h = (BROTLI_UNALIGNED_LOAD64LE(p) << 16) * kHashMul32;
+static BROTLI_INLINE uint32_t Hash(const uint8_t* p,
+ size_t shift, size_t length) {
+ const uint64_t h =
+ (BROTLI_UNALIGNED_LOAD64LE(p) << ((8 - length) * 8)) * kHashMul32;
return (uint32_t)(h >> shift);
}
-static BROTLI_INLINE uint32_t HashBytesAtOffset(
- uint64_t v, int offset, size_t shift) {
- BROTLI_DCHECK(offset >= 0);
- BROTLI_DCHECK(offset <= 2);
+static BROTLI_INLINE uint32_t HashBytesAtOffset(uint64_t v, size_t offset,
+ size_t shift, size_t length) {
+ BROTLI_DCHECK(offset <= 8 - length);
{
- const uint64_t h = ((v >> (8 * offset)) << 16) * kHashMul32;
+ const uint64_t h = ((v >> (8 * offset)) << ((8 - length) * 8)) * kHashMul32;
return (uint32_t)(h >> shift);
}
}
-static BROTLI_INLINE BROTLI_BOOL IsMatch(const uint8_t* p1, const uint8_t* p2) {
- return TO_BROTLI_BOOL(
- BrotliUnalignedRead32(p1) == BrotliUnalignedRead32(p2) &&
- p1[4] == p2[4] &&
- p1[5] == p2[5]);
+static BROTLI_INLINE BROTLI_BOOL IsMatch(const uint8_t* p1, const uint8_t* p2,
+ size_t length) {
+ if (BrotliUnalignedRead32(p1) == BrotliUnalignedRead32(p2)) {
+ if (length == 4) return BROTLI_TRUE;
+ return TO_BROTLI_BOOL(p1[4] == p2[4] && p1[5] == p2[5]);
+ }
+ return BROTLI_FALSE;
}
/* Builds a command and distance prefix code (each 64 symbols) into "depth" and
@@ -235,7 +238,8 @@ static void BrotliStoreMetaBlockHeader(
static BROTLI_INLINE void CreateCommands(const uint8_t* input,
size_t block_size, size_t input_size, const uint8_t* base_ip, int* table,
- size_t table_bits, uint8_t** literals, uint32_t** commands) {
+ size_t table_bits, size_t min_match,
+ uint8_t** literals, uint32_t** commands) {
/* "ip" is the input pointer. */
const uint8_t* ip = input;
const size_t shift = 64u - table_bits;
@@ -247,19 +251,18 @@ static BROTLI_INLINE void CreateCommands(const uint8_t* input,
int last_distance = -1;
const size_t kInputMarginBytes = BROTLI_WINDOW_GAP;
- const size_t kMinMatchLen = 6;
if (BROTLI_PREDICT_TRUE(block_size >= kInputMarginBytes)) {
/* For the last block, we need to keep a 16 bytes margin so that we can be
sure that all distances are at most window size - 16.
For all other blocks, we only need to keep a margin of 5 bytes so that
we don't go over the block size with a copy. */
- const size_t len_limit = BROTLI_MIN(size_t, block_size - kMinMatchLen,
+ const size_t len_limit = BROTLI_MIN(size_t, block_size - min_match,
input_size - kInputMarginBytes);
const uint8_t* ip_limit = input + len_limit;
uint32_t next_hash;
- for (next_hash = Hash(++ip, shift); ; ) {
+ for (next_hash = Hash(++ip, shift, min_match); ; ) {
/* Step 1: Scan forward in the input looking for a 6-byte-long match.
If we get close to exhausting the input then goto emit_remainder.
@@ -286,14 +289,14 @@ trawl:
uint32_t hash = next_hash;
uint32_t bytes_between_hash_lookups = skip++ >> 5;
ip = next_ip;
- BROTLI_DCHECK(hash == Hash(ip, shift));
+ BROTLI_DCHECK(hash == Hash(ip, shift, min_match));
next_ip = ip + bytes_between_hash_lookups;
if (BROTLI_PREDICT_FALSE(next_ip > ip_limit)) {
goto emit_remainder;
}
- next_hash = Hash(next_ip, shift);
+ next_hash = Hash(next_ip, shift, min_match);
candidate = ip - last_distance;
- if (IsMatch(ip, candidate)) {
+ if (IsMatch(ip, candidate, min_match)) {
if (BROTLI_PREDICT_TRUE(candidate < ip)) {
table[hash] = (int)(ip - base_ip);
break;
@@ -304,7 +307,7 @@ trawl:
BROTLI_DCHECK(candidate < ip);
table[hash] = (int)(ip - base_ip);
- } while (BROTLI_PREDICT_TRUE(!IsMatch(ip, candidate)));
+ } while (BROTLI_PREDICT_TRUE(!IsMatch(ip, candidate, min_match)));
/* Check copy distance. If candidate is not feasible, continue search.
Checking is done outside of hot loop to reduce overhead. */
@@ -319,8 +322,9 @@ trawl:
/* We have a 6-byte match at ip, and we need to emit bytes in
[next_emit, ip). */
const uint8_t* base = ip;
- size_t matched = 6 + FindMatchLengthWithLimit(
- candidate + 6, ip + 6, (size_t)(ip_end - ip) - 6);
+ size_t matched = min_match + FindMatchLengthWithLimit(
+ candidate + min_match, ip + min_match,
+ (size_t)(ip_end - ip) - min_match);
int distance = (int)(base - candidate); /* > 0 */
int insert = (int)(base - next_emit);
ip += matched;
@@ -345,32 +349,47 @@ trawl:
/* We could immediately start working at ip now, but to improve
compression we first update "table" with the hashes of some
positions within the last copy. */
- uint64_t input_bytes = BROTLI_UNALIGNED_LOAD64LE(ip - 5);
- uint32_t prev_hash = HashBytesAtOffset(input_bytes, 0, shift);
+ uint64_t input_bytes;
uint32_t cur_hash;
- table[prev_hash] = (int)(ip - base_ip - 5);
- prev_hash = HashBytesAtOffset(input_bytes, 1, shift);
- table[prev_hash] = (int)(ip - base_ip - 4);
- prev_hash = HashBytesAtOffset(input_bytes, 2, shift);
- table[prev_hash] = (int)(ip - base_ip - 3);
- input_bytes = BROTLI_UNALIGNED_LOAD64LE(ip - 2);
- cur_hash = HashBytesAtOffset(input_bytes, 2, shift);
- prev_hash = HashBytesAtOffset(input_bytes, 0, shift);
- table[prev_hash] = (int)(ip - base_ip - 2);
- prev_hash = HashBytesAtOffset(input_bytes, 1, shift);
- table[prev_hash] = (int)(ip - base_ip - 1);
+ uint32_t prev_hash;
+ if (min_match == 4) {
+ input_bytes = BROTLI_UNALIGNED_LOAD64LE(ip - 3);
+ cur_hash = HashBytesAtOffset(input_bytes, 3, shift, min_match);
+ prev_hash = HashBytesAtOffset(input_bytes, 0, shift, min_match);
+ table[prev_hash] = (int)(ip - base_ip - 3);
+ prev_hash = HashBytesAtOffset(input_bytes, 1, shift, min_match);
+ table[prev_hash] = (int)(ip - base_ip - 2);
+ prev_hash = HashBytesAtOffset(input_bytes, 0, shift, min_match);
+ table[prev_hash] = (int)(ip - base_ip - 1);
+ } else {
+ input_bytes = BROTLI_UNALIGNED_LOAD64LE(ip - 5);
+ prev_hash = HashBytesAtOffset(input_bytes, 0, shift, min_match);
+ table[prev_hash] = (int)(ip - base_ip - 5);
+ prev_hash = HashBytesAtOffset(input_bytes, 1, shift, min_match);
+ table[prev_hash] = (int)(ip - base_ip - 4);
+ prev_hash = HashBytesAtOffset(input_bytes, 2, shift, min_match);
+ table[prev_hash] = (int)(ip - base_ip - 3);
+ input_bytes = BROTLI_UNALIGNED_LOAD64LE(ip - 2);
+ cur_hash = HashBytesAtOffset(input_bytes, 2, shift, min_match);
+ prev_hash = HashBytesAtOffset(input_bytes, 0, shift, min_match);
+ table[prev_hash] = (int)(ip - base_ip - 2);
+ prev_hash = HashBytesAtOffset(input_bytes, 1, shift, min_match);
+ table[prev_hash] = (int)(ip - base_ip - 1);
+ }
candidate = base_ip + table[cur_hash];
table[cur_hash] = (int)(ip - base_ip);
}
}
- while (ip - candidate <= MAX_DISTANCE && IsMatch(ip, candidate)) {
+ while (ip - candidate <= MAX_DISTANCE &&
+ IsMatch(ip, candidate, min_match)) {
/* We have a 6-byte match at ip, and no need to emit any
literal bytes prior to ip. */
const uint8_t* base = ip;
- size_t matched = 6 + FindMatchLengthWithLimit(
- candidate + 6, ip + 6, (size_t)(ip_end - ip) - 6);
+ size_t matched = min_match + FindMatchLengthWithLimit(
+ candidate + min_match, ip + min_match,
+ (size_t)(ip_end - ip) - min_match);
ip += matched;
last_distance = (int)(base - candidate); /* > 0 */
BROTLI_DCHECK(0 == memcmp(base, candidate, matched));
@@ -385,27 +404,40 @@ trawl:
/* We could immediately start working at ip now, but to improve
compression we first update "table" with the hashes of some
positions within the last copy. */
- uint64_t input_bytes = BROTLI_UNALIGNED_LOAD64LE(ip - 5);
- uint32_t prev_hash = HashBytesAtOffset(input_bytes, 0, shift);
+ uint64_t input_bytes;
uint32_t cur_hash;
- table[prev_hash] = (int)(ip - base_ip - 5);
- prev_hash = HashBytesAtOffset(input_bytes, 1, shift);
- table[prev_hash] = (int)(ip - base_ip - 4);
- prev_hash = HashBytesAtOffset(input_bytes, 2, shift);
- table[prev_hash] = (int)(ip - base_ip - 3);
- input_bytes = BROTLI_UNALIGNED_LOAD64LE(ip - 2);
- cur_hash = HashBytesAtOffset(input_bytes, 2, shift);
- prev_hash = HashBytesAtOffset(input_bytes, 0, shift);
- table[prev_hash] = (int)(ip - base_ip - 2);
- prev_hash = HashBytesAtOffset(input_bytes, 1, shift);
- table[prev_hash] = (int)(ip - base_ip - 1);
+ uint32_t prev_hash;
+ if (min_match == 4) {
+ input_bytes = BROTLI_UNALIGNED_LOAD64LE(ip - 3);
+ cur_hash = HashBytesAtOffset(input_bytes, 3, shift, min_match);
+ prev_hash = HashBytesAtOffset(input_bytes, 0, shift, min_match);
+ table[prev_hash] = (int)(ip - base_ip - 3);
+ prev_hash = HashBytesAtOffset(input_bytes, 1, shift, min_match);
+ table[prev_hash] = (int)(ip - base_ip - 2);
+ prev_hash = HashBytesAtOffset(input_bytes, 2, shift, min_match);
+ table[prev_hash] = (int)(ip - base_ip - 1);
+ } else {
+ input_bytes = BROTLI_UNALIGNED_LOAD64LE(ip - 5);
+ prev_hash = HashBytesAtOffset(input_bytes, 0, shift, min_match);
+ table[prev_hash] = (int)(ip - base_ip - 5);
+ prev_hash = HashBytesAtOffset(input_bytes, 1, shift, min_match);
+ table[prev_hash] = (int)(ip - base_ip - 4);
+ prev_hash = HashBytesAtOffset(input_bytes, 2, shift, min_match);
+ table[prev_hash] = (int)(ip - base_ip - 3);
+ input_bytes = BROTLI_UNALIGNED_LOAD64LE(ip - 2);
+ cur_hash = HashBytesAtOffset(input_bytes, 2, shift, min_match);
+ prev_hash = HashBytesAtOffset(input_bytes, 0, shift, min_match);
+ table[prev_hash] = (int)(ip - base_ip - 2);
+ prev_hash = HashBytesAtOffset(input_bytes, 1, shift, min_match);
+ table[prev_hash] = (int)(ip - base_ip - 1);
+ }
candidate = base_ip + table[cur_hash];
table[cur_hash] = (int)(ip - base_ip);
}
}
- next_hash = Hash(++ip, shift);
+ next_hash = Hash(++ip, shift, min_match);
}
}
@@ -525,7 +557,8 @@ static void EmitUncompressedMetaBlock(const uint8_t* input, size_t input_size,
static BROTLI_INLINE void BrotliCompressFragmentTwoPassImpl(
MemoryManager* m, const uint8_t* input, size_t input_size,
BROTLI_BOOL is_last, uint32_t* command_buf, uint8_t* literal_buf,
- int* table, size_t table_bits, size_t* storage_ix, uint8_t* storage) {
+ int* table, size_t table_bits, size_t min_match,
+ size_t* storage_ix, uint8_t* storage) {
/* Save the start of the first block for position and distance computations.
*/
const uint8_t* base_ip = input;
@@ -537,8 +570,8 @@ static BROTLI_INLINE void BrotliCompressFragmentTwoPassImpl(
uint32_t* commands = command_buf;
uint8_t* literals = literal_buf;
size_t num_literals;
- CreateCommands(input, block_size, input_size, base_ip, table, table_bits,
- &literals, &commands);
+ CreateCommands(input, block_size, input_size, base_ip, table,
+ table_bits, min_match, &literals, &commands);
num_literals = (size_t)(literals - literal_buf);
if (ShouldCompress(input, block_size, num_literals)) {
const size_t num_commands = (size_t)(commands - command_buf);
@@ -567,8 +600,9 @@ static BROTLI_NOINLINE void BrotliCompressFragmentTwoPassImpl ## B( \
MemoryManager* m, const uint8_t* input, size_t input_size, \
BROTLI_BOOL is_last, uint32_t* command_buf, uint8_t* literal_buf, \
int* table, size_t* storage_ix, uint8_t* storage) { \
+ size_t min_match = (B <= 15) ? 4 : 6; \
BrotliCompressFragmentTwoPassImpl(m, input, input_size, is_last, command_buf,\
- literal_buf, table, B, storage_ix, storage); \
+ literal_buf, table, B, min_match, storage_ix, storage); \
}
FOR_TABLE_BITS_(BAKE_METHOD_PARAM_)
#undef BAKE_METHOD_PARAM_
diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/enc/encode.c b/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/enc/encode.c
index 4bf0cb4d98a..ec56da24632 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/enc/encode.c
+++ b/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/enc/encode.c
@@ -117,7 +117,6 @@ typedef struct BrotliEncoderStateStruct {
static BROTLI_BOOL EnsureInitialized(BrotliEncoderState* s);
static size_t InputBlockSize(BrotliEncoderState* s) {
- if (!EnsureInitialized(s)) return 0;
return (size_t)1 << s->params.lgblock;
}
@@ -817,7 +816,6 @@ static void CopyInputToRingBuffer(BrotliEncoderState* s,
const uint8_t* input_buffer) {
RingBuffer* ringbuffer_ = &s->ringbuffer_;
MemoryManager* m = &s->memory_manager_;
- if (!EnsureInitialized(s)) return;
RingBufferWrite(m, input_buffer, input_size, ringbuffer_);
if (BROTLI_IS_OOM(m)) return;
s->input_pos_ += input_size;
@@ -882,7 +880,8 @@ static void ExtendLastCommand(BrotliEncoderState* s, uint32_t* bytes,
Command* last_command = &s->commands_[s->num_commands_ - 1];
const uint8_t* data = s->ringbuffer_.buffer_;
const uint32_t mask = s->ringbuffer_.mask_;
- uint64_t max_backward_distance = (1u << s->params.lgwin) - BROTLI_WINDOW_GAP;
+ uint64_t max_backward_distance =
+ (((uint64_t)1) << s->params.lgwin) - BROTLI_WINDOW_GAP;
uint64_t last_copy_len = last_command->copy_len_ & 0x1FFFFFF;
uint64_t last_processed_pos = s->last_processed_pos_ - last_copy_len;
uint64_t max_distance = last_processed_pos < max_backward_distance ?
@@ -932,7 +931,6 @@ static BROTLI_BOOL EncodeData(
MemoryManager* m = &s->memory_manager_;
ContextType literal_context_mode;
- if (!EnsureInitialized(s)) return BROTLI_FALSE;
data = s->ringbuffer_.buffer_;
mask = s->ringbuffer_.mask_;
diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/enc/encoder_dict.h b/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/enc/encoder_dict.h
index 9ac8b4a38e4..3cb6b0ac152 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/enc/encoder_dict.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/enc/encoder_dict.h
@@ -34,7 +34,6 @@ typedef struct BrotliEncoderDictionary {
BROTLI_INTERNAL void BrotliInitEncoderDictionary(BrotliEncoderDictionary* dict);
-
#if defined(__cplusplus) || defined(c_plusplus)
} /* extern "C" */
#endif
diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/enc/fast_log.h b/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/enc/fast_log.h
index d45a5280c87..cade1235ade 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/enc/fast_log.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/enc/fast_log.h
@@ -19,7 +19,9 @@ extern "C" {
#endif
static BROTLI_INLINE uint32_t Log2FloorNonZero(size_t n) {
-#if BROTLI_MODERN_COMPILER || __has_builtin(__builtin_clz)
+ /* TODO: generalize and move to platform.h */
+#if BROTLI_GNUC_HAS_BUILTIN(__builtin_clz, 3, 4, 0) || \
+ BROTLI_INTEL_VERSION_CHECK(16, 0, 0)
return 31u ^ (uint32_t)__builtin_clz((uint32_t)n);
#else
uint32_t result = 0;
diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/enc/hash.h b/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/enc/hash.h
index 1827ce6019a..26024900c37 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/enc/hash.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/enc/hash.h
@@ -36,8 +36,10 @@ extern "C" {
* * HasherCommon structure
* * private structured hasher data, depending on hasher type
* * private dynamic hasher data, depending on hasher type and parameters
- */
-typedef uint8_t* HasherHandle;
+ *
+ * Using "define" instead of "typedef", because on MSVC __restrict does not work
+ * on typedef pointer types. */
+#define HasherHandle uint8_t*
typedef struct {
BrotliHasherParams params;
@@ -151,14 +153,14 @@ static BROTLI_INLINE BROTLI_BOOL TestStaticDictionaryItem(
size_t max_length, size_t max_backward, size_t max_distance,
HasherSearchResult* out) {
size_t len;
- size_t dist;
+ size_t word_idx;
size_t offset;
size_t matchlen;
size_t backward;
score_t score;
len = item & 0x1F;
- dist = item >> 5;
- offset = dictionary->words->offsets_by_length[len] + len * dist;
+ word_idx = item >> 5;
+ offset = dictionary->words->offsets_by_length[len] + len * word_idx;
if (len > max_length) {
return BROTLI_FALSE;
}
@@ -172,7 +174,7 @@ static BROTLI_INLINE BROTLI_BOOL TestStaticDictionaryItem(
size_t cut = len - matchlen;
size_t transform_id = (cut << 2) +
(size_t)((dictionary->cutoffTransforms >> (cut * 6)) & 0x3F);
- backward = max_backward + dist + 1 +
+ backward = max_backward + 1 + word_idx +
(transform_id << dictionary->words->size_bits_by_length[len]);
}
if (backward > max_distance) {
@@ -341,11 +343,57 @@ static BROTLI_INLINE size_t BackwardMatchLengthCode(const BackwardMatch* self) {
#undef BUCKET_BITS
#undef HASHER
+/* fast large window hashers */
+
+#define HASHER() HROLLING_FAST
+#define CHUNKLEN 32
+#define JUMP 4
+#define NUMBUCKETS 16777216
+#define MASK ((NUMBUCKETS * 64) - 1)
+#include "./hash_rolling_inc.h" /* NOLINT(build/include) */
+#undef JUMP
+#undef HASHER
+
+
+#define HASHER() HROLLING
+#define JUMP 1
+#include "./hash_rolling_inc.h" /* NOLINT(build/include) */
+#undef MASK
+#undef NUMBUCKETS
+#undef JUMP
+#undef CHUNKLEN
+#undef HASHER
+
+#define HASHER() H35
+#define HASHER_A H3
+#define HASHER_B HROLLING_FAST
+#include "./hash_composite_inc.h" /* NOLINT(build/include) */
+#undef HASHER_A
+#undef HASHER_B
+#undef HASHER
+
+#define HASHER() H55
+#define HASHER_A H54
+#define HASHER_B HROLLING_FAST
+#include "./hash_composite_inc.h" /* NOLINT(build/include) */
+#undef HASHER_A
+#undef HASHER_B
+#undef HASHER
+
+#define HASHER() H65
+#define HASHER_A H6
+#define HASHER_B HROLLING
+#include "./hash_composite_inc.h" /* NOLINT(build/include) */
+#undef HASHER_A
+#undef HASHER_B
+#undef HASHER
+
#undef FN
#undef CAT
#undef EXPAND_CAT
-#define FOR_GENERIC_HASHERS(H) H(2) H(3) H(4) H(5) H(6) H(40) H(41) H(42) H(54)
+#define FOR_GENERIC_HASHERS(H) H(2) H(3) H(4) H(5) H(6) H(40) H(41) H(42) H(54)\
+ H(35) H(55) H(65)
#define FOR_ALL_HASHERS(H) FOR_GENERIC_HASHERS(H) H(10)
static BROTLI_INLINE void DestroyHasher(
diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/enc/hash_composite_inc.h b/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/enc/hash_composite_inc.h
new file mode 100644
index 00000000000..f829a97e58b
--- /dev/null
+++ b/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/enc/hash_composite_inc.h
@@ -0,0 +1,133 @@
+/* NOLINT(build/header_guard) */
+/* Copyright 2018 Google Inc. All Rights Reserved.
+
+ Distributed under MIT license.
+ See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
+*/
+
+/* template parameters: FN, HASHER_A, HASHER_B */
+
+/* Composite hasher: This hasher allows to combine two other hashers, HASHER_A
+ and HASHER_B. */
+
+#define HashComposite HASHER()
+
+#define FN_A(X) EXPAND_CAT(X, HASHER_A)
+#define FN_B(X) EXPAND_CAT(X, HASHER_B)
+
+static BROTLI_INLINE size_t FN(HashTypeLength)(void) {
+ size_t a = FN_A(HashTypeLength)();
+ size_t b = FN_B(HashTypeLength)();
+ return a > b ? a : b;
+}
+
+static BROTLI_INLINE size_t FN(StoreLookahead)(void) {
+ size_t a = FN_A(StoreLookahead)();
+ size_t b = FN_B(StoreLookahead)();
+ return a > b ? a : b;
+}
+
+typedef struct HashComposite {
+ HasherHandle ha;
+ HasherHandle hb;
+ const BrotliEncoderParams* params;
+} HashComposite;
+
+static BROTLI_INLINE HashComposite* FN(Self)(HasherHandle handle) {
+ return (HashComposite*)&(GetHasherCommon(handle)[1]);
+}
+
+static void FN(Initialize)(
+ HasherHandle handle, const BrotliEncoderParams* params) {
+ HashComposite* self = FN(Self)(handle);
+ self->ha = 0;
+ self->hb = 0;
+ self->params = params;
+ /* TODO: Initialize of the hashers is defered to Prepare (and params
+ remembered here) because we don't get the one_shot and input_size params
+ here that are needed to know the memory size of them. Instead provide
+ those params to all hashers FN(Initialize) */
+}
+
+static void FN(Prepare)(HasherHandle handle, BROTLI_BOOL one_shot,
+ size_t input_size, const uint8_t* data) {
+ HashComposite* self = FN(Self)(handle);
+ if (!self->ha) {
+ HasherCommon* common_a;
+ HasherCommon* common_b;
+
+ self->ha = handle + sizeof(HasherCommon) + sizeof(HashComposite);
+ common_a = (HasherCommon*)self->ha;
+ common_a->params = self->params->hasher;
+ common_a->is_prepared_ = BROTLI_FALSE;
+ common_a->dict_num_lookups = 0;
+ common_a->dict_num_matches = 0;
+ FN_A(Initialize)(self->ha, self->params);
+
+ self->hb = self->ha + sizeof(HasherCommon) + FN_A(HashMemAllocInBytes)(
+ self->params, one_shot, input_size);
+ common_b = (HasherCommon*)self->hb;
+ common_b->params = self->params->hasher;
+ common_b->is_prepared_ = BROTLI_FALSE;
+ common_b->dict_num_lookups = 0;
+ common_b->dict_num_matches = 0;
+ FN_B(Initialize)(self->hb, self->params);
+ }
+ FN_A(Prepare)(self->ha, one_shot, input_size, data);
+ FN_B(Prepare)(self->hb, one_shot, input_size, data);
+}
+
+static BROTLI_INLINE size_t FN(HashMemAllocInBytes)(
+ const BrotliEncoderParams* params, BROTLI_BOOL one_shot,
+ size_t input_size) {
+ return sizeof(HashComposite) + 2 * sizeof(HasherCommon) +
+ FN_A(HashMemAllocInBytes)(params, one_shot, input_size) +
+ FN_B(HashMemAllocInBytes)(params, one_shot, input_size);
+}
+
+static BROTLI_INLINE void FN(Store)(HasherHandle BROTLI_RESTRICT handle,
+ const uint8_t* BROTLI_RESTRICT data, const size_t mask, const size_t ix) {
+ HashComposite* self = FN(Self)(handle);
+ FN_A(Store)(self->ha, data, mask, ix);
+ FN_B(Store)(self->hb, data, mask, ix);
+}
+
+static BROTLI_INLINE void FN(StoreRange)(HasherHandle handle,
+ const uint8_t* data, const size_t mask, const size_t ix_start,
+ const size_t ix_end) {
+ HashComposite* self = FN(Self)(handle);
+ FN_A(StoreRange)(self->ha, data, mask, ix_start, ix_end);
+ FN_B(StoreRange)(self->hb, data, mask, ix_start, ix_end);
+}
+
+static BROTLI_INLINE void FN(StitchToPreviousBlock)(HasherHandle handle,
+ size_t num_bytes, size_t position, const uint8_t* ringbuffer,
+ size_t ring_buffer_mask) {
+ HashComposite* self = FN(Self)(handle);
+ FN_A(StitchToPreviousBlock)(self->ha, num_bytes, position, ringbuffer,
+ ring_buffer_mask);
+ FN_B(StitchToPreviousBlock)(self->hb, num_bytes, position, ringbuffer,
+ ring_buffer_mask);
+}
+
+static BROTLI_INLINE void FN(PrepareDistanceCache)(
+ HasherHandle handle, int* BROTLI_RESTRICT distance_cache) {
+ HashComposite* self = FN(Self)(handle);
+ FN_A(PrepareDistanceCache)(self->ha, distance_cache);
+ FN_B(PrepareDistanceCache)(self->hb, distance_cache);
+}
+
+static BROTLI_INLINE void FN(FindLongestMatch)(HasherHandle handle,
+ const BrotliEncoderDictionary* dictionary,
+ const uint8_t* BROTLI_RESTRICT data, const size_t ring_buffer_mask,
+ const int* BROTLI_RESTRICT distance_cache, const size_t cur_ix,
+ const size_t max_length, const size_t max_backward, const size_t gap,
+ const size_t max_distance, HasherSearchResult* BROTLI_RESTRICT out) {
+ HashComposite* self = FN(Self)(handle);
+ FN_A(FindLongestMatch)(self->ha, dictionary, data, ring_buffer_mask,
+ distance_cache, cur_ix, max_length, max_backward, gap, max_distance, out);
+ FN_B(FindLongestMatch)(self->hb, dictionary, data, ring_buffer_mask,
+ distance_cache, cur_ix, max_length, max_backward, gap, max_distance, out);
+}
+
+#undef HashComposite
diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/enc/hash_rolling_inc.h b/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/enc/hash_rolling_inc.h
new file mode 100644
index 00000000000..4d5d14a0cd8
--- /dev/null
+++ b/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/enc/hash_rolling_inc.h
@@ -0,0 +1,215 @@
+/* NOLINT(build/header_guard) */
+/* Copyright 2018 Google Inc. All Rights Reserved.
+
+ Distributed under MIT license.
+ See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
+*/
+
+/* template parameters: FN, JUMP, NUMBUCKETS, MASK, CHUNKLEN */
+/* NUMBUCKETS / (MASK + 1) = probability of storing and using hash code. */
+/* JUMP = skip bytes for speedup */
+
+/* Rolling hash for long distance long string matches. Stores one position
+ per bucket, bucket key is computed over a long region. */
+
+#define HashRolling HASHER()
+
+static const uint32_t FN(kRollingHashMul32) = 69069;
+static const uint32_t FN(kInvalidPos) = 0xffffffff;
+
+/* This hasher uses a longer forward length, but returning a higher value here
+ will hurt compression by the main hasher when combined with a composite
+ hasher. The hasher tests for forward itself instead. */
+static BROTLI_INLINE size_t FN(HashTypeLength)(void) { return 4; }
+static BROTLI_INLINE size_t FN(StoreLookahead)(void) { return 4; }
+
+/* Computes a code from a single byte. A lookup table of 256 values could be
+ used, but simply adding 1 works about as good. */
+static uint32_t FN(HashByte)(uint8_t byte) {
+ return (uint32_t)byte + 1u;
+}
+
+static uint32_t FN(HashRollingFunctionInitial)(uint32_t state, uint8_t add,
+ uint32_t factor) {
+ return (uint32_t)(factor * state + FN(HashByte)(add));
+}
+
+static uint32_t FN(HashRollingFunction)(uint32_t state, uint8_t add,
+ uint8_t rem, uint32_t factor,
+ uint32_t factor_remove) {
+ return (uint32_t)(factor * state +
+ FN(HashByte)(add) - factor_remove * FN(HashByte)(rem));
+}
+
+typedef struct HashRolling {
+ uint32_t state;
+ uint32_t* table;
+ size_t next_ix;
+
+ uint32_t chunk_len;
+ uint32_t factor;
+ uint32_t factor_remove;
+} HashRolling;
+
+static BROTLI_INLINE HashRolling* FN(Self)(HasherHandle handle) {
+ return (HashRolling*)&(GetHasherCommon(handle)[1]);
+}
+
+static void FN(Initialize)(
+ HasherHandle handle, const BrotliEncoderParams* params) {
+ HashRolling* self = FN(Self)(handle);
+ size_t i;
+ self->state = 0;
+ self->next_ix = 0;
+
+ self->factor = FN(kRollingHashMul32);
+
+ /* Compute the factor of the oldest byte to remove: factor**steps modulo
+ 0xffffffff (the multiplications rely on 32-bit overflow) */
+ self->factor_remove = 1;
+ for (i = 0; i < CHUNKLEN; i += JUMP) {
+ self->factor_remove *= self->factor;
+ }
+
+ self->table = (uint32_t*)((HasherHandle)self + sizeof(HashRolling));
+ for (i = 0; i < NUMBUCKETS; i++) {
+ self->table[i] = FN(kInvalidPos);
+ }
+
+ BROTLI_UNUSED(params);
+}
+
+static void FN(Prepare)(HasherHandle handle, BROTLI_BOOL one_shot,
+ size_t input_size, const uint8_t* data) {
+ HashRolling* self = FN(Self)(handle);
+ size_t i;
+ /* Too small size, cannot use this hasher. */
+ if (input_size < CHUNKLEN) return;
+ self->state = 0;
+ for (i = 0; i < CHUNKLEN; i += JUMP) {
+ self->state = FN(HashRollingFunctionInitial)(
+ self->state, data[i], self->factor);
+ }
+ BROTLI_UNUSED(one_shot);
+}
+
+static BROTLI_INLINE size_t FN(HashMemAllocInBytes)(
+ const BrotliEncoderParams* params, BROTLI_BOOL one_shot,
+ size_t input_size) {
+ return sizeof(HashRolling) + NUMBUCKETS * sizeof(uint32_t);
+ BROTLI_UNUSED(params);
+ BROTLI_UNUSED(one_shot);
+ BROTLI_UNUSED(input_size);
+}
+
+static BROTLI_INLINE void FN(Store)(HasherHandle BROTLI_RESTRICT handle,
+ const uint8_t* BROTLI_RESTRICT data, const size_t mask, const size_t ix) {
+ BROTLI_UNUSED(handle);
+ BROTLI_UNUSED(data);
+ BROTLI_UNUSED(mask);
+ BROTLI_UNUSED(ix);
+}
+
+static BROTLI_INLINE void FN(StoreRange)(HasherHandle handle,
+ const uint8_t* data, const size_t mask, const size_t ix_start,
+ const size_t ix_end) {
+ BROTLI_UNUSED(handle);
+ BROTLI_UNUSED(data);
+ BROTLI_UNUSED(mask);
+ BROTLI_UNUSED(ix_start);
+ BROTLI_UNUSED(ix_end);
+}
+
+static BROTLI_INLINE void FN(StitchToPreviousBlock)(HasherHandle handle,
+ size_t num_bytes, size_t position, const uint8_t* ringbuffer,
+ size_t ring_buffer_mask) {
+ /* In this case we must re-initialize the hasher from scratch from the
+ current position. */
+ HashRolling* self = FN(Self)(handle);
+ size_t position_masked;
+ size_t available = num_bytes;
+ if ((position & (JUMP - 1)) != 0) {
+ size_t diff = JUMP - (position & (JUMP - 1));
+ available = (diff > available) ? 0 : (available - diff);
+ position += diff;
+ }
+ position_masked = position & ring_buffer_mask;
+ /* wrapping around ringbuffer not handled. */
+ if (available > ring_buffer_mask - position_masked) {
+ available = ring_buffer_mask - position_masked;
+ }
+
+ FN(Prepare)(handle, BROTLI_FALSE, available,
+ ringbuffer + (position & ring_buffer_mask));
+ self->next_ix = position;
+ BROTLI_UNUSED(num_bytes);
+}
+
+static BROTLI_INLINE void FN(PrepareDistanceCache)(
+ HasherHandle handle, int* BROTLI_RESTRICT distance_cache) {
+ BROTLI_UNUSED(handle);
+ BROTLI_UNUSED(distance_cache);
+}
+
+static BROTLI_INLINE void FN(FindLongestMatch)(HasherHandle handle,
+ const BrotliEncoderDictionary* dictionary,
+ const uint8_t* BROTLI_RESTRICT data, const size_t ring_buffer_mask,
+ const int* BROTLI_RESTRICT distance_cache, const size_t cur_ix,
+ const size_t max_length, const size_t max_backward, const size_t gap,
+ const size_t max_distance, HasherSearchResult* BROTLI_RESTRICT out) {
+ HashRolling* self = FN(Self)(handle);
+ const size_t cur_ix_masked = cur_ix & ring_buffer_mask;
+ size_t pos = self->next_ix;
+
+ if ((cur_ix & (JUMP - 1)) != 0) return;
+
+ /* Not enough lookahead */
+ if (max_length < CHUNKLEN) return;
+
+ for (pos = self->next_ix; pos <= cur_ix; pos += JUMP) {
+ uint32_t code = self->state & MASK;
+
+ uint8_t rem = data[pos & ring_buffer_mask];
+ uint8_t add = data[(pos + CHUNKLEN) & ring_buffer_mask];
+ size_t found_ix = FN(kInvalidPos);
+
+ self->state = FN(HashRollingFunction)(
+ self->state, add, rem, self->factor, self->factor_remove);
+
+ if (code < NUMBUCKETS) {
+ found_ix = self->table[code];
+ self->table[code] = (uint32_t)pos;
+ if (pos == cur_ix && found_ix != FN(kInvalidPos)) {
+ /* The cast to 32-bit makes backward distances up to 4GB work even
+ if cur_ix is above 4GB, despite using 32-bit values in the table. */
+ size_t backward = (uint32_t)(cur_ix - found_ix);
+ if (backward <= max_backward) {
+ const size_t found_ix_masked = found_ix & ring_buffer_mask;
+ const size_t len = FindMatchLengthWithLimit(&data[found_ix_masked],
+ &data[cur_ix_masked],
+ max_length);
+ if (len >= 4 && len > out->len) {
+ score_t score = BackwardReferenceScore(len, backward);
+ if (score > out->score) {
+ out->len = len;
+ out->distance = backward;
+ out->score = score;
+ out->len_code_delta = 0;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ self->next_ix = cur_ix + JUMP;
+
+ /* NOTE: this hasher does not search in the dictionary. It is used as
+ backup-hasher, the main hasher already searches in it. */
+ BROTLI_UNUSED(dictionary);
+ BROTLI_UNUSED(distance_cache);
+ BROTLI_UNUSED(gap);
+ BROTLI_UNUSED(max_distance);
+}
+
+#undef HashRolling
diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/enc/quality.h b/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/enc/quality.h
index aa7ba0d82c8..5f4d0345037 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/enc/quality.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/enc/quality.h
@@ -142,6 +142,24 @@ static BROTLI_INLINE void ChooseHasher(const BrotliEncoderParams* params,
hparams->num_last_distances_to_check =
params->quality < 7 ? 4 : params->quality < 9 ? 10 : 16;
}
+
+ if (params->lgwin > 24) {
+ /* Different hashers for large window brotli: not for qualities <= 2,
+ these are too fast for large window. Not for qualities >= 10: their
+ hasher already works well with large window. So the changes are:
+ H3 --> H35: for quality 3.
+ H54 --> H55: for quality 4 with size hint > 1MB
+ H6 --> H65: for qualities 5, 6, 7, 8, 9. */
+ if (hparams->type == 3) {
+ hparams->type = 35;
+ }
+ if (hparams->type == 54) {
+ hparams->type = 55;
+ }
+ if (hparams->type == 6) {
+ hparams->type = 65;
+ }
+ }
}
#endif /* BROTLI_ENC_QUALITY_H_ */
diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/enc/static_dict.c b/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/enc/static_dict.c
index 758ef80edde..7299ab7203b 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/enc/static_dict.c
+++ b/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/enc/static_dict.c
@@ -16,11 +16,6 @@
extern "C" {
#endif
-/* TODO: use BrotliTransforms.cutOffTransforms instead. */
-static const uint8_t kOmitLastNTransforms[10] = {
- 0, 12, 27, 23, 42, 63, 56, 48, 59, 64,
-};
-
static BROTLI_INLINE uint32_t Hash(const uint8_t* data) {
uint32_t h = BROTLI_UNALIGNED_LOAD32LE(data) * kDictHashMul32;
/* The higher bits contain more mixture from the multiplication,
@@ -121,7 +116,10 @@ BROTLI_BOOL BrotliFindAllStaticDictionaryMatches(
if (l > 9) minlen = BROTLI_MAX(size_t, minlen, l - 9);
maxlen = BROTLI_MIN(size_t, matchlen, l - 2);
for (len = minlen; len <= maxlen; ++len) {
- AddMatch(id + kOmitLastNTransforms[l - len] * n, len, l, matches);
+ size_t cut = l - len;
+ size_t transform_id = (cut << 2) +
+ (size_t)((dictionary->cutoffTransforms >> (cut * 6)) & 0x3F);
+ AddMatch(id + transform_id * n, len, l, matches);
has_found_match = BROTLI_TRUE;
}
if (matchlen < l || l + 6 >= max_length) {
diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/enc/write_bits.h b/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/enc/write_bits.h
index ddfebeb7eb8..36515a6893f 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/enc/write_bits.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/enc/write_bits.h
@@ -37,7 +37,7 @@ static BROTLI_INLINE void BrotliWriteBits(size_t n_bits,
uint64_t bits,
size_t* BROTLI_RESTRICT pos,
uint8_t* BROTLI_RESTRICT array) {
-#ifdef BROTLI_LITTLE_ENDIAN
+#if defined(BROTLI_LITTLE_ENDIAN)
/* This branch of the code can write up to 56 bits at a time,
7 bits are lost by being perhaps already in *p and at least
1 bit is needed to initialize the bit-stream ahead (i.e. if 7
diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/include/brotli/port.h b/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/include/brotli/port.h
index 88cdbf459f4..20dc2314d80 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/include/brotli/port.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/include/brotli/port.h
@@ -4,50 +4,247 @@
See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
*/
-/* Macros for compiler / platform specific features and build options.
-
- Build options are:
- * BROTLI_BUILD_MODERN_COMPILER forces to use modern compilers built-ins,
- features and attributes
- */
+/* Macros for compiler / platform specific API declarations. */
#ifndef BROTLI_COMMON_PORT_H_
#define BROTLI_COMMON_PORT_H_
-/* Compatibility with non-clang compilers. */
-#ifndef __has_builtin
-#define __has_builtin(x) 0
+/* The following macros were borrowed from https://github.com/nemequ/hedley
+ * with permission of original author - Evan Nemerson <evan@nemerson.com> */
+
+/* >>> >>> >>> hedley macros */
+
+#define BROTLI_MAKE_VERSION(major, minor, revision) \
+ (((major) * 1000000) + ((minor) * 1000) + (revision))
+
+#if defined(__GNUC__) && defined(__GNUC_PATCHLEVEL__)
+#define BROTLI_GNUC_VERSION \
+ BROTLI_MAKE_VERSION(__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__)
+#elif defined(__GNUC__)
+#define BROTLI_GNUC_VERSION BROTLI_MAKE_VERSION(__GNUC__, __GNUC_MINOR__, 0)
#endif
-#ifndef __has_attribute
-#define __has_attribute(x) 0
+#if defined(BROTLI_GNUC_VERSION)
+#define BROTLI_GNUC_VERSION_CHECK(major, minor, patch) \
+ (BROTLI_GNUC_VERSION >= BROTLI_MAKE_VERSION(major, minor, patch))
+#else
+#define BROTLI_GNUC_VERSION_CHECK(major, minor, patch) (0)
#endif
-#ifndef __has_feature
-#define __has_feature(x) 0
+#if defined(_MSC_FULL_VER) && (_MSC_FULL_VER >= 140000000)
+#define BROTLI_MSVC_VERSION \
+ BROTLI_MAKE_VERSION((_MSC_FULL_VER / 10000000), \
+ (_MSC_FULL_VER % 10000000) / 100000, \
+ (_MSC_FULL_VER % 100000) / 100)
+#elif defined(_MSC_FULL_VER)
+#define BROTLI_MSVC_VERSION \
+ BROTLI_MAKE_VERSION((_MSC_FULL_VER / 1000000), \
+ (_MSC_FULL_VER % 1000000) / 10000, \
+ (_MSC_FULL_VER % 10000) / 10)
+#elif defined(_MSC_VER)
+#define BROTLI_MSVC_VERSION \
+ BROTLI_MAKE_VERSION(_MSC_VER / 100, _MSC_VER % 100, 0)
#endif
-#if defined(__GNUC__) && defined(__GNUC_MINOR__)
-#define BROTLI_GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__)
+#if !defined(_MSC_VER)
+#define BROTLI_MSVC_VERSION_CHECK(major, minor, patch) (0)
+#elif defined(_MSC_VER) && (_MSC_VER >= 1400)
+#define BROTLI_MSVC_VERSION_CHECK(major, minor, patch) \
+ (_MSC_FULL_VER >= ((major * 10000000) + (minor * 100000) + (patch)))
+#elif defined(_MSC_VER) && (_MSC_VER >= 1200)
+#define BROTLI_MSVC_VERSION_CHECK(major, minor, patch) \
+ (_MSC_FULL_VER >= ((major * 1000000) + (minor * 10000) + (patch)))
#else
-#define BROTLI_GCC_VERSION 0
+#define BROTLI_MSVC_VERSION_CHECK(major, minor, patch) \
+ (_MSC_VER >= ((major * 100) + (minor)))
+#endif
+
+#if defined(__INTEL_COMPILER) && defined(__INTEL_COMPILER_UPDATE)
+#define BROTLI_INTEL_VERSION \
+ BROTLI_MAKE_VERSION(__INTEL_COMPILER / 100, \
+ __INTEL_COMPILER % 100, \
+ __INTEL_COMPILER_UPDATE)
+#elif defined(__INTEL_COMPILER)
+#define BROTLI_INTEL_VERSION \
+ BROTLI_MAKE_VERSION(__INTEL_COMPILER / 100, __INTEL_COMPILER % 100, 0)
#endif
-#if defined(__ICC)
-#define BROTLI_ICC_VERSION __ICC
+#if defined(BROTLI_INTEL_VERSION)
+#define BROTLI_INTEL_VERSION_CHECK(major, minor, patch) \
+ (BROTLI_INTEL_VERSION >= BROTLI_MAKE_VERSION(major, minor, patch))
#else
-#define BROTLI_ICC_VERSION 0
+#define BROTLI_INTEL_VERSION_CHECK(major, minor, patch) (0)
+#endif
+
+#if defined(__PGI) && \
+ defined(__PGIC__) && defined(__PGIC_MINOR__) && defined(__PGIC_PATCHLEVEL__)
+#define BROTLI_PGI_VERSION \
+ BROTLI_MAKE_VERSION(__PGIC__, __PGIC_MINOR__, __PGIC_PATCHLEVEL__)
+#endif
+
+#if defined(BROTLI_PGI_VERSION)
+#define BROTLI_PGI_VERSION_CHECK(major, minor, patch) \
+ (BROTLI_PGI_VERSION >= BROTLI_MAKE_VERSION(major, minor, patch))
+#else
+#define BROTLI_PGI_VERSION_CHECK(major, minor, patch) (0)
+#endif
+
+#if defined(__SUNPRO_C) && (__SUNPRO_C > 0x1000)
+#define BROTLI_SUNPRO_VERSION \
+ BROTLI_MAKE_VERSION( \
+ (((__SUNPRO_C >> 16) & 0xf) * 10) + ((__SUNPRO_C >> 12) & 0xf), \
+ (((__SUNPRO_C >> 8) & 0xf) * 10) + ((__SUNPRO_C >> 4) & 0xf), \
+ (__SUNPRO_C & 0xf) * 10)
+#elif defined(__SUNPRO_C)
+#define BROTLI_SUNPRO_VERSION \
+ BROTLI_MAKE_VERSION((__SUNPRO_C >> 8) & 0xf, \
+ (__SUNPRO_C >> 4) & 0xf, \
+ (__SUNPRO_C) & 0xf)
+#elif defined(__SUNPRO_CC) && (__SUNPRO_CC > 0x1000)
+#define BROTLI_SUNPRO_VERSION \
+ BROTLI_MAKE_VERSION( \
+ (((__SUNPRO_CC >> 16) & 0xf) * 10) + ((__SUNPRO_CC >> 12) & 0xf), \
+ (((__SUNPRO_CC >> 8) & 0xf) * 10) + ((__SUNPRO_CC >> 4) & 0xf), \
+ (__SUNPRO_CC & 0xf) * 10)
+#elif defined(__SUNPRO_CC)
+#define BROTLI_SUNPRO_VERSION \
+ BROTLI_MAKE_VERSION((__SUNPRO_CC >> 8) & 0xf, \
+ (__SUNPRO_CC >> 4) & 0xf, \
+ (__SUNPRO_CC) & 0xf)
+#endif
+
+#if defined(BROTLI_SUNPRO_VERSION)
+#define BROTLI_SUNPRO_VERSION_CHECK(major, minor, patch) \
+ (BROTLI_SUNPRO_VERSION >= BROTLI_MAKE_VERSION(major, minor, patch))
+#else
+#define BROTLI_SUNPRO_VERSION_CHECK(major, minor, patch) (0)
+#endif
+
+#if defined(__CC_ARM) && defined(__ARMCOMPILER_VERSION)
+#define BROTLI_ARM_VERSION \
+ BROTLI_MAKE_VERSION((__ARMCOMPILER_VERSION / 1000000), \
+ (__ARMCOMPILER_VERSION % 1000000) / 10000, \
+ (__ARMCOMPILER_VERSION % 10000) / 100)
+#elif defined(__CC_ARM) && defined(__ARMCC_VERSION)
+#define BROTLI_ARM_VERSION \
+ BROTLI_MAKE_VERSION((__ARMCC_VERSION / 1000000), \
+ (__ARMCC_VERSION % 1000000) / 10000, \
+ (__ARMCC_VERSION % 10000) / 100)
+#endif
+
+#if defined(BROTLI_ARM_VERSION)
+#define BROTLI_ARM_VERSION_CHECK(major, minor, patch) \
+ (BROTLI_ARM_VERSION >= BROTLI_MAKE_VERSION(major, minor, patch))
+#else
+#define BROTLI_ARM_VERSION_CHECK(major, minor, patch) (0)
+#endif
+
+#if defined(__ibmxl__)
+#define BROTLI_IBM_VERSION \
+ BROTLI_MAKE_VERSION(__ibmxl_version__, \
+ __ibmxl_release__, \
+ __ibmxl_modification__)
+#elif defined(__xlC__) && defined(__xlC_ver__)
+#define BROTLI_IBM_VERSION \
+ BROTLI_MAKE_VERSION(__xlC__ >> 8, __xlC__ & 0xff, (__xlC_ver__ >> 8) & 0xff)
+#elif defined(__xlC__)
+#define BROTLI_IBM_VERSION BROTLI_MAKE_VERSION(__xlC__ >> 8, __xlC__ & 0xff, 0)
+#endif
+
+#if defined(BROTLI_IBM_VERSION)
+#define BROTLI_IBM_VERSION_CHECK(major, minor, patch) \
+ (BROTLI_IBM_VERSION >= BROTLI_MAKE_VERSION(major, minor, patch))
+#else
+#define BROTLI_IBM_VERSION_CHECK(major, minor, patch) (0)
+#endif
+
+#if defined(__TI_COMPILER_VERSION__)
+#define BROTLI_TI_VERSION \
+ BROTLI_MAKE_VERSION((__TI_COMPILER_VERSION__ / 1000000), \
+ (__TI_COMPILER_VERSION__ % 1000000) / 1000, \
+ (__TI_COMPILER_VERSION__ % 1000))
#endif
-#if defined(BROTLI_BUILD_MODERN_COMPILER)
-#define BROTLI_MODERN_COMPILER 1
-#elif BROTLI_GCC_VERSION >= 304 || BROTLI_ICC_VERSION >= 1600
-#define BROTLI_MODERN_COMPILER 1
+#if defined(BROTLI_TI_VERSION)
+#define BROTLI_TI_VERSION_CHECK(major, minor, patch) \
+ (BROTLI_TI_VERSION >= BROTLI_MAKE_VERSION(major, minor, patch))
#else
-#define BROTLI_MODERN_COMPILER 0
+#define BROTLI_TI_VERSION_CHECK(major, minor, patch) (0)
#endif
-#if defined(BROTLI_SHARED_COMPILATION) && defined(_WIN32)
+#if defined(__IAR_SYSTEMS_ICC__)
+#if __VER__ > 1000
+#define BROTLI_IAR_VERSION \
+ BROTLI_MAKE_VERSION((__VER__ / 1000000), \
+ (__VER__ / 1000) % 1000, \
+ (__VER__ % 1000))
+#else
+#define BROTLI_IAR_VERSION BROTLI_MAKE_VERSION(VER / 100, __VER__ % 100, 0)
+#endif
+#endif
+
+#if defined(BROTLI_IAR_VERSION)
+#define BROTLI_IAR_VERSION_CHECK(major, minor, patch) \
+ (BROTLI_IAR_VERSION >= BROTLI_MAKE_VERSION(major, minor, patch))
+#else
+#define BROTLI_IAR_VERSION_CHECK(major, minor, patch) (0)
+#endif
+
+#if defined(__TINYC__)
+#define BROTLI_TINYC_VERSION \
+ BROTLI_MAKE_VERSION(__TINYC__ / 1000, (__TINYC__ / 100) % 10, __TINYC__ % 100)
+#endif
+
+#if defined(BROTLI_TINYC_VERSION)
+#define BROTLI_TINYC_VERSION_CHECK(major, minor, patch) \
+ (BROTLI_TINYC_VERSION >= BROTLI_MAKE_VERSION(major, minor, patch))
+#else
+#define BROTLI_TINYC_VERSION_CHECK(major, minor, patch) (0)
+#endif
+
+#if defined(__has_attribute)
+#define BROTLI_GNUC_HAS_ATTRIBUTE(attribute, major, minor, patch) \
+ __has_attribute(attribute)
+#else
+#define BROTLI_GNUC_HAS_ATTRIBUTE(attribute, major, minor, patch) \
+ BROTLI_GNUC_VERSION_CHECK(major, minor, patch)
+#endif
+
+#if defined(__has_builtin)
+#define BROTLI_GNUC_HAS_BUILTIN(builtin, major, minor, patch) \
+ __has_builtin(builtin)
+#else
+#define BROTLI_GNUC_HAS_BUILTIN(builtin, major, minor, patch) \
+ BROTLI_GNUC_VERSION_CHECK(major, minor, patch)
+#endif
+
+#if defined(_WIN32) || defined(__CYGWIN__)
+#define BROTLI_PUBLIC
+#elif BROTLI_GNUC_VERSION_CHECK(3, 3, 0) || \
+ BROTLI_TI_VERSION_CHECK(8, 0, 0) || \
+ BROTLI_INTEL_VERSION_CHECK(16, 0, 0) || \
+ BROTLI_ARM_VERSION_CHECK(4, 1, 0) || \
+ BROTLI_IBM_VERSION_CHECK(13, 1, 0) || \
+ BROTLI_SUNPRO_VERSION_CHECK(5, 11, 0) || \
+ (BROTLI_TI_VERSION_CHECK(7, 3, 0) && \
+ defined(__TI_GNU_ATTRIBUTE_SUPPORT__) && defined(__TI_EABI__))
+#define BROTLI_PUBLIC __attribute__ ((visibility ("default")))
+#else
+#define BROTLI_PUBLIC
+#endif
+
+#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && \
+ !defined(__STDC_NO_VLA__) && !defined(__cplusplus) && \
+ !defined(__PGI) && !defined(__PGIC__) && !defined(__TINYC__)
+#define BROTLI_ARRAY_PARAM(name) (name)
+#else
+#define BROTLI_ARRAY_PARAM(name)
+#endif
+
+/* <<< <<< <<< end of hedley macros. */
+
+#if defined(BROTLI_SHARED_COMPILATION)
+#if defined(_WIN32)
#if defined(BROTLICOMMON_SHARED_COMPILATION)
#define BROTLI_COMMON_API __declspec(dllexport)
#else
@@ -63,16 +260,15 @@
#else
#define BROTLI_ENC_API __declspec(dllimport)
#endif /* BROTLIENC_SHARED_COMPILATION */
-#else /* BROTLI_SHARED_COMPILATION && _WIN32 */
+#else /* _WIN32 */
+#define BROTLI_COMMON_API BROTLI_PUBLIC
+#define BROTLI_DEC_API BROTLI_PUBLIC
+#define BROTLI_ENC_API BROTLI_PUBLIC
+#endif /* _WIN32 */
+#else /* BROTLI_SHARED_COMPILATION */
#define BROTLI_COMMON_API
#define BROTLI_DEC_API
#define BROTLI_ENC_API
#endif
-#if BROTLI_MODERN_COMPILER || __has_attribute(deprecated)
-#define BROTLI_DEPRECATED __attribute__((deprecated))
-#else
-#define BROTLI_DEPRECATED
-#endif
-
#endif /* BROTLI_COMMON_PORT_H_ */
diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/include/brotli/types.h b/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/include/brotli/types.h
index fcb2710289e..eff1a3cd07a 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/include/brotli/types.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-src/libs/brotli/include/brotli/types.h
@@ -80,11 +80,4 @@ typedef void* (*brotli_alloc_func)(void* opaque, size_t size);
*/
typedef void (*brotli_free_func)(void* opaque, void* address);
-#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && \
- !defined(__cplusplus) && !defined(__PGI)
-#define BROTLI_ARRAY_PARAM(L) L
-#else
-#define BROTLI_ARRAY_PARAM(L)
-#endif
-
#endif /* BROTLI_COMMON_TYPES_H_ */
diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/libs/woff2/include/woff2/version.h b/Build/source/texk/dvisvgm/dvisvgm-src/libs/woff2/include/woff2/version.h
index e949b2d0dcd..dfcc0b35990 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-src/libs/woff2/include/woff2/version.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-src/libs/woff2/include/woff2/version.h
@@ -2,7 +2,7 @@
#define WOFF2_WOFF2_VERSION_H_
namespace woff2 {
-constexpr const int version = 0x010001;
+constexpr const int version = 0x010002;
}
#endif
diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/libs/woff2/src/font.cc b/Build/source/texk/dvisvgm/dvisvgm-src/libs/woff2/src/font.cc
index ef552e16890..1361f8c5dcc 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-src/libs/woff2/src/font.cc
+++ b/Build/source/texk/dvisvgm/dvisvgm-src/libs/woff2/src/font.cc
@@ -123,6 +123,9 @@ bool ReadCollectionFont(Buffer* file, const uint8_t* data, size_t len,
(*all_tables)[table.offset] = font->FindTable(table.tag);
} else {
table.reuse_of = (*all_tables)[table.offset];
+ if (table.tag != table.reuse_of->tag) {
+ return FONT_COMPRESSION_FAILURE();
+ }
}
}
diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/libs/woff2/src/normalize.cc b/Build/source/texk/dvisvgm/dvisvgm-src/libs/woff2/src/normalize.cc
index 67a16957018..32a065975f0 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-src/libs/woff2/src/normalize.cc
+++ b/Build/source/texk/dvisvgm/dvisvgm-src/libs/woff2/src/normalize.cc
@@ -96,7 +96,10 @@ bool MakeEditableBuffer(Font* font, int tableTag) {
int sz = Round4(table->length);
table->buffer.resize(sz);
uint8_t* buf = &table->buffer[0];
- memcpy(buf, table->data, sz);
+ memcpy(buf, table->data, table->length);
+ if (PREDICT_FALSE(sz > table->length)) {
+ memset(buf + table->length, 0, sz - table->length);
+ }
table->data = buf;
return true;
}
diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/DVIToSVGActions.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/DVIToSVGActions.cpp
index 511b6b04c1a..d9af5936bc5 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-src/src/DVIToSVGActions.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/DVIToSVGActions.cpp
@@ -280,7 +280,7 @@ BoundingBox& DVIToSVGActions::bbox(const string& name, bool reset) {
* a rotating dash. */
void DVIToSVGActions::progress (const char *id) {
if (PROGRESSBAR_DELAY < 1000) {
- static double time=0;
+ static double time=System::time();
// slow down updating the progress indicator to prevent flickering
if (System::time() - time > 0.1) {
progress(0, 0, id);
diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/FileSystem.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/FileSystem.cpp
index 4804b56f404..744de1920ff 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-src/src/FileSystem.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/FileSystem.cpp
@@ -98,8 +98,8 @@ bool FileSystem::remove (const string &fname) {
* @param[in] remove_src remove file 'src' if true
* @return true on success */
bool FileSystem::copy (const string &src, const string &dest, bool remove_src) {
- ifstream ifs(src.c_str(), ios::in|ios::binary);
- ofstream ofs(dest.c_str(), ios::out|ios::binary);
+ ifstream ifs(src, ios::in|ios::binary);
+ ofstream ofs(dest, ios::out|ios::binary);
if (ifs && ofs) {
ofs << ifs.rdbuf();
if (!ifs.fail() && !ofs.fail() && remove_src) {
diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/FontCache.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/FontCache.cpp
index f14a4ca8bd0..c233408960c 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-src/src/FontCache.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/FontCache.cpp
@@ -81,7 +81,7 @@ bool FontCache::write (const string &fontname, const string &dir) const {
string dirstr = dir.empty() ? FileSystem::getcwd() : dir;
ostringstream oss;
oss << dirstr << '/' << fontname << ".fgd";
- ofstream ofs(oss.str().c_str(), ios::binary);
+ ofstream ofs(oss.str(), ios::binary);
return write(fontname, ofs);
}
return false;
@@ -177,7 +177,7 @@ bool FontCache::read (const string &fontname, const string &dir) {
string dirstr = dir.empty() ? FileSystem::getcwd() : dir;
ostringstream oss;
oss << dirstr << '/' << fontname << ".fgd";
- ifstream ifs(oss.str().c_str(), ios::binary);
+ ifstream ifs(oss.str(), ios::binary);
return read(fontname, ifs);
}
@@ -265,7 +265,7 @@ bool FontCache::fontinfo (const string &dirname, vector<FontInfo> &infos, vector
if (fname[0] == 'f' && fname.length() > 5 && fname.substr(fname.length()-4) == ".fgd") {
FontInfo info;
string path = dirname+"/"+(fname.substr(1));
- ifstream ifs(path.c_str(), ios::binary);
+ ifstream ifs(path, ios::binary);
if (fontinfo(ifs, info))
infos.emplace_back(move(info));
else
diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/FontMap.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/FontMap.cpp
index b8293a14361..85bb428b7c5 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-src/src/FontMap.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/FontMap.cpp
@@ -47,7 +47,7 @@ FontMap& FontMap::instance() {
* @param[in] mode selects how to integrate the map file entries into the global map tree
* @return true if file could be opened */
bool FontMap::read (const string &fname, FontMap::Mode mode) {
- ifstream ifs(fname.c_str());
+ ifstream ifs(fname);
if (!ifs)
return false;
diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/GFGlyphTracer.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/GFGlyphTracer.cpp
index 425bc6494aa..dbbcc419a14 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-src/src/GFGlyphTracer.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/GFGlyphTracer.cpp
@@ -34,7 +34,7 @@ GFGlyphTracer::GFGlyphTracer (string &fname, double upp, Callback *cb)
{
if (_callback)
_callback->setFont(fname);
- _ifs.open(fname.c_str(), ios::binary);
+ _ifs.open(fname, ios::binary);
}
@@ -44,7 +44,7 @@ void GFGlyphTracer::reset (string &fname, double upp) {
if (_ifs.is_open())
_ifs.close();
unitsPerPoint(upp);
- _ifs.open(fname.c_str(), ios::binary);
+ _ifs.open(fname, ios::binary);
}
diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/ImageToSVG.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/ImageToSVG.cpp
index 27285fbb7c2..72c134d5a4e 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-src/src/ImageToSVG.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/ImageToSVG.cpp
@@ -93,7 +93,7 @@ string ImageToSVG::getSVGFilename (unsigned pageno) const {
void ImageToSVG::progress (const char *id) {
- static double time=0;
+ static double time=System::time();
static bool draw=false; // show progress indicator?
static size_t count=0;
count++;
diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/MetafontWrapper.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/MetafontWrapper.cpp
index 295237d1d91..6b0b1a498d4 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-src/src/MetafontWrapper.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/MetafontWrapper.cpp
@@ -106,8 +106,8 @@ bool MetafontWrapper::call (const string &mode, double mag) {
* @param[in] mag magnification factor
* @return true on success */
bool MetafontWrapper::make (const string &mode, double mag) {
- ifstream tfm((_dir+_fontname+".tfm").c_str());
- ifstream gf((_dir+_fontname+".gf").c_str());
+ ifstream tfm(_dir+_fontname+".tfm");
+ ifstream gf(_dir+_fontname+".gf");
if (gf && tfm) // @@ distinguish between gf and tfm
return true;
return call(mode, mag);
@@ -115,7 +115,7 @@ bool MetafontWrapper::make (const string &mode, double mag) {
bool MetafontWrapper::success () const {
- ifstream tfm((_dir+_fontname+".tfm").c_str());
- ifstream gf((_dir+_fontname+".gf").c_str());
+ ifstream tfm(_dir+_fontname+".tfm");
+ ifstream gf(_dir+_fontname+".gf");
return tfm && gf;
}
diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/PsSpecialHandler.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/PsSpecialHandler.cpp
index f6aa64fc144..eb09cc0b8a3 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-src/src/PsSpecialHandler.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/PsSpecialHandler.cpp
@@ -243,7 +243,7 @@ bool PsSpecialHandler::process (const string &prefix, istream &is, SpecialAction
StreamInputReader in(is);
if (in.check(" plotfile ")) { // ps: plotfile fname
string fname = in.getString();
- ifstream ifs(fname.c_str());
+ ifstream ifs(fname);
if (ifs)
_psi.execute(ifs);
else
diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/SourceInput.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/SourceInput.cpp
index 96efb50a875..d1622fb66f5 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-src/src/SourceInput.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/SourceInput.cpp
@@ -50,58 +50,74 @@ static int fdclose (int fd) {return close(fd);}
#endif
-SourceInput::~SourceInput () {
- // remove temporary file created for reading from stdin
- if (!_tmpfilepath.empty())
- FileSystem::remove(_tmpfilepath);
-}
-
-
-/** Creates a temporary file in the configured tmp folder.
- * @param[out] path path of the created file
- * @return file descriptor (>= 0 on success) */
-static int create_tmp_file (string &path) {
- path = FileSystem::tmpdir();
+/** Creates a new temporary file in the configured tmp folder.
+ * If the object already holds an opened temporary file, it's closed
+ * and removed before creating the new one.
+ * @return true on success */
+bool TemporaryFile::create () {
+ if (opened())
+ close();
+ _path = FileSystem::tmpdir();
#ifndef _WIN32
- path += "stdinXXXXXX";
- int fd = mkstemp(&path[0]);
+ _path += "stdinXXXXXX";
+ _fd = mkstemp(&_path[0]);
#else
- int fd = -1;
char fname[MAX_PATH];
- std::replace(path.begin(), path.end(), '/', '\\');
- if (GetTempFileName(path.c_str(), "stdin", 0, fname)) {
- fd = _open(fname, _O_CREAT | _O_WRONLY | _O_BINARY, _S_IWRITE);
- path = fname;
+ std::replace(_path.begin(), _path.end(), '/', '\\');
+ if (GetTempFileName(_path.c_str(), "stdin", 0, fname)) {
+ _fd = _open(fname, _O_CREAT | _O_WRONLY | _O_BINARY, _S_IWRITE);
+ _path = fname;
}
#endif
- return fd;
+ return opened();
+}
+
+
+/** Writes a sequence of characters to the file.
+ * @param[in] buf buffer containing the characters to write
+ * @param[in] len number of characters to write
+ * @return true on success */
+bool TemporaryFile::write (const char *buf, size_t len) {
+ return opened() && fdwrite(_fd, buf, len) >= 0;
}
+/** Closes and removes the temporary file.
+ * @return true on success */
+bool TemporaryFile::close () {
+ bool ok = true;
+ if (opened()) {
+ ok = (fdclose(_fd) >= 0);
+ FileSystem::remove(_path);
+ _fd = -1;
+ _path.clear();
+ }
+ return ok;
+}
+
+////////////////////////////////////////////////////////////////
+
istream& SourceInput::getInputStream (bool showMessages) {
if (!_ifs.is_open()) {
if (!_fname.empty())
_ifs.open(_fname, ios::binary);
else {
- int fd = create_tmp_file(_tmpfilepath);
- if (fd < 0)
- throw MessageException("can't create temporary file for writing");
#ifdef _WIN32
if (_setmode(_fileno(stdin), _O_BINARY) == -1)
throw MessageException("can't open stdin in binary mode");
#endif
+ if (!_tmpfile.create())
+ throw MessageException("can't create temporary file for writing");
if (showMessages)
Message::mstream() << "reading from " << getMessageFileName() << '\n';
char buf[1024];
while (cin) {
cin.read(buf, 1024);
size_t count = cin.gcount();
- if (fdwrite(fd, buf, count) < 0)
+ if (!_tmpfile.write(buf, count))
throw MessageException("failed to write data to temporary file");
}
- if (fdclose(fd) < 0)
- throw MessageException("failed to close temporary file");
- _ifs.open(_tmpfilepath, ios::binary);
+ _ifs.open(_tmpfile.path(), ios::binary);
}
}
return _ifs;
@@ -119,5 +135,5 @@ string SourceInput::getMessageFileName () const {
string SourceInput::getFilePath () const {
- return _tmpfilepath.empty() ? _fname : _tmpfilepath;
+ return _tmpfile.path().empty() ? _fname : _tmpfile.path();
}
diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/SourceInput.hpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/SourceInput.hpp
index 95f496a60a2..be596d8b557 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-src/src/SourceInput.hpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/SourceInput.hpp
@@ -18,16 +18,32 @@
** along with this program; if not, see <http://www.gnu.org/licenses/>. **
*************************************************************************/
-#ifndef DVIINPUT_HPP
-#define DVIINPUT_HPP
+#ifndef SOURCEINPUT_HPP
+#define SOURCEINPUT_HPP
#include <fstream>
#include <string>
+
+/** Helper class to handle temporary files. */
+class TemporaryFile {
+ public:
+ ~TemporaryFile () {close();}
+ bool create ();
+ bool opened () const {return _fd >= 0;}
+ bool write (const char *buf, size_t len);
+ bool close ();
+ const std::string& path () const {return _path;}
+
+ private:
+ int _fd = -1; ///< file descriptor assigned to the temporary file
+ std::string _path; ///< path to temporary file
+};
+
+
class SourceInput {
public:
SourceInput (const std::string &fname) : _fname(fname) {}
- ~SourceInput ();
std::istream& getInputStream (bool showMessages=false);
std::string getFileName () const;
std::string getMessageFileName () const;
@@ -35,8 +51,8 @@ class SourceInput {
private:
const std::string &_fname; ///< name of file to read from
- std::string _tmpfilepath; ///< path of temporary file used when reading from stdin
+ TemporaryFile _tmpfile; ///< temporary file used when reading from stdin
std::ifstream _ifs;
};
-#endif \ No newline at end of file
+#endif
diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/StreamReader.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/StreamReader.cpp
index 3e4fa2adcc5..61e1c2ff1b9 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-src/src/StreamReader.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/StreamReader.cpp
@@ -99,7 +99,7 @@ string StreamReader::readString () {
* @return the string read */
string StreamReader::readString (CRC32 &crc32, bool finalZero) {
string ret = readString();
- crc32.update((const uint8_t*)ret.c_str(), ret.length());
+ crc32.update(reinterpret_cast<const uint8_t*>(ret.data()), ret.length());
if (finalZero)
crc32.update(0, 1);
return ret;
@@ -114,7 +114,7 @@ string StreamReader::readString (int length) {
throw StreamReaderException("no stream assigned");
length = max(0, length);
string str(length, '\0');
- _is->read(&str[0], length); // reads 'length' bytes and appends \0
+ _is->read(&str[0], length); // read 'length' bytes and append '\0'
return str;
}
@@ -125,7 +125,7 @@ string StreamReader::readString (int length) {
* @return the string read */
string StreamReader::readString (int length, CRC32 &crc32) {
string ret = readString(length);
- crc32.update(ret.c_str());
+ crc32.update(reinterpret_cast<const uint8_t*>(ret.data()), length);
return ret;
}
diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/utility.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/utility.cpp
index 9517a6a1013..92fa6f3c65c 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-src/src/utility.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/utility.cpp
@@ -124,7 +124,7 @@ int util::ilog10 (int n) {
/** Returns the contents of a file.
* @param[in] fname name/path of the file */
string util::read_file_contents (const string &fname) {
- ifstream ifs(fname.c_str(), ios::binary);
+ ifstream ifs(fname, ios::binary);
return string(istreambuf_iterator<char>(ifs.rdbuf()), istreambuf_iterator<char>());
}
@@ -134,6 +134,6 @@ string util::read_file_contents (const string &fname) {
* @param[in] start iterator pointing to the begin of the byte sequence
* @param[in] end iterator pointing to the first byte after the byte sequence to write */
void util::write_file_contents (const string &fname, string::iterator start, string::iterator end) {
- ofstream ofs(fname.c_str(), ios::binary);
+ ofstream ofs(fname, ios::binary);
copy(start, end, ostream_iterator<char>(ofs));
}
diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/version.hpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/version.hpp
index bbcd4cf0dbb..ef46850c80e 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-src/src/version.hpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/version.hpp
@@ -22,7 +22,7 @@
#define VERSION_HPP
constexpr const char *PROGRAM_NAME = "dvisvgm";
-constexpr const char *PROGRAM_VERSION = "2.4";
+constexpr const char *PROGRAM_VERSION = "2.4.1";
#endif
diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/tests/DVIReaderTest.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/tests/DVIReaderTest.cpp
index 860e233a36d..af735178a7e 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-src/tests/DVIReaderTest.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-src/tests/DVIReaderTest.cpp
@@ -163,7 +163,7 @@ class LoggingDVIReader : public DVIReader {
static void test_dvi_file (const char *fname, const vector<const char*> &expected_lines) {
XMLString::DECIMAL_PLACES = 3;
string dviname = string(SRCDIR)+"/data/"+fname;
- ifstream ifs(dviname.c_str(), ios::binary);
+ ifstream ifs(dviname, ios::binary);
ASSERT_TRUE(bool(ifs));
stringstream ss;
LoggingDVIReader dviReader(ifs, ss);
diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/tests/GFReaderTest.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/tests/GFReaderTest.cpp
index fe757de11ae..ac6ee637b73 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-src/tests/GFReaderTest.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-src/tests/GFReaderTest.cpp
@@ -233,7 +233,7 @@ class LoggingGFReader : public GFReader {
TEST(GFReaderTest, preamble) {
string gf = string(SRCDIR)+"/data/cmr10.600gf";
- ifstream ifs(gf.c_str(), ios::binary);
+ ifstream ifs(gf, ios::binary);
ASSERT_TRUE(bool(ifs));
LoggingGFReader gfReader(ifs);
gfReader.executePreamble();
@@ -243,7 +243,7 @@ TEST(GFReaderTest, preamble) {
TEST(GFReaderTest, postamble) {
string gf = string(SRCDIR)+"/data/cmr10.600gf";
- ifstream ifs(gf.c_str(), ios::binary);
+ ifstream ifs(gf, ios::binary);
ASSERT_TRUE(bool(ifs));
GFReader gfReader(ifs);
gfReader.executePostamble();
@@ -256,7 +256,7 @@ TEST(GFReaderTest, postamble) {
TEST(GFReaderTest, executeChar) {
string gf = string(SRCDIR)+"/data/cmr10.600gf";
- ifstream ifs(gf.c_str(), ios::binary);
+ ifstream ifs(gf, ios::binary);
ASSERT_TRUE(bool(ifs));
GFReader gfReader(ifs);
PixelActions actions;
@@ -286,7 +286,7 @@ TEST(GFReaderTest, executeChar) {
TEST(GFReaderTest, executeAllChars) {
string gf = string(SRCDIR)+"/data/cmr10.600gf";
- ifstream ifs(gf.c_str(), ios::binary);
+ ifstream ifs(gf, ios::binary);
ASSERT_TRUE(bool(ifs));
GFReader gfReader(ifs);
gfReader.executeAllChars();
diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/tests/JFMReaderTest.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/tests/JFMReaderTest.cpp
index a8a109859d8..947998a4d03 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-src/tests/JFMReaderTest.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-src/tests/JFMReaderTest.cpp
@@ -38,7 +38,7 @@ class JFMReaderTest : public ::testing::Test {
public:
void SetUp () override {
string fname = string(SRCDIR)+"/data/cidjmgr0-h.tfm";
- ifstream ifs(fname.c_str(), ios::binary);
+ ifstream ifs(fname, ios::binary);
ASSERT_TRUE(ifs.is_open()) << "failed opening " << fname;
jfm = util::make_unique<JFM>(ifs);
}
diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/tests/TFMReaderTest.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/tests/TFMReaderTest.cpp
index 0cda3a9c9fe..3c545247aae 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-src/tests/TFMReaderTest.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-src/tests/TFMReaderTest.cpp
@@ -38,7 +38,7 @@ class TFMReaderTest : public ::testing::Test {
public:
void SetUp () override {
string fname = string(SRCDIR)+"/data/cmr10.tfm";
- ifstream ifs(fname.c_str(), ios::binary);
+ ifstream ifs(fname, ios::binary);
ASSERT_TRUE(ifs.is_open()) << "failed opening " << fname;
tfm = util::make_unique<TFM>(ifs);
}
diff --git a/Build/source/texk/dvisvgm/version.ac b/Build/source/texk/dvisvgm/version.ac
index 4f528072046..75579ec23a8 100644
--- a/Build/source/texk/dvisvgm/version.ac
+++ b/Build/source/texk/dvisvgm/version.ac
@@ -9,4 +9,4 @@ dnl
dnl --------------------------------------------------------
dnl
dnl m4-include this file to define the current dvisvgm version
-m4_define([dvisvgm_version], [2.4])
+m4_define([dvisvgm_version], [2.4.1])