Merge remote-tracking branch 'origin/5.13' into dev
Conflicts: src/corelib/kernel/qobject.cpp src/corelib/kernel/qvariant.h src/corelib/tools/qlist.h Done-With: Milian Wolff <milian.wolff@kdab.com> Done-With: Allan Sandfeld Jensen <allan.jensen@qt.io> Change-Id: I6803f7239aa137a51a7467fab7cc7a01302a848d
This commit is contained in:
commit
c2b553784d
@ -203,7 +203,7 @@ Build environment:
|
||||
-android-ndk-host .... Set Android NDK host (linux-x86, linux-x86_64, etc.)
|
||||
[$ANDROID_NDK_HOST]
|
||||
-android-arch ........ Set Android architecture (armeabi, armeabi-v7a,
|
||||
arm64-v8a, x86, x86_64, mips, mips64)
|
||||
arm64-v8a, x86, x86_64)
|
||||
-android-toolchain-version ... Set Android toolchain version
|
||||
-android-style-assets Automatically extract style assets from the device at
|
||||
run time. This option makes the Android style behave
|
||||
|
@ -24,10 +24,6 @@ else: equals(ANDROID_TARGET_ARCH, x86): \
|
||||
QMAKE_CFLAGS += -target i686-none-linux-android -mstackrealign
|
||||
else: equals(ANDROID_TARGET_ARCH, x86_64): \
|
||||
QMAKE_CFLAGS += -target x86_64-none-linux-android
|
||||
else: equals(ANDROID_TARGET_ARCH, mips): \
|
||||
QMAKE_CFLAGS += -target mipsel-none-linux-android
|
||||
else: equals(ANDROID_TARGET_ARCH, mips64): \
|
||||
QMAKE_CFLAGS += -target mips64el-none-linux-android
|
||||
|
||||
QMAKE_CFLAGS += -gcc-toolchain $$NDK_TOOLCHAIN_PATH -fno-limit-debug-info
|
||||
|
||||
|
@ -19,8 +19,6 @@ NDK_TOOLCHAIN_PREFIX = $$(ANDROID_NDK_TOOLCHAIN_PREFIX)
|
||||
isEmpty(NDK_TOOLCHAIN_PREFIX) {
|
||||
equals(ANDROID_TARGET_ARCH, x86): NDK_TOOLCHAIN_PREFIX = x86
|
||||
else: equals(ANDROID_TARGET_ARCH, x86_64): NDK_TOOLCHAIN_PREFIX = x86_64
|
||||
else: equals(ANDROID_TARGET_ARCH, mips): NDK_TOOLCHAIN_PREFIX = mipsel-linux-android
|
||||
else: equals(ANDROID_TARGET_ARCH, mips64): NDK_TOOLCHAIN_PREFIX = mips64el-linux-android
|
||||
else: equals(ANDROID_TARGET_ARCH, arm64-v8a): NDK_TOOLCHAIN_PREFIX = aarch64-linux-android
|
||||
else: NDK_TOOLCHAIN_PREFIX = arm-linux-androideabi
|
||||
}
|
||||
@ -29,8 +27,6 @@ NDK_TOOLS_PREFIX = $$(ANDROID_NDK_TOOLS_PREFIX)
|
||||
isEmpty(NDK_TOOLS_PREFIX) {
|
||||
equals(ANDROID_TARGET_ARCH, x86): NDK_TOOLS_PREFIX = i686-linux-android
|
||||
else: equals(ANDROID_TARGET_ARCH, x86_64): NDK_TOOLS_PREFIX = x86_64-linux-android
|
||||
else: equals(ANDROID_TARGET_ARCH, mips): NDK_TOOLS_PREFIX = mipsel-linux-android
|
||||
else: equals(ANDROID_TARGET_ARCH, mips64): NDK_TOOLS_PREFIX = mips64el-linux-android
|
||||
else: equals(ANDROID_TARGET_ARCH, arm64-v8a): NDK_TOOLS_PREFIX = aarch64-linux-android
|
||||
else: NDK_TOOLS_PREFIX = arm-linux-androideabi
|
||||
}
|
||||
@ -40,8 +36,6 @@ isEmpty(NDK_TOOLCHAIN_VERSION): NDK_TOOLCHAIN_VERSION = $$DEFAULT_ANDROID_NDK_TO
|
||||
|
||||
equals(ANDROID_TARGET_ARCH, x86): ANDROID_ARCHITECTURE = x86
|
||||
else: equals(ANDROID_TARGET_ARCH, x86_64): ANDROID_ARCHITECTURE = x86_64
|
||||
else: equals(ANDROID_TARGET_ARCH, mips): ANDROID_ARCHITECTURE = mips
|
||||
else: equals(ANDROID_TARGET_ARCH, mips64): ANDROID_ARCHITECTURE = mips64
|
||||
else: equals(ANDROID_TARGET_ARCH, arm64-v8a): ANDROID_ARCHITECTURE = arm64
|
||||
else: ANDROID_ARCHITECTURE = arm
|
||||
|
||||
|
@ -1,5 +1,2 @@
|
||||
# Pick up the VULKAN_SDK env var set by the LunarG SDK so that the Vulkan
|
||||
# headers are found out-of-the-box on typical Windows setups.
|
||||
|
||||
QMAKE_INCDIR_VULKAN = $$(VULKAN_SDK)\\include
|
||||
load(windows_vulkan_sdk)
|
||||
QMAKE_LIBS_VULKAN =
|
||||
|
@ -25,8 +25,6 @@ contains(TEMPLATE, ".*app"):!build_pass:!android-embedded {
|
||||
isEmpty(NDK_TOOLCHAIN_PREFIX) {
|
||||
equals(ANDROID_TARGET_ARCH, x86): NDK_TOOLCHAIN_PREFIX = x86
|
||||
else: equals(ANDROID_TARGET_ARCH, x86_64): NDK_TOOLCHAIN_PREFIX = x86_64
|
||||
else: equals(ANDROID_TARGET_ARCH, mips): NDK_TOOLCHAIN_PREFIX = mipsel-linux-android
|
||||
else: equals(ANDROID_TARGET_ARCH, mips64): NDK_TOOLCHAIN_PREFIX = mips64el-linux-android
|
||||
else: equals(ANDROID_TARGET_ARCH, arm64-v8a): NDK_TOOLCHAIN_PREFIX = aarch64-linux-android
|
||||
else: NDK_TOOLCHAIN_PREFIX = arm-linux-androideabi
|
||||
}
|
||||
|
@ -39,6 +39,10 @@ contains(TEMPLATE, .*lib) {
|
||||
qt_libdir = $$[QT_INSTALL_LIBS]
|
||||
}
|
||||
contains(QMAKE_DEFAULT_LIBDIRS, $$qt_libdir) {
|
||||
lib_replace0.match = $$rplbase/lib/
|
||||
lib_replace0.replace = $$qqt_libdir/
|
||||
lib_replace0.CONFIG = path
|
||||
QMAKE_PRL_INSTALL_REPLACE += lib_replace0
|
||||
lib_replace.match = "[^ ']*$$rplbase/lib"
|
||||
lib_replace.replace =
|
||||
} else {
|
||||
@ -90,14 +94,8 @@ clang {
|
||||
greaterThan(QT_GCC_MAJOR_VERSION, 5): QMAKE_CXXFLAGS_WARN_ON += -Wshift-overflow=2 -Wduplicated-cond
|
||||
# GCC 7 has a lot of false positives relating to this, so disable completely
|
||||
greaterThan(QT_GCC_MAJOR_VERSION, 6): QMAKE_CXXFLAGS_WARN_ON += -Wno-stringop-overflow
|
||||
# GCC 9 has a lot of false positives relating to this, so disable completely
|
||||
greaterThan(QT_GCC_MAJOR_VERSION, 8): QMAKE_CXXFLAGS_WARN_ON += -Wno-deprecated-copy
|
||||
# GCC 9 introduced this
|
||||
greaterThan(QT_GCC_MAJOR_VERSION, 8): QMAKE_CXXFLAGS_WARN_ON += -Wno-redundant-move
|
||||
# GCC 9 introduced this
|
||||
# GCC 9 introduced -Wformat-overflow in -Wall, but it is buggy:
|
||||
greaterThan(QT_GCC_MAJOR_VERSION, 8): QMAKE_CXXFLAGS_WARN_ON += -Wno-format-overflow
|
||||
# GCC 9 introduced this
|
||||
greaterThan(QT_GCC_MAJOR_VERSION, 8): QMAKE_CXXFLAGS_WARN_ON += -Wno-init-list-lifetime
|
||||
}
|
||||
|
||||
warnings_are_errors:warning_clean {
|
||||
@ -137,14 +135,13 @@ warnings_are_errors:warning_clean {
|
||||
|
||||
# GCC 7 includes -Wimplicit-fallthrough in -Wextra, but Qt is not yet free of implicit fallthroughs.
|
||||
greaterThan(QT_GCC_MAJOR_VERSION, 6): QMAKE_CXXFLAGS_WARN_ON += -Wno-error=implicit-fallthrough
|
||||
# GCC 9 has a lot of false positives relating to this, so disable completely
|
||||
greaterThan(QT_GCC_MAJOR_VERSION, 8): QMAKE_CXXFLAGS_WARN_ON += -Wno-deprecated-copy
|
||||
# GCC 9 introduced -Wdeprecated-copy in -Wextra, but we are not clean for it.
|
||||
greaterThan(QT_GCC_MAJOR_VERSION, 8): QMAKE_CXXFLAGS_WARN_ON += -Wno-error=deprecated-copy
|
||||
# GCC 9 introduced this
|
||||
greaterThan(QT_GCC_MAJOR_VERSION, 8): QMAKE_CXXFLAGS_WARN_ON += -Wno-redundant-move
|
||||
greaterThan(QT_GCC_MAJOR_VERSION, 8): QMAKE_CXXFLAGS_WARN_ON += -Wno-error=redundant-move
|
||||
# GCC 9 introduced this
|
||||
greaterThan(QT_GCC_MAJOR_VERSION, 8): QMAKE_CXXFLAGS_WARN_ON += -Wno-format-overflow
|
||||
# GCC 9 introduced this
|
||||
greaterThan(QT_GCC_MAJOR_VERSION, 8): QMAKE_CXXFLAGS_WARN_ON += -Wno-init-list-lifetime
|
||||
greaterThan(QT_GCC_MAJOR_VERSION, 8): QMAKE_CXXFLAGS_WARN_ON += -Wno-error=init-list-lifetime
|
||||
|
||||
# Work-around for bug https://code.google.com/p/android/issues/detail?id=58135
|
||||
android: QMAKE_CXXFLAGS_WARN_ON += -Wno-error=literal-suffix
|
||||
}
|
||||
|
@ -970,8 +970,10 @@ defineTest(qtConfExportLibrary) {
|
||||
defines = $$eval($${spfx}.defines)
|
||||
!isEmpty(defines): qtConfOutputVar(assign, $$output, QMAKE_DEFINES_$$NAME, $$defines)
|
||||
includes = $$eval($${spfx}.exportincludedir)
|
||||
isEmpty(includes): includes = $$eval($${spfx}.includedir)
|
||||
!isEmpty(includes): qtConfOutputVar(assign, $$output, QMAKE_INCDIR_$$NAME, $$includes)
|
||||
!equals(includes, -) {
|
||||
isEmpty(includes): includes = $$eval($${spfx}.includedir)
|
||||
!isEmpty(includes): qtConfOutputVar(assign, $$output, QMAKE_INCDIR_$$NAME, $$includes)
|
||||
}
|
||||
uses = $$eval($${lpfx}.dependencies)
|
||||
!isEmpty(uses) {
|
||||
# FIXME: ideally, we would export transitive deps only for static
|
||||
|
@ -60,8 +60,12 @@ defineReplace(qtExportLibsForModule) {
|
||||
QMAKE_LIBS_$$NAME QMAKE_LIBS_$${NAME}_DEBUG QMAKE_LIBS_$${NAME}_RELEASE \
|
||||
QMAKE_DEFINES_$$NAME QMAKE_INCDIR_$$NAME
|
||||
for (var, vars) {
|
||||
defined($$var, var): \
|
||||
result += "$$var = $$val_escape($$var)"
|
||||
expvar = $$var
|
||||
expvar ~= s/^QMAKE_/QMAKE_EXPORT_/
|
||||
defined($$expvar, var):equals($$expvar, -): next()
|
||||
!defined($$expvar, var): expvar = $$var
|
||||
defined($$expvar, var): \
|
||||
result += "$$var = $$val_escape($$expvar)"
|
||||
}
|
||||
}
|
||||
return($$result)
|
||||
|
8
mkspecs/features/win32/windows_vulkan_sdk.prf
Normal file
8
mkspecs/features/win32/windows_vulkan_sdk.prf
Normal file
@ -0,0 +1,8 @@
|
||||
isEmpty(QMAKE_INCDIR_VULKAN) {
|
||||
# Pick up the VULKAN_SDK env var set by the LunarG SDK so that the Vulkan
|
||||
# headers are found out-of-the-box on typical Windows setups.
|
||||
QMAKE_INCDIR_VULKAN = $$(VULKAN_SDK)\\include
|
||||
|
||||
# Do not export the include dir but resolve it on every qmake call.
|
||||
QMAKE_EXPORT_INCDIR_VULKAN = -
|
||||
}
|
@ -4567,7 +4567,10 @@
|
||||
\c QMAKEFEATURES environment variable)
|
||||
\li \c $$QMAKEFEATURES/myfeatures.prf (for each directory listed in the
|
||||
\c QMAKEFEATURES property variable)
|
||||
\li \c myfeatures.prf (in the project's root directory)
|
||||
\li \c myfeatures.prf (in the project's root directory). The project root
|
||||
is determined by the top-level \c{.pro} file. However, if you place the
|
||||
\c{.qmake.cache} file in a sub-directory or the directory of a
|
||||
sub-project, then the project root becomes the sub-directory itself.
|
||||
\li \c $QMAKEPATH/mkspecs/features/unix/myfeatures.prf and
|
||||
\c $QMAKEPATH/mkspecs/features/myfeatures.prf (for each directory
|
||||
listed in the \c QMAKEPATH environment variable)
|
||||
|
66
src/3rdparty/libpng/ANNOUNCE
vendored
66
src/3rdparty/libpng/ANNOUNCE
vendored
@ -1,5 +1,5 @@
|
||||
libpng 1.6.36 - December 1, 2018
|
||||
================================
|
||||
libpng 1.6.37 - April 14, 2019
|
||||
==============================
|
||||
|
||||
This is a public release of libpng, intended for use in production code.
|
||||
|
||||
@ -9,13 +9,13 @@ Files available for download
|
||||
|
||||
Source files with LF line endings (for Unix/Linux):
|
||||
|
||||
* libpng-1.6.36.tar.xz (LZMA-compressed, recommended)
|
||||
* libpng-1.6.36.tar.gz
|
||||
* libpng-1.6.37.tar.xz (LZMA-compressed, recommended)
|
||||
* libpng-1.6.37.tar.gz
|
||||
|
||||
Source files with CRLF line endings (for Windows):
|
||||
|
||||
* lp1636.7z (LZMA-compressed, recommended)
|
||||
* lp1636.zip
|
||||
* lp1637.7z (LZMA-compressed, recommended)
|
||||
* lp1637.zip
|
||||
|
||||
Other information:
|
||||
|
||||
@ -25,50 +25,20 @@ Other information:
|
||||
* TRADEMARK.md
|
||||
|
||||
|
||||
IMPORTANT licensing update: libpng license v2
|
||||
---------------------------------------------
|
||||
|
||||
The new libpng license comprises the terms and conditions from the zlib
|
||||
license, and the disclaimer from the Boost license.
|
||||
|
||||
The legacy libpng license, used until libpng-1.6.35, is appended to the
|
||||
new license, following the precedent established in the Python Software
|
||||
Foundation License version 2.
|
||||
|
||||
From now on, the list of contributing authors shall be maintained in a
|
||||
separate AUTHORS file. The lists of previous contributing authors,
|
||||
mentioned in the legacy libpng license and considered to be an integral
|
||||
part of that license, are kept intact, with no further updates.
|
||||
|
||||
|
||||
Changes since the previous public release (version 1.6.35)
|
||||
Changes since the previous public release (version 1.6.36)
|
||||
----------------------------------------------------------
|
||||
|
||||
* Optimized png_do_expand_palette for ARM processors.
|
||||
Improved performance by around 10-22% on a recent ARM Chromebook.
|
||||
(Contributed by Richard Townsend, ARM Holdings)
|
||||
* Fixed manipulation of machine-specific optimization options.
|
||||
(Contributed by Vicki Pfau)
|
||||
* Used memcpy instead of manual pointer arithmetic on Intel SSE2.
|
||||
(Contributed by Samuel Williams)
|
||||
* Fixed build errors with MSVC on ARM64.
|
||||
(Contributed by Zhijie Liang)
|
||||
* Fixed detection of libm in CMakeLists.
|
||||
(Contributed by Cameron Cawley)
|
||||
* Fixed incorrect creation of pkg-config file in CMakeLists.
|
||||
(Contributed by Kyle Bentley)
|
||||
* Fixed the CMake build on Windows MSYS by avoiding symlinks.
|
||||
* Fixed a build warning on OpenBSD.
|
||||
(Contributed by Theo Buehler)
|
||||
* Fixed various typos in comments.
|
||||
(Contributed by "luz.paz")
|
||||
* Raised the minimum required CMake version from 3.0.2 to 3.1.
|
||||
* Removed yet more of the vestigial support for pre-ANSI C compilers.
|
||||
* Removed ancient makefiles for ancient systems that have been broken
|
||||
across all previous libpng-1.6.x versions.
|
||||
* Removed the Y2K compliance statement and the export control
|
||||
information.
|
||||
* Applied various code style and documentation fixes.
|
||||
* Fixed a use-after-free vulnerability (CVE-2019-7317) in png_image_free.
|
||||
* Fixed a memory leak in the ARM NEON implementation of png_do_expand_palette.
|
||||
* Fixed a memory leak in pngtest.c.
|
||||
* Fixed two vulnerabilities (CVE-2018-14048, CVE-2018-14550) in
|
||||
contrib/pngminus; refactor.
|
||||
* Changed the license of contrib/pngminus to MIT; refresh makefile and docs.
|
||||
(Contributed by Willem van Schaik)
|
||||
* Fixed a typo in the libpng license v2.
|
||||
(Contributed by Miguel Ojeda)
|
||||
* Added makefiles for AddressSanitizer-enabled builds.
|
||||
* Cleaned up various makefiles.
|
||||
|
||||
|
||||
Send comments/corrections/commendations to png-mng-implement at lists.sf.net.
|
||||
|
39
src/3rdparty/libpng/CHANGES
vendored
39
src/3rdparty/libpng/CHANGES
vendored
@ -6066,31 +6066,44 @@ Version 1.6.35 [July 15, 2018]
|
||||
Version 1.6.36 [December 1, 2018]
|
||||
Optimized png_do_expand_palette for ARM processors.
|
||||
Improved performance by around 10-22% on a recent ARM Chromebook.
|
||||
(Contributed by Richard Townsend, ARM Holdings)
|
||||
(Contributed by Richard Townsend, ARM Holdings)
|
||||
Fixed manipulation of machine-specific optimization options.
|
||||
(Contributed by Vicki Pfau)
|
||||
(Contributed by Vicki Pfau)
|
||||
Used memcpy instead of manual pointer arithmetic on Intel SSE2.
|
||||
(Contributed by Samuel Williams)
|
||||
(Contributed by Samuel Williams)
|
||||
Fixed build errors with MSVC on ARM64.
|
||||
(Contributed by Zhijie Liang)
|
||||
(Contributed by Zhijie Liang)
|
||||
Fixed detection of libm in CMakeLists.
|
||||
(Contributed by Cameron Cawley)
|
||||
(Contributed by Cameron Cawley)
|
||||
Fixed incorrect creation of pkg-config file in CMakeLists.
|
||||
(Contributed by Kyle Bentley)
|
||||
(Contributed by Kyle Bentley)
|
||||
Fixed the CMake build on Windows MSYS by avoiding symlinks.
|
||||
Fixed a build warning on OpenBSD.
|
||||
(Contributed by Theo Buehler)
|
||||
(Contributed by Theo Buehler)
|
||||
Fixed various typos in comments.
|
||||
(Contributed by "luz.paz")
|
||||
(Contributed by "luz.paz")
|
||||
Raised the minimum required CMake version from 3.0.2 to 3.1.
|
||||
Removed yet more of the vestigial support for pre-ANSI C compilers.
|
||||
Removed ancient makefiles for ancient systems that have been broken
|
||||
across all previous libpng-1.6.x versions.
|
||||
across all previous libpng-1.6.x versions.
|
||||
Removed the Y2K compliance statement and the export control
|
||||
information.
|
||||
information.
|
||||
Applied various code style and documentation fixes.
|
||||
|
||||
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
|
||||
(subscription required; visit
|
||||
Version 1.6.37 [April 14, 2019]
|
||||
Fixed a use-after-free vulnerability (CVE-2019-7317) in png_image_free.
|
||||
Fixed a memory leak in the ARM NEON implementation of png_do_expand_palette.
|
||||
Fixed a memory leak in pngtest.c.
|
||||
Fixed two vulnerabilities (CVE-2018-14048, CVE-2018-14550) in
|
||||
contrib/pngminus; refactor.
|
||||
Changed the license of contrib/pngminus to MIT; refresh makefile and docs.
|
||||
(Contributed by Willem van Schaik)
|
||||
Fixed a typo in the libpng license v2.
|
||||
(Contributed by Miguel Ojeda)
|
||||
Added makefiles for AddressSanitizer-enabled builds.
|
||||
Cleaned up various makefiles.
|
||||
|
||||
Send comments/corrections/commendations to png-mng-implement at lists.sf.net.
|
||||
Subscription is required; visit
|
||||
https://lists.sourceforge.net/lists/listinfo/png-mng-implement
|
||||
to subscribe).
|
||||
to subscribe.
|
||||
|
8
src/3rdparty/libpng/LICENSE
vendored
8
src/3rdparty/libpng/LICENSE
vendored
@ -4,8 +4,8 @@ COPYRIGHT NOTICE, DISCLAIMER, and LICENSE
|
||||
PNG Reference Library License version 2
|
||||
---------------------------------------
|
||||
|
||||
* Copyright (c) 1995-2018 The PNG Reference Library Authors.
|
||||
* Copyright (c) 2018 Cosmin Truta.
|
||||
* Copyright (c) 1995-2019 The PNG Reference Library Authors.
|
||||
* Copyright (c) 2018-2019 Cosmin Truta.
|
||||
* Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson.
|
||||
* Copyright (c) 1996-1997 Andreas Dilger.
|
||||
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
@ -13,7 +13,7 @@ PNG Reference Library License version 2
|
||||
The software is supplied "as is", without warranty of any kind,
|
||||
express or implied, including, without limitation, the warranties
|
||||
of merchantability, fitness for a particular purpose, title, and
|
||||
non-infringement. In no even shall the Copyright owners, or
|
||||
non-infringement. In no event shall the Copyright owners, or
|
||||
anyone distributing the software, be liable for any damages or
|
||||
other liability, whether in contract, tort or otherwise, arising
|
||||
from, out of, or in connection with the software, or the use or
|
||||
@ -39,7 +39,7 @@ subject to the following restrictions:
|
||||
PNG Reference Library License version 1 (for libpng 0.5 through 1.6.35)
|
||||
-----------------------------------------------------------------------
|
||||
|
||||
libpng versions 1.0.7, July 1, 2000 through 1.6.35, July 15, 2018 are
|
||||
libpng versions 1.0.7, July 1, 2000, through 1.6.35, July 15, 2018 are
|
||||
Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson, are
|
||||
derived from libpng-1.0.6, and are distributed according to the same
|
||||
disclaimer and license as libpng-1.0.6 with the following individuals
|
||||
|
4
src/3rdparty/libpng/README
vendored
4
src/3rdparty/libpng/README
vendored
@ -1,5 +1,5 @@
|
||||
README for libpng version 1.6.36 - December 1, 2018
|
||||
===================================================
|
||||
README for libpng version 1.6.37 - April 14, 2019
|
||||
=================================================
|
||||
|
||||
See the note about version numbers near the top of png.h.
|
||||
See INSTALL for instructions on how to install libpng.
|
||||
|
8
src/3rdparty/libpng/libpng-manual.txt
vendored
8
src/3rdparty/libpng/libpng-manual.txt
vendored
@ -1,6 +1,6 @@
|
||||
libpng-manual.txt - A description on how to use and modify libpng
|
||||
|
||||
Copyright (c) 2018 Cosmin Truta
|
||||
Copyright (c) 2018-2019 Cosmin Truta
|
||||
Copyright (c) 1998-2018 Glenn Randers-Pehrson
|
||||
|
||||
This document is released under the libpng license.
|
||||
@ -9,11 +9,11 @@ libpng-manual.txt - A description on how to use and modify libpng
|
||||
|
||||
Based on:
|
||||
|
||||
libpng version 1.6.36 - December 1, 2018
|
||||
libpng version 1.6.36, December 2018, through 1.6.37 - April 2019
|
||||
Updated and distributed by Cosmin Truta
|
||||
Copyright (c) 2018 Cosmin Truta
|
||||
Copyright (c) 2018-2019 Cosmin Truta
|
||||
|
||||
libpng versions 0.97, January 1998, through 1.6.35 - July 15, 2018
|
||||
libpng versions 0.97, January 1998, through 1.6.35 - July 2018
|
||||
Updated and distributed by Glenn Randers-Pehrson
|
||||
Copyright (c) 1998-2018 Glenn Randers-Pehrson
|
||||
|
||||
|
11
src/3rdparty/libpng/png.c
vendored
11
src/3rdparty/libpng/png.c
vendored
@ -1,7 +1,7 @@
|
||||
|
||||
/* png.c - location for general purpose libpng functions
|
||||
*
|
||||
* Copyright (c) 2018 Cosmin Truta
|
||||
* Copyright (c) 2018-2019 Cosmin Truta
|
||||
* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
|
||||
* Copyright (c) 1996-1997 Andreas Dilger
|
||||
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
@ -14,7 +14,7 @@
|
||||
#include "pngpriv.h"
|
||||
|
||||
/* Generate a compiler error if there is an old png.h in the search path. */
|
||||
typedef png_libpng_version_1_6_36 Your_png_h_is_not_version_1_6_36;
|
||||
typedef png_libpng_version_1_6_37 Your_png_h_is_not_version_1_6_37;
|
||||
|
||||
#ifdef __GNUC__
|
||||
/* The version tests may need to be added to, but the problem warning has
|
||||
@ -815,8 +815,8 @@ png_get_copyright(png_const_structrp png_ptr)
|
||||
return PNG_STRING_COPYRIGHT
|
||||
#else
|
||||
return PNG_STRING_NEWLINE \
|
||||
"libpng version 1.6.36" PNG_STRING_NEWLINE \
|
||||
"Copyright (c) 2018 Cosmin Truta" PNG_STRING_NEWLINE \
|
||||
"libpng version 1.6.37" PNG_STRING_NEWLINE \
|
||||
"Copyright (c) 2018-2019 Cosmin Truta" PNG_STRING_NEWLINE \
|
||||
"Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson" \
|
||||
PNG_STRING_NEWLINE \
|
||||
"Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \
|
||||
@ -4588,8 +4588,7 @@ png_image_free(png_imagep image)
|
||||
if (image != NULL && image->opaque != NULL &&
|
||||
image->opaque->error_buf == NULL)
|
||||
{
|
||||
/* Ignore errors here: */
|
||||
(void)png_safe_execute(image, png_image_free_function, image);
|
||||
png_image_free_function(image);
|
||||
image->opaque = NULL;
|
||||
}
|
||||
}
|
||||
|
34
src/3rdparty/libpng/png.h
vendored
34
src/3rdparty/libpng/png.h
vendored
@ -1,9 +1,9 @@
|
||||
|
||||
/* png.h - header file for PNG reference library
|
||||
*
|
||||
* libpng version 1.6.36 - December 1, 2018
|
||||
* libpng version 1.6.37 - April 14, 2019
|
||||
*
|
||||
* Copyright (c) 2018 Cosmin Truta
|
||||
* Copyright (c) 2018-2019 Cosmin Truta
|
||||
* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
|
||||
* Copyright (c) 1996-1997 Andreas Dilger
|
||||
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
@ -14,8 +14,9 @@
|
||||
* libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat
|
||||
* libpng versions 0.89, June 1996, through 0.96, May 1997: Andreas Dilger
|
||||
* libpng versions 0.97, January 1998, through 1.6.35, July 2018:
|
||||
* Glenn Randers-Pehrson.
|
||||
* libpng version 1.6.36, December 1, 2018: Cosmin Truta
|
||||
* Glenn Randers-Pehrson
|
||||
* libpng versions 1.6.36, December 2018, through 1.6.37, April 2019:
|
||||
* Cosmin Truta
|
||||
* See also "Contributing Authors", below.
|
||||
*/
|
||||
|
||||
@ -26,8 +27,8 @@
|
||||
* PNG Reference Library License version 2
|
||||
* ---------------------------------------
|
||||
*
|
||||
* * Copyright (c) 1995-2018 The PNG Reference Library Authors.
|
||||
* * Copyright (c) 2018 Cosmin Truta.
|
||||
* * Copyright (c) 1995-2019 The PNG Reference Library Authors.
|
||||
* * Copyright (c) 2018-2019 Cosmin Truta.
|
||||
* * Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson.
|
||||
* * Copyright (c) 1996-1997 Andreas Dilger.
|
||||
* * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
@ -35,7 +36,7 @@
|
||||
* The software is supplied "as is", without warranty of any kind,
|
||||
* express or implied, including, without limitation, the warranties
|
||||
* of merchantability, fitness for a particular purpose, title, and
|
||||
* non-infringement. In no even shall the Copyright owners, or
|
||||
* non-infringement. In no event shall the Copyright owners, or
|
||||
* anyone distributing the software, be liable for any damages or
|
||||
* other liability, whether in contract, tort or otherwise, arising
|
||||
* from, out of, or in connection with the software, or the use or
|
||||
@ -61,7 +62,7 @@
|
||||
* PNG Reference Library License version 1 (for libpng 0.5 through 1.6.35)
|
||||
* -----------------------------------------------------------------------
|
||||
*
|
||||
* libpng versions 1.0.7, July 1, 2000 through 1.6.35, July 15, 2018 are
|
||||
* libpng versions 1.0.7, July 1, 2000, through 1.6.35, July 15, 2018 are
|
||||
* Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson, are
|
||||
* derived from libpng-1.0.6, and are distributed according to the same
|
||||
* disclaimer and license as libpng-1.0.6 with the following individuals
|
||||
@ -238,7 +239,7 @@
|
||||
* ...
|
||||
* 1.5.30 15 10530 15.so.15.30[.0]
|
||||
* ...
|
||||
* 1.6.36 16 10636 16.so.16.36[.0]
|
||||
* 1.6.37 16 10637 16.so.16.37[.0]
|
||||
*
|
||||
* Henceforth the source version will match the shared-library major and
|
||||
* minor numbers; the shared-library major version number will be used for
|
||||
@ -277,8 +278,8 @@
|
||||
*/
|
||||
|
||||
/* Version information for png.h - this should match the version in png.c */
|
||||
#define PNG_LIBPNG_VER_STRING "1.6.36"
|
||||
#define PNG_HEADER_VERSION_STRING " libpng version 1.6.36 - December 1, 2018\n"
|
||||
#define PNG_LIBPNG_VER_STRING "1.6.37"
|
||||
#define PNG_HEADER_VERSION_STRING " libpng version 1.6.37 - April 14, 2019\n"
|
||||
|
||||
#define PNG_LIBPNG_VER_SONUM 16
|
||||
#define PNG_LIBPNG_VER_DLLNUM 16
|
||||
@ -286,12 +287,11 @@
|
||||
/* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */
|
||||
#define PNG_LIBPNG_VER_MAJOR 1
|
||||
#define PNG_LIBPNG_VER_MINOR 6
|
||||
#define PNG_LIBPNG_VER_RELEASE 36
|
||||
#define PNG_LIBPNG_VER_RELEASE 37
|
||||
|
||||
/* This should match the numeric part of the final component of
|
||||
* PNG_LIBPNG_VER_STRING, omitting any leading zero:
|
||||
/* This should be zero for a public release, or non-zero for a
|
||||
* development version. [Deprecated]
|
||||
*/
|
||||
|
||||
#define PNG_LIBPNG_VER_BUILD 0
|
||||
|
||||
/* Release Status */
|
||||
@ -318,7 +318,7 @@
|
||||
* From version 1.0.1 it is:
|
||||
* XXYYZZ, where XX=major, YY=minor, ZZ=release
|
||||
*/
|
||||
#define PNG_LIBPNG_VER 10636 /* 1.6.36 */
|
||||
#define PNG_LIBPNG_VER 10637 /* 1.6.37 */
|
||||
|
||||
/* Library configuration: these options cannot be changed after
|
||||
* the library has been built.
|
||||
@ -428,7 +428,7 @@ extern "C" {
|
||||
/* This triggers a compiler error in png.c, if png.c and png.h
|
||||
* do not agree upon the version number.
|
||||
*/
|
||||
typedef char* png_libpng_version_1_6_36;
|
||||
typedef char* png_libpng_version_1_6_37;
|
||||
|
||||
/* Basic control structions. Read libpng-manual.txt or libpng.3 for more info.
|
||||
*
|
||||
|
6
src/3rdparty/libpng/pngconf.h
vendored
6
src/3rdparty/libpng/pngconf.h
vendored
@ -1,9 +1,9 @@
|
||||
|
||||
/* pngconf.h - machine configurable file for libpng
|
||||
/* pngconf.h - machine-configurable file for libpng
|
||||
*
|
||||
* libpng version 1.6.36
|
||||
* libpng version 1.6.37
|
||||
*
|
||||
* Copyright (c) 2018 Cosmin Truta
|
||||
* Copyright (c) 2018-2019 Cosmin Truta
|
||||
* Copyright (c) 1998-2002,2004,2006-2016,2018 Glenn Randers-Pehrson
|
||||
* Copyright (c) 1996-1997 Andreas Dilger
|
||||
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
|
4
src/3rdparty/libpng/pnglibconf.h
vendored
4
src/3rdparty/libpng/pnglibconf.h
vendored
@ -1,8 +1,8 @@
|
||||
/* pnglibconf.h - library build configuration */
|
||||
|
||||
/* libpng version 1.6.36 */
|
||||
/* libpng version 1.6.37 */
|
||||
|
||||
/* Copyright (c) 2018 Cosmin Truta */
|
||||
/* Copyright (c) 2018-2019 Cosmin Truta */
|
||||
/* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson */
|
||||
|
||||
/* This code is released under the libpng license. */
|
||||
|
10
src/3rdparty/libpng/pngpriv.h
vendored
10
src/3rdparty/libpng/pngpriv.h
vendored
@ -1,7 +1,7 @@
|
||||
|
||||
/* pngpriv.h - private declarations for use inside libpng
|
||||
*
|
||||
* Copyright (c) 2018 Cosmin Truta
|
||||
* Copyright (c) 2018-2019 Cosmin Truta
|
||||
* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
|
||||
* Copyright (c) 1996-1997 Andreas Dilger
|
||||
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
@ -2133,11 +2133,11 @@ PNG_INTERNAL_FUNCTION(png_uint_32, png_check_keyword, (png_structrp png_ptr,
|
||||
|
||||
#if PNG_ARM_NEON_IMPLEMENTATION == 1
|
||||
PNG_INTERNAL_FUNCTION(void,
|
||||
png_riffle_palette_rgba,
|
||||
(png_structrp, png_row_infop),
|
||||
png_riffle_palette_neon,
|
||||
(png_structrp),
|
||||
PNG_EMPTY);
|
||||
PNG_INTERNAL_FUNCTION(int,
|
||||
png_do_expand_palette_neon_rgba,
|
||||
png_do_expand_palette_rgba8_neon,
|
||||
(png_structrp,
|
||||
png_row_infop,
|
||||
png_const_bytep,
|
||||
@ -2145,7 +2145,7 @@ PNG_INTERNAL_FUNCTION(int,
|
||||
const png_bytepp),
|
||||
PNG_EMPTY);
|
||||
PNG_INTERNAL_FUNCTION(int,
|
||||
png_do_expand_palette_neon_rgb,
|
||||
png_do_expand_palette_rgb8_neon,
|
||||
(png_structrp,
|
||||
png_row_infop,
|
||||
png_const_bytep,
|
||||
|
8
src/3rdparty/libpng/pngread.c
vendored
8
src/3rdparty/libpng/pngread.c
vendored
@ -1,7 +1,7 @@
|
||||
|
||||
/* pngread.c - read a PNG file
|
||||
*
|
||||
* Copyright (c) 2018 Cosmin Truta
|
||||
* Copyright (c) 2018-2019 Cosmin Truta
|
||||
* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
|
||||
* Copyright (c) 1996-1997 Andreas Dilger
|
||||
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
@ -994,6 +994,12 @@ png_read_destroy(png_structrp png_ptr)
|
||||
png_ptr->chunk_list = NULL;
|
||||
#endif
|
||||
|
||||
#if defined(PNG_READ_EXPAND_SUPPORTED) && \
|
||||
defined(PNG_ARM_NEON_IMPLEMENTATION)
|
||||
png_free(png_ptr, png_ptr->riffled_palette);
|
||||
png_ptr->riffled_palette = NULL;
|
||||
#endif
|
||||
|
||||
/* NOTE: the 'setjmp' buffer may still be allocated and the memory and error
|
||||
* callbacks are still set at this point. They are required to complete the
|
||||
* destruction of the png_struct itself.
|
||||
|
48
src/3rdparty/libpng/pngrtran.c
vendored
48
src/3rdparty/libpng/pngrtran.c
vendored
@ -1,7 +1,7 @@
|
||||
|
||||
/* pngrtran.c - transforms the data in a row for PNG readers
|
||||
*
|
||||
* Copyright (c) 2018 Cosmin Truta
|
||||
* Copyright (c) 2018-2019 Cosmin Truta
|
||||
* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
|
||||
* Copyright (c) 1996-1997 Andreas Dilger
|
||||
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
@ -1182,20 +1182,20 @@ png_init_palette_transformations(png_structrp png_ptr)
|
||||
png_ptr->palette[png_ptr->background.index].blue;
|
||||
|
||||
#ifdef PNG_READ_INVERT_ALPHA_SUPPORTED
|
||||
if ((png_ptr->transformations & PNG_INVERT_ALPHA) != 0)
|
||||
{
|
||||
if ((png_ptr->transformations & PNG_EXPAND_tRNS) == 0)
|
||||
{
|
||||
/* Invert the alpha channel (in tRNS) unless the pixels are
|
||||
* going to be expanded, in which case leave it for later
|
||||
*/
|
||||
int i, istop = png_ptr->num_trans;
|
||||
if ((png_ptr->transformations & PNG_INVERT_ALPHA) != 0)
|
||||
{
|
||||
if ((png_ptr->transformations & PNG_EXPAND_tRNS) == 0)
|
||||
{
|
||||
/* Invert the alpha channel (in tRNS) unless the pixels are
|
||||
* going to be expanded, in which case leave it for later
|
||||
*/
|
||||
int i, istop = png_ptr->num_trans;
|
||||
|
||||
for (i=0; i<istop; i++)
|
||||
png_ptr->trans_alpha[i] = (png_byte)(255 -
|
||||
png_ptr->trans_alpha[i]);
|
||||
}
|
||||
}
|
||||
for (i = 0; i < istop; i++)
|
||||
png_ptr->trans_alpha[i] =
|
||||
(png_byte)(255 - png_ptr->trans_alpha[i]);
|
||||
}
|
||||
}
|
||||
#endif /* READ_INVERT_ALPHA */
|
||||
}
|
||||
} /* background expand and (therefore) no alpha association. */
|
||||
@ -4320,9 +4320,11 @@ png_do_expand_palette(png_structrp png_ptr, png_row_infop row_info,
|
||||
* but sometimes row_info->bit_depth has been changed to 8.
|
||||
* In these cases, the palette hasn't been riffled.
|
||||
*/
|
||||
i = png_do_expand_palette_neon_rgba(png_ptr, row_info, row,
|
||||
i = png_do_expand_palette_rgba8_neon(png_ptr, row_info, row,
|
||||
&sp, &dp);
|
||||
}
|
||||
#else
|
||||
PNG_UNUSED(png_ptr)
|
||||
#endif
|
||||
|
||||
for (; i < row_width; i++)
|
||||
@ -4349,8 +4351,10 @@ png_do_expand_palette(png_structrp png_ptr, png_row_infop row_info,
|
||||
dp = row + (size_t)(row_width * 3) - 1;
|
||||
i = 0;
|
||||
#ifdef PNG_ARM_NEON_INTRINSICS_AVAILABLE
|
||||
i = png_do_expand_palette_neon_rgb(png_ptr, row_info, row,
|
||||
i = png_do_expand_palette_rgb8_neon(png_ptr, row_info, row,
|
||||
&sp, &dp);
|
||||
#else
|
||||
PNG_UNUSED(png_ptr)
|
||||
#endif
|
||||
|
||||
for (; i < row_width; i++)
|
||||
@ -4770,19 +4774,17 @@ png_do_read_transformations(png_structrp png_ptr, png_row_infop row_info)
|
||||
#ifdef PNG_ARM_NEON_INTRINSICS_AVAILABLE
|
||||
if ((png_ptr->num_trans > 0) && (png_ptr->bit_depth == 8))
|
||||
{
|
||||
/* Allocate space for the decompressed full palette. */
|
||||
if (png_ptr->riffled_palette == NULL)
|
||||
{
|
||||
png_ptr->riffled_palette = png_malloc(png_ptr, 256*4);
|
||||
if (png_ptr->riffled_palette == NULL)
|
||||
png_error(png_ptr, "NULL row buffer");
|
||||
/* Build the RGBA palette. */
|
||||
png_riffle_palette_rgba(png_ptr, row_info);
|
||||
/* Initialize the accelerated palette expansion. */
|
||||
png_ptr->riffled_palette =
|
||||
(png_bytep)png_malloc(png_ptr, 256 * 4);
|
||||
png_riffle_palette_neon(png_ptr);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
png_do_expand_palette(png_ptr, row_info, png_ptr->row_buf + 1,
|
||||
png_ptr->palette, png_ptr->trans_alpha, png_ptr->num_trans);
|
||||
png_ptr->palette, png_ptr->trans_alpha, png_ptr->num_trans);
|
||||
}
|
||||
|
||||
else
|
||||
|
12
src/3rdparty/libpng/pngstruct.h
vendored
12
src/3rdparty/libpng/pngstruct.h
vendored
@ -1,7 +1,7 @@
|
||||
|
||||
/* pngstruct.h - header file for PNG reference library
|
||||
*
|
||||
* Copyright (c) 2018 Cosmin Truta
|
||||
* Copyright (c) 2018-2019 Cosmin Truta
|
||||
* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
|
||||
* Copyright (c) 1996-1997 Andreas Dilger
|
||||
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
@ -228,10 +228,6 @@ struct png_struct_def
|
||||
* big_row_buf; while writing it is separately
|
||||
* allocated.
|
||||
*/
|
||||
#ifdef PNG_READ_EXPAND_SUPPORTED
|
||||
/* Buffer to accelerate palette transformations. */
|
||||
png_bytep riffled_palette;
|
||||
#endif
|
||||
#ifdef PNG_WRITE_FILTER_SUPPORTED
|
||||
png_bytep try_row; /* buffer to save trial row when filtering */
|
||||
png_bytep tst_row; /* buffer to save best trial row when filtering */
|
||||
@ -396,6 +392,12 @@ struct png_struct_def
|
||||
/* deleted in 1.5.5: rgb_to_gray_blue_coeff; */
|
||||
#endif
|
||||
|
||||
/* New member added in libpng-1.6.36 */
|
||||
#if defined(PNG_READ_EXPAND_SUPPORTED) && \
|
||||
defined(PNG_ARM_NEON_IMPLEMENTATION)
|
||||
png_bytep riffled_palette; /* buffer for accelerated palette expansion */
|
||||
#endif
|
||||
|
||||
/* New member added in libpng-1.0.4 (renamed in 1.0.9) */
|
||||
#if defined(PNG_MNG_FEATURES_SUPPORTED)
|
||||
/* Changed from png_byte to png_uint_32 at version 1.2.0 */
|
||||
|
6
src/3rdparty/libpng/pngwrite.c
vendored
6
src/3rdparty/libpng/pngwrite.c
vendored
@ -1,7 +1,7 @@
|
||||
|
||||
/* pngwrite.c - general routines to write a PNG file
|
||||
*
|
||||
* Copyright (c) 2018 Cosmin Truta
|
||||
* Copyright (c) 2018-2019 Cosmin Truta
|
||||
* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
|
||||
* Copyright (c) 1996-1997 Andreas Dilger
|
||||
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
@ -948,10 +948,6 @@ png_write_destroy(png_structrp png_ptr)
|
||||
png_free_buffer_list(png_ptr, &png_ptr->zbuffer_list);
|
||||
png_free(png_ptr, png_ptr->row_buf);
|
||||
png_ptr->row_buf = NULL;
|
||||
#ifdef PNG_READ_EXPANDED_SUPPORTED
|
||||
png_free(png_ptr, png_ptr->riffled_palette);
|
||||
png_ptr->riffled_palette = NULL;
|
||||
#endif
|
||||
#ifdef PNG_WRITE_FILTER_SUPPORTED
|
||||
png_free(png_ptr, png_ptr->prev_row);
|
||||
png_free(png_ptr, png_ptr->try_row);
|
||||
|
4
src/3rdparty/libpng/qt_attribution.json
vendored
4
src/3rdparty/libpng/qt_attribution.json
vendored
@ -6,7 +6,7 @@
|
||||
|
||||
"Description": "libpng is the official PNG reference library.",
|
||||
"Homepage": "http://www.libpng.org/pub/png/libpng.html",
|
||||
"Version": "1.6.36",
|
||||
"Version": "1.6.37",
|
||||
"License": "libpng License and libpng License 2",
|
||||
"LicenseId": "Libpng AND Libpng2",
|
||||
"LicenseFile": "LICENSE",
|
||||
@ -14,7 +14,7 @@
|
||||
Copyright (c) 2000-2017 Simon-Pierre Cadieux
|
||||
Copyright (c) 2000-2017 Eric S. Raymond
|
||||
Copyright (c) 2000-2017 Mans Rullgard
|
||||
Copyright (c) 2000-2017 Cosmin Truta
|
||||
Copyright (c) 2000-2019 Cosmin Truta
|
||||
Copyright (c) 2000-2017 Gilles Vollant
|
||||
Copyright (c) 2000-2017 James Yu
|
||||
Copyright (c) 2000-2017 Mandar Sahastrabuddhe
|
||||
|
8
src/3rdparty/libpng/qtpatches.diff
vendored
8
src/3rdparty/libpng/qtpatches.diff
vendored
@ -1,5 +1,5 @@
|
||||
diff --git a/src/3rdparty/libpng/pngpriv.h b/src/3rdparty/libpng/pngpriv.h
|
||||
index 3581f67919..e43862a886 100644
|
||||
index 583c26f9bd..2ab9b70d73 100644
|
||||
--- a/src/3rdparty/libpng/pngpriv.h
|
||||
+++ b/src/3rdparty/libpng/pngpriv.h
|
||||
@@ -23,6 +23,12 @@
|
||||
@ -15,7 +15,7 @@ index 3581f67919..e43862a886 100644
|
||||
/* Feature Test Macros. The following are defined here to ensure that correctly
|
||||
* implemented libraries reveal the APIs libpng needs to build and hide those
|
||||
* that are not needed and potentially damaging to the compilation.
|
||||
@@ -305,6 +311,11 @@
|
||||
@@ -308,6 +314,11 @@
|
||||
# endif
|
||||
#endif /* Setting PNG_BUILD_DLL if required */
|
||||
|
||||
@ -27,7 +27,7 @@ index 3581f67919..e43862a886 100644
|
||||
/* See pngconf.h for more details: the builder of the library may set this on
|
||||
* the command line to the right thing for the specific compilation system or it
|
||||
* may be automagically set above (at present we know of no system where it does
|
||||
@@ -543,6 +554,9 @@
|
||||
@@ -546,6 +557,9 @@
|
||||
#if defined(WIN32) || defined(_Windows) || defined(_WINDOWS) || \
|
||||
defined(_WIN32) || defined(__WIN32__)
|
||||
# include <windows.h> /* defines _WINDOWS_ macro */
|
||||
@ -37,7 +37,7 @@ index 3581f67919..e43862a886 100644
|
||||
#endif
|
||||
#endif /* PNG_VERSION_INFO_ONLY */
|
||||
|
||||
@@ -553,7 +567,7 @@
|
||||
@@ -556,7 +570,7 @@
|
||||
|
||||
/* Memory model/platform independent fns */
|
||||
#ifndef PNG_ABORT
|
||||
|
6
src/3rdparty/pcre2/AUTHORS
vendored
6
src/3rdparty/pcre2/AUTHORS
vendored
@ -8,7 +8,7 @@ Email domain: cam.ac.uk
|
||||
University of Cambridge Computing Service,
|
||||
Cambridge, England.
|
||||
|
||||
Copyright (c) 1997-2018 University of Cambridge
|
||||
Copyright (c) 1997-2019 University of Cambridge
|
||||
All rights reserved
|
||||
|
||||
|
||||
@ -19,7 +19,7 @@ Written by: Zoltan Herczeg
|
||||
Email local part: hzmester
|
||||
Emain domain: freemail.hu
|
||||
|
||||
Copyright(c) 2010-2018 Zoltan Herczeg
|
||||
Copyright(c) 2010-2019 Zoltan Herczeg
|
||||
All rights reserved.
|
||||
|
||||
|
||||
@ -30,7 +30,7 @@ Written by: Zoltan Herczeg
|
||||
Email local part: hzmester
|
||||
Emain domain: freemail.hu
|
||||
|
||||
Copyright(c) 2009-2018 Zoltan Herczeg
|
||||
Copyright(c) 2009-2019 Zoltan Herczeg
|
||||
All rights reserved.
|
||||
|
||||
####
|
||||
|
6
src/3rdparty/pcre2/LICENCE
vendored
6
src/3rdparty/pcre2/LICENCE
vendored
@ -26,7 +26,7 @@ Email domain: cam.ac.uk
|
||||
University of Cambridge Computing Service,
|
||||
Cambridge, England.
|
||||
|
||||
Copyright (c) 1997-2018 University of Cambridge
|
||||
Copyright (c) 1997-2019 University of Cambridge
|
||||
All rights reserved.
|
||||
|
||||
|
||||
@ -37,7 +37,7 @@ Written by: Zoltan Herczeg
|
||||
Email local part: hzmester
|
||||
Email domain: freemail.hu
|
||||
|
||||
Copyright(c) 2010-2018 Zoltan Herczeg
|
||||
Copyright(c) 2010-2019 Zoltan Herczeg
|
||||
All rights reserved.
|
||||
|
||||
|
||||
@ -48,7 +48,7 @@ Written by: Zoltan Herczeg
|
||||
Email local part: hzmester
|
||||
Email domain: freemail.hu
|
||||
|
||||
Copyright(c) 2009-2018 Zoltan Herczeg
|
||||
Copyright(c) 2009-2019 Zoltan Herczeg
|
||||
All rights reserved.
|
||||
|
||||
|
||||
|
@ -101,6 +101,7 @@ FILES="
|
||||
src/pcre2_newline.c
|
||||
src/pcre2_ord2utf.c
|
||||
src/pcre2_pattern_info.c
|
||||
src/pcre2_script_run.c
|
||||
src/pcre2_serialize.c
|
||||
src/pcre2_string_utils.c
|
||||
src/pcre2_study.c
|
||||
|
1
src/3rdparty/pcre2/pcre2.pro
vendored
1
src/3rdparty/pcre2/pcre2.pro
vendored
@ -36,6 +36,7 @@ SOURCES += \
|
||||
$$PWD/src/pcre2_newline.c \
|
||||
$$PWD/src/pcre2_ord2utf.c \
|
||||
$$PWD/src/pcre2_pattern_info.c \
|
||||
$$PWD/src/pcre2_script_run.c \
|
||||
$$PWD/src/pcre2_serialize.c \
|
||||
$$PWD/src/pcre2_string_utils.c \
|
||||
$$PWD/src/pcre2_study.c \
|
||||
|
18
src/3rdparty/pcre2/qt_attribution.json
vendored
18
src/3rdparty/pcre2/qt_attribution.json
vendored
@ -7,15 +7,13 @@
|
||||
|
||||
"Description": "The PCRE library is a set of functions that implement regular expression pattern matching using the same syntax and semantics as Perl 5.",
|
||||
"Homepage": "http://www.pcre.org/",
|
||||
"Version": "10.32",
|
||||
"DownloadLocation": "https://ftp.pcre.org/pub/pcre/pcre2-10.32.tar.bz2",
|
||||
"Version": "10.33",
|
||||
"DownloadLocation": "https://ftp.pcre.org/pub/pcre/pcre2-10.33.tar.bz2",
|
||||
"License": "BSD 3-clause \"New\" or \"Revised\" License",
|
||||
"LicenseId": "BSD-3-Clause",
|
||||
"LicenseFile": "LICENCE",
|
||||
"Copyright": "Copyright (c) 1997-2018 University of Cambridge
|
||||
Copyright (c) 2009-2018 Zoltan Herczeg
|
||||
Copyright (c) 2007-2012 Google Inc.
|
||||
Copyright (c) 2013-2013 Tilera Corporation (jiwang@tilera.com)"
|
||||
"Copyright": "Copyright (c) 1997-2019 University of Cambridge
|
||||
Copyright (c) 2010-2019 Zoltan Herczeg"
|
||||
},
|
||||
{
|
||||
"Id": "pcre2-sljit",
|
||||
@ -26,12 +24,12 @@ Copyright (c) 2013-2013 Tilera Corporation (jiwang@tilera.com)"
|
||||
"Path": "src/sljit",
|
||||
"Description": "The PCRE library is a set of functions that implement regular expression pattern matching using the same syntax and semantics as Perl 5.",
|
||||
"Homepage": "http://www.pcre.org/",
|
||||
"Version": "10.32",
|
||||
"DownloadLocation": "https://ftp.pcre.org/pub/pcre/pcre2-10.32.tar.bz2",
|
||||
"Version": "10.33",
|
||||
"DownloadLocation": "https://ftp.pcre.org/pub/pcre/pcre2-10.33.tar.bz2",
|
||||
"License": "BSD 2-clause \"Simplified\" License",
|
||||
"LicenseId": "BSD-2-Clause",
|
||||
"LicenseFile": "LICENCE-SLJIT",
|
||||
"Copyright": "Copyright (c) Zoltan Herczeg
|
||||
"LicenseFile": "LICENCE",
|
||||
"Copyright": "Copyright (c) 2009-2019 Zoltan Herczeg
|
||||
Copyright 2013-2013 Tilera Corporation(jiwang@tilera.com)"
|
||||
}
|
||||
]
|
||||
|
104
src/3rdparty/pcre2/src/pcre2.h
vendored
104
src/3rdparty/pcre2/src/pcre2.h
vendored
@ -42,15 +42,9 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||
/* The current PCRE version information. */
|
||||
|
||||
#define PCRE2_MAJOR 10
|
||||
#define PCRE2_MINOR 32
|
||||
#define PCRE2_MINOR 33
|
||||
#define PCRE2_PRERELEASE
|
||||
#define PCRE2_DATE 2018-09-10
|
||||
|
||||
/* For the benefit of systems without stdint.h, an alternative is to use
|
||||
inttypes.h. The existence of these headers is checked by configure or CMake. */
|
||||
|
||||
#define PCRE2_HAVE_STDINT_H 1
|
||||
#define PCRE2_HAVE_INTTYPES_H 1
|
||||
#define PCRE2_DATE 2019-04-16
|
||||
|
||||
/* When an application links to a PCRE DLL in Windows, the symbols that are
|
||||
imported have to be identified as such. When building PCRE2, the appropriate
|
||||
@ -87,18 +81,15 @@ set, we ensure here that it has no effect. */
|
||||
#define PCRE2_CALL_CONVENTION
|
||||
#endif
|
||||
|
||||
/* Have to include limits.h, stdlib.h and stdint.h (or inttypes.h) to ensure
|
||||
that size_t and uint8_t, UCHAR_MAX, etc are defined. If the system has neither
|
||||
header, the relevant values must be provided by some other means. */
|
||||
/* Have to include limits.h, stdlib.h, and inttypes.h to ensure that size_t and
|
||||
uint8_t, UCHAR_MAX, etc are defined. Some systems that do have inttypes.h do
|
||||
not have stdint.h, which is why we use inttypes.h, which according to the C
|
||||
standard is a superset of stdint.h. If none of these headers are available,
|
||||
the relevant values must be provided by some other means. */
|
||||
|
||||
#include <limits.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#if PCRE2_HAVE_STDINT_H
|
||||
#include <stdint.h>
|
||||
#elif PCRE2_HAVE_INTTYPES_H
|
||||
#include <inttypes.h>
|
||||
#endif
|
||||
|
||||
/* Allow for C++ users compiling this directly. */
|
||||
|
||||
@ -158,43 +149,37 @@ D is inspected during pcre2_dfa_match() execution
|
||||
#define PCRE2_EXTRA_BAD_ESCAPE_IS_LITERAL 0x00000002u /* C */
|
||||
#define PCRE2_EXTRA_MATCH_WORD 0x00000004u /* C */
|
||||
#define PCRE2_EXTRA_MATCH_LINE 0x00000008u /* C */
|
||||
#define PCRE2_EXTRA_ESCAPED_CR_IS_LF 0x00000010u /* C */
|
||||
#define PCRE2_EXTRA_ALT_BSUX 0x00000020u /* C */
|
||||
|
||||
/* These are for pcre2_jit_compile(). */
|
||||
|
||||
#define PCRE2_JIT_COMPLETE 0x00000001u /* For full matching */
|
||||
#define PCRE2_JIT_PARTIAL_SOFT 0x00000002u
|
||||
#define PCRE2_JIT_PARTIAL_HARD 0x00000004u
|
||||
#define PCRE2_JIT_INVALID_UTF 0x00000100u
|
||||
|
||||
/* These are for pcre2_match(), pcre2_dfa_match(), and pcre2_jit_match(). Note
|
||||
that PCRE2_ANCHORED and PCRE2_NO_UTF_CHECK can also be passed to these
|
||||
functions (though pcre2_jit_match() ignores the latter since it bypasses all
|
||||
sanity checks). */
|
||||
/* These are for pcre2_match(), pcre2_dfa_match(), pcre2_jit_match(), and
|
||||
pcre2_substitute(). Some are allowed only for one of the functions, and in
|
||||
these cases it is noted below. Note that PCRE2_ANCHORED, PCRE2_ENDANCHORED and
|
||||
PCRE2_NO_UTF_CHECK can also be passed to these functions (though
|
||||
pcre2_jit_match() ignores the latter since it bypasses all sanity checks). */
|
||||
|
||||
#define PCRE2_NOTBOL 0x00000001u
|
||||
#define PCRE2_NOTEOL 0x00000002u
|
||||
#define PCRE2_NOTEMPTY 0x00000004u /* ) These two must be kept */
|
||||
#define PCRE2_NOTEMPTY_ATSTART 0x00000008u /* ) adjacent to each other. */
|
||||
#define PCRE2_PARTIAL_SOFT 0x00000010u
|
||||
#define PCRE2_PARTIAL_HARD 0x00000020u
|
||||
|
||||
/* These are additional options for pcre2_dfa_match(). */
|
||||
|
||||
#define PCRE2_DFA_RESTART 0x00000040u
|
||||
#define PCRE2_DFA_SHORTEST 0x00000080u
|
||||
|
||||
/* These are additional options for pcre2_substitute(), which passes any others
|
||||
through to pcre2_match(). */
|
||||
|
||||
#define PCRE2_SUBSTITUTE_GLOBAL 0x00000100u
|
||||
#define PCRE2_SUBSTITUTE_EXTENDED 0x00000200u
|
||||
#define PCRE2_SUBSTITUTE_UNSET_EMPTY 0x00000400u
|
||||
#define PCRE2_SUBSTITUTE_UNKNOWN_UNSET 0x00000800u
|
||||
#define PCRE2_SUBSTITUTE_OVERFLOW_LENGTH 0x00001000u
|
||||
|
||||
/* A further option for pcre2_match(), not allowed for pcre2_dfa_match(),
|
||||
ignored for pcre2_jit_match(). */
|
||||
|
||||
#define PCRE2_NO_JIT 0x00002000u
|
||||
#define PCRE2_NOTBOL 0x00000001u
|
||||
#define PCRE2_NOTEOL 0x00000002u
|
||||
#define PCRE2_NOTEMPTY 0x00000004u /* ) These two must be kept */
|
||||
#define PCRE2_NOTEMPTY_ATSTART 0x00000008u /* ) adjacent to each other. */
|
||||
#define PCRE2_PARTIAL_SOFT 0x00000010u
|
||||
#define PCRE2_PARTIAL_HARD 0x00000020u
|
||||
#define PCRE2_DFA_RESTART 0x00000040u /* pcre2_dfa_match() only */
|
||||
#define PCRE2_DFA_SHORTEST 0x00000080u /* pcre2_dfa_match() only */
|
||||
#define PCRE2_SUBSTITUTE_GLOBAL 0x00000100u /* pcre2_substitute() only */
|
||||
#define PCRE2_SUBSTITUTE_EXTENDED 0x00000200u /* pcre2_substitute() only */
|
||||
#define PCRE2_SUBSTITUTE_UNSET_EMPTY 0x00000400u /* pcre2_substitute() only */
|
||||
#define PCRE2_SUBSTITUTE_UNKNOWN_UNSET 0x00000800u /* pcre2_substitute() only */
|
||||
#define PCRE2_SUBSTITUTE_OVERFLOW_LENGTH 0x00001000u /* pcre2_substitute() only */
|
||||
#define PCRE2_NO_JIT 0x00002000u /* Not for pcre2_dfa_match() */
|
||||
#define PCRE2_COPY_MATCHED_SUBJECT 0x00004000u
|
||||
|
||||
/* Options for pcre2_pattern_convert(). */
|
||||
|
||||
@ -318,6 +303,8 @@ pcre2_pattern_convert(). */
|
||||
#define PCRE2_ERROR_BAD_LITERAL_OPTIONS 192
|
||||
#define PCRE2_ERROR_SUPPORTED_ONLY_IN_UNICODE 193
|
||||
#define PCRE2_ERROR_INVALID_HYPHEN_IN_OPTIONS 194
|
||||
#define PCRE2_ERROR_ALPHA_ASSERTION_UNKNOWN 195
|
||||
#define PCRE2_ERROR_SCRIPT_RUN_NOT_AVAILABLE 196
|
||||
|
||||
|
||||
/* "Expected" matching error codes: no match and partial match. */
|
||||
@ -504,10 +491,10 @@ typedef struct pcre2_real_jit_stack pcre2_jit_stack; \
|
||||
typedef pcre2_jit_stack *(*pcre2_jit_callback)(void *);
|
||||
|
||||
|
||||
/* The structure for passing out data via the pcre_callout_function. We use a
|
||||
structure so that new fields can be added on the end in future versions,
|
||||
without changing the API of the function, thereby allowing old clients to work
|
||||
without modification. Define the generic version in a macro; the width-specific
|
||||
/* The structures for passing out data via callout functions. We use structures
|
||||
so that new fields can be added on the end in future versions, without changing
|
||||
the API of the function, thereby allowing old clients to work without
|
||||
modification. Define the generic versions in a macro; the width-specific
|
||||
versions are generated from this macro below. */
|
||||
|
||||
/* Flags for the callout_flags field. These are cleared after a callout. */
|
||||
@ -549,7 +536,19 @@ typedef struct pcre2_callout_enumerate_block { \
|
||||
PCRE2_SIZE callout_string_length; /* Length of string compiled into pattern */ \
|
||||
PCRE2_SPTR callout_string; /* String compiled into pattern */ \
|
||||
/* ------------------------------------------------------------------ */ \
|
||||
} pcre2_callout_enumerate_block;
|
||||
} pcre2_callout_enumerate_block; \
|
||||
\
|
||||
typedef struct pcre2_substitute_callout_block { \
|
||||
uint32_t version; /* Identifies version of block */ \
|
||||
/* ------------------------ Version 0 ------------------------------- */ \
|
||||
PCRE2_SPTR input; /* Pointer to input subject string */ \
|
||||
PCRE2_SPTR output; /* Pointer to output buffer */ \
|
||||
PCRE2_SIZE output_offsets[2]; /* Changed portion of the output */ \
|
||||
PCRE2_SIZE *ovector; /* Pointer to current ovector */ \
|
||||
uint32_t oveccount; /* Count of pairs set in ovector */ \
|
||||
uint32_t subscount; /* Substitution number */ \
|
||||
/* ------------------------------------------------------------------ */ \
|
||||
} pcre2_substitute_callout_block;
|
||||
|
||||
|
||||
/* List the generic forms of all other functions in macros, which will be
|
||||
@ -604,6 +603,9 @@ PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \
|
||||
PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
|
||||
pcre2_set_callout(pcre2_match_context *, \
|
||||
int (*)(pcre2_callout_block *, void *), void *); \
|
||||
PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
|
||||
pcre2_set_substitute_callout(pcre2_match_context *, \
|
||||
int (*)(pcre2_substitute_callout_block *, void *), void *); \
|
||||
PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
|
||||
pcre2_set_depth_limit(pcre2_match_context *, uint32_t); \
|
||||
PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
|
||||
@ -807,6 +809,7 @@ pcre2_compile are called by application code. */
|
||||
|
||||
#define pcre2_callout_block PCRE2_SUFFIX(pcre2_callout_block_)
|
||||
#define pcre2_callout_enumerate_block PCRE2_SUFFIX(pcre2_callout_enumerate_block_)
|
||||
#define pcre2_substitute_callout_block PCRE2_SUFFIX(pcre2_substitute_callout_block_)
|
||||
#define pcre2_general_context PCRE2_SUFFIX(pcre2_general_context_)
|
||||
#define pcre2_compile_context PCRE2_SUFFIX(pcre2_compile_context_)
|
||||
#define pcre2_convert_context PCRE2_SUFFIX(pcre2_convert_context_)
|
||||
@ -872,6 +875,7 @@ pcre2_compile are called by application code. */
|
||||
#define pcre2_set_newline PCRE2_SUFFIX(pcre2_set_newline_)
|
||||
#define pcre2_set_parens_nest_limit PCRE2_SUFFIX(pcre2_set_parens_nest_limit_)
|
||||
#define pcre2_set_offset_limit PCRE2_SUFFIX(pcre2_set_offset_limit_)
|
||||
#define pcre2_set_substitute_callout PCRE2_SUFFIX(pcre2_set_substitute_callout_)
|
||||
#define pcre2_substitute PCRE2_SUFFIX(pcre2_substitute_)
|
||||
#define pcre2_substring_copy_byname PCRE2_SUFFIX(pcre2_substring_copy_byname_)
|
||||
#define pcre2_substring_copy_bynumber PCRE2_SUFFIX(pcre2_substring_copy_bynumber_)
|
||||
|
14
src/3rdparty/pcre2/src/pcre2_auto_possess.c
vendored
14
src/3rdparty/pcre2/src/pcre2_auto_possess.c
vendored
@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
|
||||
|
||||
Written by Philip Hazel
|
||||
Original API code Copyright (c) 1997-2012 University of Cambridge
|
||||
New API code Copyright (c) 2016-2018 University of Cambridge
|
||||
New API code Copyright (c) 2016-2019 University of Cambridge
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
@ -605,6 +605,15 @@ for(;;)
|
||||
if (cb->had_recurse) return FALSE;
|
||||
break;
|
||||
|
||||
/* A script run might have to backtrack if the iterated item can match
|
||||
characters from more than one script. So give up unless repeating an
|
||||
explicit character. */
|
||||
|
||||
case OP_SCRIPT_RUN:
|
||||
if (base_list[0] != OP_CHAR && base_list[0] != OP_CHARI)
|
||||
return FALSE;
|
||||
break;
|
||||
|
||||
/* Atomic sub-patterns and assertions can always auto-possessify their
|
||||
last iterator. However, if the group was entered as a result of checking
|
||||
a previous iterator, this is not possible. */
|
||||
@ -614,7 +623,6 @@ for(;;)
|
||||
case OP_ASSERTBACK:
|
||||
case OP_ASSERTBACK_NOT:
|
||||
case OP_ONCE:
|
||||
|
||||
return !entered_a_group;
|
||||
}
|
||||
|
||||
@ -1043,7 +1051,7 @@ for(;;)
|
||||
if (chr > 255) break;
|
||||
class_bitset = (uint8_t *)
|
||||
((list_ptr == list ? code : base_end) - list_ptr[2]);
|
||||
if ((class_bitset[chr >> 3] & (1 << (chr & 7))) != 0) return FALSE;
|
||||
if ((class_bitset[chr >> 3] & (1u << (chr & 7))) != 0) return FALSE;
|
||||
break;
|
||||
|
||||
#ifdef SUPPORT_WIDE_CHARS
|
||||
|
18
src/3rdparty/pcre2/src/pcre2_chartables.c
vendored
18
src/3rdparty/pcre2/src/pcre2_chartables.c
vendored
@ -157,8 +157,8 @@ graph print, punct, and cntrl. Other classes are built from combinations. */
|
||||
/* This table identifies various classes of character by individual bits:
|
||||
0x01 white space character
|
||||
0x02 letter
|
||||
0x04 decimal digit
|
||||
0x08 hexadecimal digit
|
||||
0x04 lower case letter
|
||||
0x08 decimal digit
|
||||
0x10 alphanumeric or '_'
|
||||
*/
|
||||
|
||||
@ -168,16 +168,16 @@ graph print, punct, and cntrl. Other classes are built from combinations. */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 24- 31 */
|
||||
0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* - ' */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* ( - / */
|
||||
0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c, /* 0 - 7 */
|
||||
0x1c,0x1c,0x00,0x00,0x00,0x00,0x00,0x00, /* 8 - ? */
|
||||
0x00,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x12, /* @ - G */
|
||||
0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, /* 0 - 7 */
|
||||
0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00, /* 8 - ? */
|
||||
0x00,0x12,0x12,0x12,0x12,0x12,0x12,0x12, /* @ - G */
|
||||
0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12, /* H - O */
|
||||
0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12, /* P - W */
|
||||
0x12,0x12,0x12,0x00,0x00,0x00,0x00,0x10, /* X - _ */
|
||||
0x00,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x12, /* ` - g */
|
||||
0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12, /* h - o */
|
||||
0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12, /* p - w */
|
||||
0x12,0x12,0x12,0x00,0x00,0x00,0x00,0x00, /* x -127 */
|
||||
0x00,0x16,0x16,0x16,0x16,0x16,0x16,0x16, /* ` - g */
|
||||
0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16, /* h - o */
|
||||
0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16, /* p - w */
|
||||
0x16,0x16,0x16,0x00,0x00,0x00,0x00,0x00, /* x -127 */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 128-135 */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 136-143 */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 144-151 */
|
||||
|
684
src/3rdparty/pcre2/src/pcre2_compile.c
vendored
684
src/3rdparty/pcre2/src/pcre2_compile.c
vendored
File diff suppressed because it is too large
Load Diff
22
src/3rdparty/pcre2/src/pcre2_context.c
vendored
22
src/3rdparty/pcre2/src/pcre2_context.c
vendored
@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
|
||||
|
||||
Written by Philip Hazel
|
||||
Original API code Copyright (c) 1997-2012 University of Cambridge
|
||||
New API code Copyright (c) 2016-2017 University of Cambridge
|
||||
New API code Copyright (c) 2016-2018 University of Cambridge
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
@ -163,11 +163,13 @@ when no context is supplied to a match function. */
|
||||
const pcre2_match_context PRIV(default_match_context) = {
|
||||
{ default_malloc, default_free, NULL },
|
||||
#ifdef SUPPORT_JIT
|
||||
NULL,
|
||||
NULL,
|
||||
NULL, /* JIT callback */
|
||||
NULL, /* JIT callback data */
|
||||
#endif
|
||||
NULL,
|
||||
NULL,
|
||||
NULL, /* Callout function */
|
||||
NULL, /* Callout data */
|
||||
NULL, /* Substitute callout function */
|
||||
NULL, /* Substitute callout data */
|
||||
PCRE2_UNSET, /* Offset limit */
|
||||
HEAP_LIMIT,
|
||||
MATCH_LIMIT,
|
||||
@ -403,6 +405,16 @@ mcontext->callout_data = callout_data;
|
||||
return 0;
|
||||
}
|
||||
|
||||
PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION
|
||||
pcre2_set_substitute_callout(pcre2_match_context *mcontext,
|
||||
int (*substitute_callout)(pcre2_substitute_callout_block *, void *),
|
||||
void *substitute_callout_data)
|
||||
{
|
||||
mcontext->substitute_callout = substitute_callout;
|
||||
mcontext->substitute_callout_data = substitute_callout_data;
|
||||
return 0;
|
||||
}
|
||||
|
||||
PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION
|
||||
pcre2_set_heap_limit(pcre2_match_context *mcontext, uint32_t limit)
|
||||
{
|
||||
|
71
src/3rdparty/pcre2/src/pcre2_dfa_match.c
vendored
71
src/3rdparty/pcre2/src/pcre2_dfa_match.c
vendored
@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
|
||||
|
||||
Written by Philip Hazel
|
||||
Original API code Copyright (c) 1997-2012 University of Cambridge
|
||||
New API code Copyright (c) 2016-2018 University of Cambridge
|
||||
New API code Copyright (c) 2016-2019 University of Cambridge
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
@ -85,7 +85,8 @@ in others, so I abandoned this code. */
|
||||
#define PUBLIC_DFA_MATCH_OPTIONS \
|
||||
(PCRE2_ANCHORED|PCRE2_ENDANCHORED|PCRE2_NOTBOL|PCRE2_NOTEOL|PCRE2_NOTEMPTY| \
|
||||
PCRE2_NOTEMPTY_ATSTART|PCRE2_NO_UTF_CHECK|PCRE2_PARTIAL_HARD| \
|
||||
PCRE2_PARTIAL_SOFT|PCRE2_DFA_SHORTEST|PCRE2_DFA_RESTART)
|
||||
PCRE2_PARTIAL_SOFT|PCRE2_DFA_SHORTEST|PCRE2_DFA_RESTART| \
|
||||
PCRE2_COPY_MATCHED_SUBJECT)
|
||||
|
||||
|
||||
/*************************************************
|
||||
@ -173,6 +174,7 @@ static const uint8_t coptable[] = {
|
||||
0, /* Assert behind */
|
||||
0, /* Assert behind not */
|
||||
0, /* ONCE */
|
||||
0, /* SCRIPT_RUN */
|
||||
0, 0, 0, 0, 0, /* BRA, BRAPOS, CBRA, CBRAPOS, COND */
|
||||
0, 0, 0, 0, 0, /* SBRA, SBRAPOS, SCBRA, SCBRAPOS, SCOND */
|
||||
0, 0, /* CREF, DNCREF */
|
||||
@ -247,6 +249,7 @@ static const uint8_t poptable[] = {
|
||||
0, /* Assert behind */
|
||||
0, /* Assert behind not */
|
||||
0, /* ONCE */
|
||||
0, /* SCRIPT_RUN */
|
||||
0, 0, 0, 0, 0, /* BRA, BRAPOS, CBRA, CBRAPOS, COND */
|
||||
0, 0, 0, 0, 0, /* SBRA, SBRAPOS, SCBRA, SCBRAPOS, SCOND */
|
||||
0, 0, /* CREF, DNCREF */
|
||||
@ -316,8 +319,8 @@ finding the minimum heap requirement for a match. */
|
||||
|
||||
typedef struct RWS_anchor {
|
||||
struct RWS_anchor *next;
|
||||
unsigned int size; /* Number of ints */
|
||||
unsigned int free; /* Number of ints */
|
||||
uint32_t size; /* Number of ints */
|
||||
uint32_t free; /* Number of ints */
|
||||
} RWS_anchor;
|
||||
|
||||
#define RWS_ANCHOR_SIZE (sizeof(RWS_anchor)/sizeof(int))
|
||||
@ -413,20 +416,24 @@ if (rws->next != NULL)
|
||||
new = rws->next;
|
||||
}
|
||||
|
||||
/* All sizes are in units of sizeof(int), except for mb->heaplimit, which is in
|
||||
kibibytes. */
|
||||
/* Sizes in the RWS_anchor blocks are in units of sizeof(int), but
|
||||
mb->heap_limit and mb->heap_used are in kibibytes. Play carefully, to avoid
|
||||
overflow. */
|
||||
|
||||
else
|
||||
{
|
||||
unsigned int newsize = rws->size * 2;
|
||||
unsigned int heapleft = (unsigned int)
|
||||
(((1024/sizeof(int))*mb->heap_limit - mb->heap_used));
|
||||
if (newsize > heapleft) newsize = heapleft;
|
||||
uint32_t newsize = (rws->size >= UINT32_MAX/2)? UINT32_MAX/2 : rws->size * 2;
|
||||
uint32_t newsizeK = newsize/(1024/sizeof(int));
|
||||
|
||||
if (newsizeK + mb->heap_used > mb->heap_limit)
|
||||
newsizeK = (uint32_t)(mb->heap_limit - mb->heap_used);
|
||||
newsize = newsizeK*(1024/sizeof(int));
|
||||
|
||||
if (newsize < RWS_RSIZE + ovecsize + RWS_ANCHOR_SIZE)
|
||||
return PCRE2_ERROR_HEAPLIMIT;
|
||||
new = mb->memctl.malloc(newsize*sizeof(int), mb->memctl.memory_data);
|
||||
if (new == NULL) return PCRE2_ERROR_NOMEMORY;
|
||||
mb->heap_used += newsize;
|
||||
mb->heap_used += newsizeK;
|
||||
new->next = NULL;
|
||||
new->size = newsize;
|
||||
rws->next = new;
|
||||
@ -2560,7 +2567,7 @@ for (;;)
|
||||
if (clen > 0)
|
||||
{
|
||||
isinclass = (c > 255)? (codevalue == OP_NCLASS) :
|
||||
((((uint8_t *)(code + 1))[c/8] & (1 << (c&7))) != 0);
|
||||
((((uint8_t *)(code + 1))[c/8] & (1u << (c&7))) != 0);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2753,7 +2760,7 @@ for (;;)
|
||||
/* There is also an always-true condition */
|
||||
|
||||
else if (condcode == OP_TRUE)
|
||||
{ ADD_ACTIVE(state_offset + LINK_SIZE + 2 + IMM2_SIZE, 0); }
|
||||
{ ADD_ACTIVE(state_offset + LINK_SIZE + 2, 0); }
|
||||
|
||||
/* The only supported version of OP_RREF is for the value RREF_ANY,
|
||||
which means "test if in any recursion". We can't test for specifically
|
||||
@ -3226,6 +3233,8 @@ pcre2_dfa_match(const pcre2_code *code, PCRE2_SPTR subject, PCRE2_SIZE length,
|
||||
pcre2_match_context *mcontext, int *workspace, PCRE2_SIZE wscount)
|
||||
{
|
||||
int rc;
|
||||
int was_zero_terminated = 0;
|
||||
|
||||
const pcre2_real_code *re = (const pcre2_real_code *)code;
|
||||
|
||||
PCRE2_SPTR start_match;
|
||||
@ -3265,7 +3274,11 @@ rws->free = RWS_BASE_SIZE - RWS_ANCHOR_SIZE;
|
||||
/* A length equal to PCRE2_ZERO_TERMINATED implies a zero-terminated
|
||||
subject string. */
|
||||
|
||||
if (length == PCRE2_ZERO_TERMINATED) length = PRIV(strlen)(subject);
|
||||
if (length == PCRE2_ZERO_TERMINATED)
|
||||
{
|
||||
length = PRIV(strlen)(subject);
|
||||
was_zero_terminated = 1;
|
||||
}
|
||||
|
||||
/* Plausibility checks */
|
||||
|
||||
@ -3518,10 +3531,20 @@ if ((re->flags & PCRE2_LASTSET) != 0)
|
||||
}
|
||||
}
|
||||
|
||||
/* If the match data block was previously used with PCRE2_COPY_MATCHED_SUBJECT,
|
||||
free the memory that was obtained. */
|
||||
|
||||
if ((match_data->flags & PCRE2_MD_COPIED_SUBJECT) != 0)
|
||||
{
|
||||
match_data->memctl.free((void *)match_data->subject,
|
||||
match_data->memctl.memory_data);
|
||||
match_data->flags &= ~PCRE2_MD_COPIED_SUBJECT;
|
||||
}
|
||||
|
||||
/* Fill in fields that are always returned in the match data. */
|
||||
|
||||
match_data->code = re;
|
||||
match_data->subject = subject;
|
||||
match_data->subject = NULL; /* Default for no match */
|
||||
match_data->mark = NULL;
|
||||
match_data->matchedby = PCRE2_MATCHEDBY_DFA_INTERPRETER;
|
||||
|
||||
@ -3586,7 +3609,7 @@ for (;;)
|
||||
#if PCRE2_CODE_UNIT_WIDTH != 8
|
||||
if (c > 255) c = 255;
|
||||
#endif
|
||||
ok = (start_bits[c/8] & (1 << (c&7))) != 0;
|
||||
ok = (start_bits[c/8] & (1u << (c&7))) != 0;
|
||||
}
|
||||
}
|
||||
if (!ok) break;
|
||||
@ -3697,7 +3720,7 @@ for (;;)
|
||||
#if PCRE2_CODE_UNIT_WIDTH != 8
|
||||
if (c > 255) c = 255;
|
||||
#endif
|
||||
if ((start_bits[c/8] & (1 << (c&7))) != 0) break;
|
||||
if ((start_bits[c/8] & (1u << (c&7))) != 0) break;
|
||||
start_match++;
|
||||
}
|
||||
|
||||
@ -3816,6 +3839,20 @@ for (;;)
|
||||
match_data->rightchar = (PCRE2_SIZE)( mb->last_used_ptr - subject);
|
||||
match_data->startchar = (PCRE2_SIZE)(start_match - subject);
|
||||
match_data->rc = rc;
|
||||
|
||||
if (rc >= 0 &&(options & PCRE2_COPY_MATCHED_SUBJECT) != 0)
|
||||
{
|
||||
length = CU2BYTES(length + was_zero_terminated);
|
||||
match_data->subject = match_data->memctl.malloc(length,
|
||||
match_data->memctl.memory_data);
|
||||
if (match_data->subject == NULL) return PCRE2_ERROR_NOMEMORY;
|
||||
memcpy((void *)match_data->subject, subject, length);
|
||||
match_data->flags |= PCRE2_MD_COPIED_SUBJECT;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (rc >= 0 || rc == PCRE2_ERROR_PARTIAL) match_data->subject = subject;
|
||||
}
|
||||
goto EXIT;
|
||||
}
|
||||
|
||||
|
19
src/3rdparty/pcre2/src/pcre2_error.c
vendored
19
src/3rdparty/pcre2/src/pcre2_error.c
vendored
@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
|
||||
|
||||
Written by Philip Hazel
|
||||
Original API code Copyright (c) 1997-2012 University of Cambridge
|
||||
New API code Copyright (c) 2016-2018 University of Cambridge
|
||||
New API code Copyright (c) 2016-2019 University of Cambridge
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
@ -71,7 +71,7 @@ static const unsigned char compile_error_texts[] =
|
||||
/* 5 */
|
||||
"number too big in {} quantifier\0"
|
||||
"missing terminating ] for character class\0"
|
||||
"invalid escape sequence in character class\0"
|
||||
"escape sequence is invalid in character class\0"
|
||||
"range out of order in character class\0"
|
||||
"quantifier does not follow a repeatable item\0"
|
||||
/* 10 */
|
||||
@ -95,7 +95,7 @@ static const unsigned char compile_error_texts[] =
|
||||
/* 25 */
|
||||
"lookbehind assertion is not fixed length\0"
|
||||
"a relative value of zero is not allowed\0"
|
||||
"conditional group contains more than two branches\0"
|
||||
"conditional subpattern contains more than two branches\0"
|
||||
"assertion expected after (?( or (?(?C)\0"
|
||||
"digit expected after (?+ or (?-\0"
|
||||
/* 30 */
|
||||
@ -113,21 +113,21 @@ static const unsigned char compile_error_texts[] =
|
||||
/* 40 */
|
||||
"invalid escape sequence in (*VERB) name\0"
|
||||
"unrecognized character after (?P\0"
|
||||
"syntax error in subpattern name (missing terminator)\0"
|
||||
"syntax error in subpattern name (missing terminator?)\0"
|
||||
"two named subpatterns have the same name (PCRE2_DUPNAMES not set)\0"
|
||||
"group name must start with a non-digit\0"
|
||||
"subpattern name must start with a non-digit\0"
|
||||
/* 45 */
|
||||
"this version of PCRE2 does not have support for \\P, \\p, or \\X\0"
|
||||
"malformed \\P or \\p sequence\0"
|
||||
"unknown property name after \\P or \\p\0"
|
||||
"subpattern name is too long (maximum " XSTRING(MAX_NAME_SIZE) " characters)\0"
|
||||
"subpattern name is too long (maximum " XSTRING(MAX_NAME_SIZE) " code units)\0"
|
||||
"too many named subpatterns (maximum " XSTRING(MAX_NAME_COUNT) ")\0"
|
||||
/* 50 */
|
||||
"invalid range in character class\0"
|
||||
"octal value is greater than \\377 in 8-bit non-UTF-8 mode\0"
|
||||
"internal error: overran compiling workspace\0"
|
||||
"internal error: previously-checked referenced subpattern not found\0"
|
||||
"DEFINE group contains more than one branch\0"
|
||||
"DEFINE subpattern contains more than one branch\0"
|
||||
/* 55 */
|
||||
"missing opening brace after \\o\0"
|
||||
"internal error: unknown newline setting\0"
|
||||
@ -137,7 +137,7 @@ static const unsigned char compile_error_texts[] =
|
||||
"obsolete error (should not occur)\0" /* Was the above */
|
||||
/* 60 */
|
||||
"(*VERB) not recognized or malformed\0"
|
||||
"group number is too big\0"
|
||||
"subpattern number is too big\0"
|
||||
"subpattern name expected\0"
|
||||
"internal error: parsed pattern overflow\0"
|
||||
"non-octal character in \\o{} (closing brace missing?)\0"
|
||||
@ -181,6 +181,9 @@ static const unsigned char compile_error_texts[] =
|
||||
"invalid option bits with PCRE2_LITERAL\0"
|
||||
"\\N{U+dddd} is supported only in Unicode (UTF) mode\0"
|
||||
"invalid hyphen in option setting\0"
|
||||
/* 95 */
|
||||
"(*alpha_assertion) not recognized\0"
|
||||
"script runs require Unicode support, which this version of PCRE2 does not have\0"
|
||||
;
|
||||
|
||||
/* Match-time and UTF error texts are in the same format. */
|
||||
|
4
src/3rdparty/pcre2/src/pcre2_extuni.c
vendored
4
src/3rdparty/pcre2/src/pcre2_extuni.c
vendored
@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
|
||||
|
||||
Written by Philip Hazel
|
||||
Original API code Copyright (c) 1997-2012 University of Cambridge
|
||||
New API code Copyright (c) 2016-2018 University of Cambridge
|
||||
New API code Copyright (c) 2016-2019 University of Cambridge
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
@ -100,7 +100,7 @@ while (eptr < end_subject)
|
||||
int len = 1;
|
||||
if (!utf) c = *eptr; else { GETCHARLEN(c, eptr, len); }
|
||||
rgb = UCD_GRAPHBREAK(c);
|
||||
if ((PRIV(ucp_gbtable)[lgb] & (1 << rgb)) == 0) break;
|
||||
if ((PRIV(ucp_gbtable)[lgb] & (1u << rgb)) == 0) break;
|
||||
|
||||
/* Not breaking between Regional Indicators is allowed only if there
|
||||
are an even number of preceding RIs. */
|
||||
|
249
src/3rdparty/pcre2/src/pcre2_internal.h
vendored
249
src/3rdparty/pcre2/src/pcre2_internal.h
vendored
@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
|
||||
|
||||
Written by Philip Hazel
|
||||
Original API code Copyright (c) 1997-2012 University of Cambridge
|
||||
New API code Copyright (c) 2016-2018 University of Cambridge
|
||||
New API code Copyright (c) 2016-2019 University of Cambridge
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
@ -148,16 +148,7 @@ pcre2_match() because of the way it backtracks. */
|
||||
/* When checking for integer overflow in pcre2_compile(), we need to handle
|
||||
large integers. If a 64-bit integer type is available, we can use that.
|
||||
Otherwise we have to cast to double, which of course requires floating point
|
||||
arithmetic. Handle this by defining a macro for the appropriate type. If
|
||||
stdint.h is available, include it; it may define INT64_MAX. Systems that do not
|
||||
have stdint.h (e.g. Solaris) may have inttypes.h. The macro int64_t may be set
|
||||
by "configure". */
|
||||
|
||||
#if defined HAVE_STDINT_H
|
||||
#include <stdint.h>
|
||||
#elif defined HAVE_INTTYPES_H
|
||||
#include <inttypes.h>
|
||||
#endif
|
||||
arithmetic. Handle this by defining a macro for the appropriate type. */
|
||||
|
||||
#if defined INT64_MAX || defined int64_t
|
||||
#define INT64_OR_DOUBLE int64_t
|
||||
@ -535,6 +526,10 @@ enum { PCRE2_MATCHEDBY_INTERPRETER, /* pcre2_match() */
|
||||
PCRE2_MATCHEDBY_DFA_INTERPRETER, /* pcre2_dfa_match() */
|
||||
PCRE2_MATCHEDBY_JIT }; /* pcre2_jit_match() */
|
||||
|
||||
/* Values for the flags field in a match data block. */
|
||||
|
||||
#define PCRE2_MD_COPIED_SUBJECT 0x01u
|
||||
|
||||
/* Magic number to provide a small check against being handed junk. */
|
||||
|
||||
#define MAGIC_NUMBER 0x50435245UL /* 'PCRE' */
|
||||
@ -569,11 +564,11 @@ these tables. */
|
||||
without checking pcre2_jit_compile.c, which has an assertion to ensure that
|
||||
ctype_word has the value 16. */
|
||||
|
||||
#define ctype_space 0x01
|
||||
#define ctype_letter 0x02
|
||||
#define ctype_digit 0x04
|
||||
#define ctype_xdigit 0x08 /* not actually used any more */
|
||||
#define ctype_word 0x10 /* alphanumeric or '_' */
|
||||
#define ctype_space 0x01
|
||||
#define ctype_letter 0x02
|
||||
#define ctype_lcletter 0x04
|
||||
#define ctype_digit 0x08
|
||||
#define ctype_word 0x10 /* alphanumeric or '_' */
|
||||
|
||||
/* Offsets of the various tables from the base tables pointer, and
|
||||
total length of the tables. */
|
||||
@ -874,34 +869,48 @@ a positive value. */
|
||||
#define STR_RIGHT_CURLY_BRACKET "}"
|
||||
#define STR_TILDE "~"
|
||||
|
||||
#define STRING_ACCEPT0 "ACCEPT\0"
|
||||
#define STRING_COMMIT0 "COMMIT\0"
|
||||
#define STRING_F0 "F\0"
|
||||
#define STRING_FAIL0 "FAIL\0"
|
||||
#define STRING_MARK0 "MARK\0"
|
||||
#define STRING_PRUNE0 "PRUNE\0"
|
||||
#define STRING_SKIP0 "SKIP\0"
|
||||
#define STRING_THEN "THEN"
|
||||
#define STRING_ACCEPT0 "ACCEPT\0"
|
||||
#define STRING_COMMIT0 "COMMIT\0"
|
||||
#define STRING_F0 "F\0"
|
||||
#define STRING_FAIL0 "FAIL\0"
|
||||
#define STRING_MARK0 "MARK\0"
|
||||
#define STRING_PRUNE0 "PRUNE\0"
|
||||
#define STRING_SKIP0 "SKIP\0"
|
||||
#define STRING_THEN "THEN"
|
||||
|
||||
#define STRING_alpha0 "alpha\0"
|
||||
#define STRING_lower0 "lower\0"
|
||||
#define STRING_upper0 "upper\0"
|
||||
#define STRING_alnum0 "alnum\0"
|
||||
#define STRING_ascii0 "ascii\0"
|
||||
#define STRING_blank0 "blank\0"
|
||||
#define STRING_cntrl0 "cntrl\0"
|
||||
#define STRING_digit0 "digit\0"
|
||||
#define STRING_graph0 "graph\0"
|
||||
#define STRING_print0 "print\0"
|
||||
#define STRING_punct0 "punct\0"
|
||||
#define STRING_space0 "space\0"
|
||||
#define STRING_word0 "word\0"
|
||||
#define STRING_xdigit "xdigit"
|
||||
#define STRING_atomic0 "atomic\0"
|
||||
#define STRING_pla0 "pla\0"
|
||||
#define STRING_plb0 "plb\0"
|
||||
#define STRING_nla0 "nla\0"
|
||||
#define STRING_nlb0 "nlb\0"
|
||||
#define STRING_sr0 "sr\0"
|
||||
#define STRING_asr0 "asr\0"
|
||||
#define STRING_positive_lookahead0 "positive_lookahead\0"
|
||||
#define STRING_positive_lookbehind0 "positive_lookbehind\0"
|
||||
#define STRING_negative_lookahead0 "negative_lookahead\0"
|
||||
#define STRING_negative_lookbehind0 "negative_lookbehind\0"
|
||||
#define STRING_script_run0 "script_run\0"
|
||||
#define STRING_atomic_script_run "atomic_script_run"
|
||||
|
||||
#define STRING_DEFINE "DEFINE"
|
||||
#define STRING_VERSION "VERSION"
|
||||
#define STRING_WEIRD_STARTWORD "[:<:]]"
|
||||
#define STRING_WEIRD_ENDWORD "[:>:]]"
|
||||
#define STRING_alpha0 "alpha\0"
|
||||
#define STRING_lower0 "lower\0"
|
||||
#define STRING_upper0 "upper\0"
|
||||
#define STRING_alnum0 "alnum\0"
|
||||
#define STRING_ascii0 "ascii\0"
|
||||
#define STRING_blank0 "blank\0"
|
||||
#define STRING_cntrl0 "cntrl\0"
|
||||
#define STRING_digit0 "digit\0"
|
||||
#define STRING_graph0 "graph\0"
|
||||
#define STRING_print0 "print\0"
|
||||
#define STRING_punct0 "punct\0"
|
||||
#define STRING_space0 "space\0"
|
||||
#define STRING_word0 "word\0"
|
||||
#define STRING_xdigit "xdigit"
|
||||
|
||||
#define STRING_DEFINE "DEFINE"
|
||||
#define STRING_VERSION "VERSION"
|
||||
#define STRING_WEIRD_STARTWORD "[:<:]]"
|
||||
#define STRING_WEIRD_ENDWORD "[:>:]]"
|
||||
|
||||
#define STRING_CR_RIGHTPAR "CR)"
|
||||
#define STRING_LF_RIGHTPAR "LF)"
|
||||
@ -1150,34 +1159,48 @@ only. */
|
||||
#define STR_RIGHT_CURLY_BRACKET "\175"
|
||||
#define STR_TILDE "\176"
|
||||
|
||||
#define STRING_ACCEPT0 STR_A STR_C STR_C STR_E STR_P STR_T "\0"
|
||||
#define STRING_COMMIT0 STR_C STR_O STR_M STR_M STR_I STR_T "\0"
|
||||
#define STRING_F0 STR_F "\0"
|
||||
#define STRING_FAIL0 STR_F STR_A STR_I STR_L "\0"
|
||||
#define STRING_MARK0 STR_M STR_A STR_R STR_K "\0"
|
||||
#define STRING_PRUNE0 STR_P STR_R STR_U STR_N STR_E "\0"
|
||||
#define STRING_SKIP0 STR_S STR_K STR_I STR_P "\0"
|
||||
#define STRING_THEN STR_T STR_H STR_E STR_N
|
||||
#define STRING_ACCEPT0 STR_A STR_C STR_C STR_E STR_P STR_T "\0"
|
||||
#define STRING_COMMIT0 STR_C STR_O STR_M STR_M STR_I STR_T "\0"
|
||||
#define STRING_F0 STR_F "\0"
|
||||
#define STRING_FAIL0 STR_F STR_A STR_I STR_L "\0"
|
||||
#define STRING_MARK0 STR_M STR_A STR_R STR_K "\0"
|
||||
#define STRING_PRUNE0 STR_P STR_R STR_U STR_N STR_E "\0"
|
||||
#define STRING_SKIP0 STR_S STR_K STR_I STR_P "\0"
|
||||
#define STRING_THEN STR_T STR_H STR_E STR_N
|
||||
|
||||
#define STRING_alpha0 STR_a STR_l STR_p STR_h STR_a "\0"
|
||||
#define STRING_lower0 STR_l STR_o STR_w STR_e STR_r "\0"
|
||||
#define STRING_upper0 STR_u STR_p STR_p STR_e STR_r "\0"
|
||||
#define STRING_alnum0 STR_a STR_l STR_n STR_u STR_m "\0"
|
||||
#define STRING_ascii0 STR_a STR_s STR_c STR_i STR_i "\0"
|
||||
#define STRING_blank0 STR_b STR_l STR_a STR_n STR_k "\0"
|
||||
#define STRING_cntrl0 STR_c STR_n STR_t STR_r STR_l "\0"
|
||||
#define STRING_digit0 STR_d STR_i STR_g STR_i STR_t "\0"
|
||||
#define STRING_graph0 STR_g STR_r STR_a STR_p STR_h "\0"
|
||||
#define STRING_print0 STR_p STR_r STR_i STR_n STR_t "\0"
|
||||
#define STRING_punct0 STR_p STR_u STR_n STR_c STR_t "\0"
|
||||
#define STRING_space0 STR_s STR_p STR_a STR_c STR_e "\0"
|
||||
#define STRING_word0 STR_w STR_o STR_r STR_d "\0"
|
||||
#define STRING_xdigit STR_x STR_d STR_i STR_g STR_i STR_t
|
||||
#define STRING_atomic0 STR_a STR_t STR_o STR_m STR_i STR_c "\0"
|
||||
#define STRING_pla0 STR_p STR_l STR_a "\0"
|
||||
#define STRING_plb0 STR_p STR_l STR_b "\0"
|
||||
#define STRING_nla0 STR_n STR_l STR_a "\0"
|
||||
#define STRING_nlb0 STR_n STR_l STR_b "\0"
|
||||
#define STRING_sr0 STR_s STR_r "\0"
|
||||
#define STRING_asr0 STR_a STR_s STR_r "\0"
|
||||
#define STRING_positive_lookahead0 STR_p STR_o STR_s STR_i STR_t STR_i STR_v STR_e STR_UNDERSCORE STR_l STR_o STR_o STR_k STR_a STR_h STR_e STR_a STR_d "\0"
|
||||
#define STRING_positive_lookbehind0 STR_p STR_o STR_s STR_i STR_t STR_i STR_v STR_e STR_UNDERSCORE STR_l STR_o STR_o STR_k STR_b STR_e STR_h STR_i STR_n STR_d "\0"
|
||||
#define STRING_negative_lookahead0 STR_n STR_e STR_g STR_a STR_t STR_i STR_v STR_e STR_UNDERSCORE STR_l STR_o STR_o STR_k STR_a STR_h STR_e STR_a STR_d "\0"
|
||||
#define STRING_negative_lookbehind0 STR_n STR_e STR_g STR_a STR_t STR_i STR_v STR_e STR_UNDERSCORE STR_l STR_o STR_o STR_k STR_b STR_e STR_h STR_i STR_n STR_d "\0"
|
||||
#define STRING_script_run0 STR_s STR_c STR_r STR_i STR_p STR_t STR_UNDERSCORE STR_r STR_u STR_n "\0"
|
||||
#define STRING_atomic_script_run STR_a STR_t STR_o STR_m STR_i STR_c STR_UNDERSCORE STR_s STR_c STR_r STR_i STR_p STR_t STR_UNDERSCORE STR_r STR_u STR_n
|
||||
|
||||
#define STRING_DEFINE STR_D STR_E STR_F STR_I STR_N STR_E
|
||||
#define STRING_VERSION STR_V STR_E STR_R STR_S STR_I STR_O STR_N
|
||||
#define STRING_WEIRD_STARTWORD STR_LEFT_SQUARE_BRACKET STR_COLON STR_LESS_THAN_SIGN STR_COLON STR_RIGHT_SQUARE_BRACKET STR_RIGHT_SQUARE_BRACKET
|
||||
#define STRING_WEIRD_ENDWORD STR_LEFT_SQUARE_BRACKET STR_COLON STR_GREATER_THAN_SIGN STR_COLON STR_RIGHT_SQUARE_BRACKET STR_RIGHT_SQUARE_BRACKET
|
||||
#define STRING_alpha0 STR_a STR_l STR_p STR_h STR_a "\0"
|
||||
#define STRING_lower0 STR_l STR_o STR_w STR_e STR_r "\0"
|
||||
#define STRING_upper0 STR_u STR_p STR_p STR_e STR_r "\0"
|
||||
#define STRING_alnum0 STR_a STR_l STR_n STR_u STR_m "\0"
|
||||
#define STRING_ascii0 STR_a STR_s STR_c STR_i STR_i "\0"
|
||||
#define STRING_blank0 STR_b STR_l STR_a STR_n STR_k "\0"
|
||||
#define STRING_cntrl0 STR_c STR_n STR_t STR_r STR_l "\0"
|
||||
#define STRING_digit0 STR_d STR_i STR_g STR_i STR_t "\0"
|
||||
#define STRING_graph0 STR_g STR_r STR_a STR_p STR_h "\0"
|
||||
#define STRING_print0 STR_p STR_r STR_i STR_n STR_t "\0"
|
||||
#define STRING_punct0 STR_p STR_u STR_n STR_c STR_t "\0"
|
||||
#define STRING_space0 STR_s STR_p STR_a STR_c STR_e "\0"
|
||||
#define STRING_word0 STR_w STR_o STR_r STR_d "\0"
|
||||
#define STRING_xdigit STR_x STR_d STR_i STR_g STR_i STR_t
|
||||
|
||||
#define STRING_DEFINE STR_D STR_E STR_F STR_I STR_N STR_E
|
||||
#define STRING_VERSION STR_V STR_E STR_R STR_S STR_I STR_O STR_N
|
||||
#define STRING_WEIRD_STARTWORD STR_LEFT_SQUARE_BRACKET STR_COLON STR_LESS_THAN_SIGN STR_COLON STR_RIGHT_SQUARE_BRACKET STR_RIGHT_SQUARE_BRACKET
|
||||
#define STRING_WEIRD_ENDWORD STR_LEFT_SQUARE_BRACKET STR_COLON STR_GREATER_THAN_SIGN STR_COLON STR_RIGHT_SQUARE_BRACKET STR_RIGHT_SQUARE_BRACKET
|
||||
|
||||
#define STRING_CR_RIGHTPAR STR_C STR_R STR_RIGHT_PARENTHESIS
|
||||
#define STRING_LF_RIGHTPAR STR_L STR_F STR_RIGHT_PARENTHESIS
|
||||
@ -1485,70 +1508,71 @@ enum {
|
||||
OP_ASSERTBACK, /* 128 Positive lookbehind */
|
||||
OP_ASSERTBACK_NOT, /* 129 Negative lookbehind */
|
||||
|
||||
/* ONCE, BRA, BRAPOS, CBRA, CBRAPOS, and COND must come immediately after the
|
||||
assertions, with ONCE first, as there's a test for >= ONCE for a subpattern
|
||||
that isn't an assertion. The POS versions must immediately follow the non-POS
|
||||
versions in each case. */
|
||||
/* ONCE, SCRIPT_RUN, BRA, BRAPOS, CBRA, CBRAPOS, and COND must come
|
||||
immediately after the assertions, with ONCE first, as there's a test for >=
|
||||
ONCE for a subpattern that isn't an assertion. The POS versions must
|
||||
immediately follow the non-POS versions in each case. */
|
||||
|
||||
OP_ONCE, /* 130 Atomic group, contains captures */
|
||||
OP_BRA, /* 131 Start of non-capturing bracket */
|
||||
OP_BRAPOS, /* 132 Ditto, with unlimited, possessive repeat */
|
||||
OP_CBRA, /* 133 Start of capturing bracket */
|
||||
OP_CBRAPOS, /* 134 Ditto, with unlimited, possessive repeat */
|
||||
OP_COND, /* 135 Conditional group */
|
||||
OP_SCRIPT_RUN, /* 131 Non-capture, but check characters' scripts */
|
||||
OP_BRA, /* 132 Start of non-capturing bracket */
|
||||
OP_BRAPOS, /* 133 Ditto, with unlimited, possessive repeat */
|
||||
OP_CBRA, /* 134 Start of capturing bracket */
|
||||
OP_CBRAPOS, /* 135 Ditto, with unlimited, possessive repeat */
|
||||
OP_COND, /* 136 Conditional group */
|
||||
|
||||
/* These five must follow the previous five, in the same order. There's a
|
||||
check for >= SBRA to distinguish the two sets. */
|
||||
|
||||
OP_SBRA, /* 136 Start of non-capturing bracket, check empty */
|
||||
OP_SBRAPOS, /* 137 Ditto, with unlimited, possessive repeat */
|
||||
OP_SCBRA, /* 138 Start of capturing bracket, check empty */
|
||||
OP_SCBRAPOS, /* 139 Ditto, with unlimited, possessive repeat */
|
||||
OP_SCOND, /* 140 Conditional group, check empty */
|
||||
OP_SBRA, /* 137 Start of non-capturing bracket, check empty */
|
||||
OP_SBRAPOS, /* 138 Ditto, with unlimited, possessive repeat */
|
||||
OP_SCBRA, /* 139 Start of capturing bracket, check empty */
|
||||
OP_SCBRAPOS, /* 140 Ditto, with unlimited, possessive repeat */
|
||||
OP_SCOND, /* 141 Conditional group, check empty */
|
||||
|
||||
/* The next two pairs must (respectively) be kept together. */
|
||||
|
||||
OP_CREF, /* 141 Used to hold a capture number as condition */
|
||||
OP_DNCREF, /* 142 Used to point to duplicate names as a condition */
|
||||
OP_RREF, /* 143 Used to hold a recursion number as condition */
|
||||
OP_DNRREF, /* 144 Used to point to duplicate names as a condition */
|
||||
OP_FALSE, /* 145 Always false (used by DEFINE and VERSION) */
|
||||
OP_TRUE, /* 146 Always true (used by VERSION) */
|
||||
OP_CREF, /* 142 Used to hold a capture number as condition */
|
||||
OP_DNCREF, /* 143 Used to point to duplicate names as a condition */
|
||||
OP_RREF, /* 144 Used to hold a recursion number as condition */
|
||||
OP_DNRREF, /* 145 Used to point to duplicate names as a condition */
|
||||
OP_FALSE, /* 146 Always false (used by DEFINE and VERSION) */
|
||||
OP_TRUE, /* 147 Always true (used by VERSION) */
|
||||
|
||||
OP_BRAZERO, /* 147 These two must remain together and in this */
|
||||
OP_BRAMINZERO, /* 148 order. */
|
||||
OP_BRAPOSZERO, /* 149 */
|
||||
OP_BRAZERO, /* 148 These two must remain together and in this */
|
||||
OP_BRAMINZERO, /* 149 order. */
|
||||
OP_BRAPOSZERO, /* 150 */
|
||||
|
||||
/* These are backtracking control verbs */
|
||||
|
||||
OP_MARK, /* 150 always has an argument */
|
||||
OP_PRUNE, /* 151 */
|
||||
OP_PRUNE_ARG, /* 152 same, but with argument */
|
||||
OP_SKIP, /* 153 */
|
||||
OP_SKIP_ARG, /* 154 same, but with argument */
|
||||
OP_THEN, /* 155 */
|
||||
OP_THEN_ARG, /* 156 same, but with argument */
|
||||
OP_COMMIT, /* 157 */
|
||||
OP_COMMIT_ARG, /* 158 same, but with argument */
|
||||
OP_MARK, /* 151 always has an argument */
|
||||
OP_PRUNE, /* 152 */
|
||||
OP_PRUNE_ARG, /* 153 same, but with argument */
|
||||
OP_SKIP, /* 154 */
|
||||
OP_SKIP_ARG, /* 155 same, but with argument */
|
||||
OP_THEN, /* 156 */
|
||||
OP_THEN_ARG, /* 157 same, but with argument */
|
||||
OP_COMMIT, /* 158 */
|
||||
OP_COMMIT_ARG, /* 159 same, but with argument */
|
||||
|
||||
/* These are forced failure and success verbs. FAIL and ACCEPT do accept an
|
||||
argument, but these cases can be compiled as, for example, (*MARK:X)(*FAIL)
|
||||
without the need for a special opcode. */
|
||||
|
||||
OP_FAIL, /* 159 */
|
||||
OP_ACCEPT, /* 160 */
|
||||
OP_ASSERT_ACCEPT, /* 161 Used inside assertions */
|
||||
OP_CLOSE, /* 162 Used before OP_ACCEPT to close open captures */
|
||||
OP_FAIL, /* 160 */
|
||||
OP_ACCEPT, /* 161 */
|
||||
OP_ASSERT_ACCEPT, /* 162 Used inside assertions */
|
||||
OP_CLOSE, /* 163 Used before OP_ACCEPT to close open captures */
|
||||
|
||||
/* This is used to skip a subpattern with a {0} quantifier */
|
||||
|
||||
OP_SKIPZERO, /* 163 */
|
||||
OP_SKIPZERO, /* 164 */
|
||||
|
||||
/* This is used to identify a DEFINE group during compilation so that it can
|
||||
be checked for having only one branch. It is changed to OP_FALSE before
|
||||
compilation finishes. */
|
||||
|
||||
OP_DEFINE, /* 164 */
|
||||
OP_DEFINE, /* 165 */
|
||||
|
||||
/* This is not an opcode, but is used to check that tables indexed by opcode
|
||||
are the correct length, in order to catch updating errors - there have been
|
||||
@ -1596,6 +1620,7 @@ some cases doesn't actually use these names at all). */
|
||||
"Alt", "Ket", "KetRmax", "KetRmin", "KetRpos", \
|
||||
"Reverse", "Assert", "Assert not", "AssertB", "AssertB not", \
|
||||
"Once", \
|
||||
"Script run", \
|
||||
"Bra", "BraPos", "CBra", "CBraPos", \
|
||||
"Cond", \
|
||||
"SBra", "SBraPos", "SCBra", "SCBraPos", \
|
||||
@ -1679,6 +1704,7 @@ in UTF-8 mode. The code that uses this table must know about such things. */
|
||||
1+LINK_SIZE, /* Assert behind */ \
|
||||
1+LINK_SIZE, /* Assert behind not */ \
|
||||
1+LINK_SIZE, /* ONCE */ \
|
||||
1+LINK_SIZE, /* SCRIPT_RUN */ \
|
||||
1+LINK_SIZE, /* BRA */ \
|
||||
1+LINK_SIZE, /* BRAPOS */ \
|
||||
1+LINK_SIZE+IMM2_SIZE, /* CBRA */ \
|
||||
@ -1747,6 +1773,8 @@ typedef struct {
|
||||
uint8_t gbprop; /* ucp_gbControl, etc. (grapheme break property) */
|
||||
uint8_t caseset; /* offset to multichar other cases or zero */
|
||||
int32_t other_case; /* offset to other case, or zero if none */
|
||||
int16_t scriptx; /* script extension value */
|
||||
int16_t dummy; /* spare - to round to multiple of 4 bytes */
|
||||
} ucd_record;
|
||||
|
||||
/* UCD access macros */
|
||||
@ -1769,6 +1797,7 @@ typedef struct {
|
||||
#define UCD_GRAPHBREAK(ch) GET_UCD(ch)->gbprop
|
||||
#define UCD_CASESET(ch) GET_UCD(ch)->caseset
|
||||
#define UCD_OTHERCASE(ch) ((uint32_t)((int)ch + (int)(GET_UCD(ch)->other_case)))
|
||||
#define UCD_SCRIPTX(ch) GET_UCD(ch)->scriptx
|
||||
|
||||
/* Header for serialized pcre2 codes. */
|
||||
|
||||
@ -1826,6 +1855,8 @@ extern const uint8_t PRIV(utf8_table4)[];
|
||||
#define _pcre2_hspace_list PCRE2_SUFFIX(_pcre2_hspace_list_)
|
||||
#define _pcre2_vspace_list PCRE2_SUFFIX(_pcre2_vspace_list_)
|
||||
#define _pcre2_ucd_caseless_sets PCRE2_SUFFIX(_pcre2_ucd_caseless_sets_)
|
||||
#define _pcre2_ucd_digit_sets PCRE2_SUFFIX(_pcre2_ucd_digit_sets_)
|
||||
#define _pcre2_ucd_script_sets PCRE2_SUFFIX(_pcre2_ucd_script_sets_)
|
||||
#define _pcre2_ucd_records PCRE2_SUFFIX(_pcre2_ucd_records_)
|
||||
#define _pcre2_ucd_stage1 PCRE2_SUFFIX(_pcre2_ucd_stage1_)
|
||||
#define _pcre2_ucd_stage2 PCRE2_SUFFIX(_pcre2_ucd_stage2_)
|
||||
@ -1847,6 +1878,8 @@ extern const uint8_t PRIV(default_tables)[];
|
||||
extern const uint32_t PRIV(hspace_list)[];
|
||||
extern const uint32_t PRIV(vspace_list)[];
|
||||
extern const uint32_t PRIV(ucd_caseless_sets)[];
|
||||
extern const uint32_t PRIV(ucd_digit_sets)[];
|
||||
extern const uint8_t PRIV(ucd_script_sets)[];
|
||||
extern const ucd_record PRIV(ucd_records)[];
|
||||
#if PCRE2_CODE_UNIT_WIDTH == 32
|
||||
extern const ucd_record PRIV(dummy_ucd_record)[];
|
||||
@ -1894,6 +1927,7 @@ is available. */
|
||||
#define _pcre2_jit_get_target PCRE2_SUFFIX(_pcre2_jit_get_target_)
|
||||
#define _pcre2_memctl_malloc PCRE2_SUFFIX(_pcre2_memctl_malloc_)
|
||||
#define _pcre2_ord2utf PCRE2_SUFFIX(_pcre2_ord2utf_)
|
||||
#define _pcre2_script_run PCRE2_SUFFIX(_pcre2_script_run_)
|
||||
#define _pcre2_strcmp PCRE2_SUFFIX(_pcre2_strcmp_)
|
||||
#define _pcre2_strcmp_c8 PCRE2_SUFFIX(_pcre2_strcmp_c8_)
|
||||
#define _pcre2_strcpy_c8 PCRE2_SUFFIX(_pcre2_strcpy_c8_)
|
||||
@ -1908,7 +1942,7 @@ is available. */
|
||||
extern int _pcre2_auto_possessify(PCRE2_UCHAR *, BOOL,
|
||||
const compile_block *);
|
||||
extern int _pcre2_check_escape(PCRE2_SPTR *, PCRE2_SPTR, uint32_t *,
|
||||
int *, uint32_t, BOOL, compile_block *);
|
||||
int *, uint32_t, uint32_t, BOOL, compile_block *);
|
||||
extern PCRE2_SPTR _pcre2_extuni(uint32_t, PCRE2_SPTR, PCRE2_SPTR, PCRE2_SPTR,
|
||||
BOOL, int *);
|
||||
extern PCRE2_SPTR _pcre2_find_bracket(PCRE2_SPTR, BOOL, int);
|
||||
@ -1920,6 +1954,7 @@ extern size_t _pcre2_jit_get_size(void *);
|
||||
const char * _pcre2_jit_get_target(void);
|
||||
extern void * _pcre2_memctl_malloc(size_t, pcre2_memctl *);
|
||||
extern unsigned int _pcre2_ord2utf(uint32_t, PCRE2_UCHAR *);
|
||||
extern BOOL _pcre2_script_run(PCRE2_SPTR, PCRE2_SPTR, BOOL);
|
||||
extern int _pcre2_strcmp(PCRE2_SPTR, PCRE2_SPTR);
|
||||
extern int _pcre2_strcmp_c8(PCRE2_SPTR, const char *);
|
||||
extern PCRE2_SIZE _pcre2_strcpy_c8(PCRE2_UCHAR *, const char *);
|
||||
|
5
src/3rdparty/pcre2/src/pcre2_intmodedep.h
vendored
5
src/3rdparty/pcre2/src/pcre2_intmodedep.h
vendored
@ -585,6 +585,8 @@ typedef struct pcre2_real_match_context {
|
||||
#endif
|
||||
int (*callout)(pcre2_callout_block *, void *);
|
||||
void *callout_data;
|
||||
int (*substitute_callout)(pcre2_substitute_callout_block *, void *);
|
||||
void *substitute_callout_data;
|
||||
PCRE2_SIZE offset_limit;
|
||||
uint32_t heap_limit;
|
||||
uint32_t match_limit;
|
||||
@ -656,7 +658,8 @@ typedef struct pcre2_real_match_data {
|
||||
PCRE2_SIZE leftchar; /* Offset to leftmost code unit */
|
||||
PCRE2_SIZE rightchar; /* Offset to rightmost code unit */
|
||||
PCRE2_SIZE startchar; /* Offset to starting code unit */
|
||||
uint16_t matchedby; /* Type of match (normal, JIT, DFA) */
|
||||
uint8_t matchedby; /* Type of match (normal, JIT, DFA) */
|
||||
uint8_t flags; /* Various flags */
|
||||
uint16_t oveccount; /* Number of pairs */
|
||||
int rc; /* The return code from the match */
|
||||
PCRE2_SIZE ovector[131072]; /* Must be last in the structure */
|
||||
|
2384
src/3rdparty/pcre2/src/pcre2_jit_compile.c
vendored
2384
src/3rdparty/pcre2/src/pcre2_jit_compile.c
vendored
File diff suppressed because it is too large
Load Diff
6
src/3rdparty/pcre2/src/pcre2_jit_match.c
vendored
6
src/3rdparty/pcre2/src/pcre2_jit_match.c
vendored
@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
|
||||
|
||||
Written by Philip Hazel
|
||||
Original API code Copyright (c) 1997-2012 University of Cambridge
|
||||
New API code Copyright (c) 2016 University of Cambridge
|
||||
New API code Copyright (c) 2016-2018 University of Cambridge
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
@ -152,8 +152,6 @@ else
|
||||
jit_stack = NULL;
|
||||
}
|
||||
|
||||
/* JIT only need two offsets for each ovector entry. Hence
|
||||
the last 1/3 of the ovector will never be touched. */
|
||||
|
||||
max_oveccount = functions->top_bracket;
|
||||
if (oveccount > max_oveccount)
|
||||
@ -173,7 +171,7 @@ else
|
||||
if (rc > (int)oveccount)
|
||||
rc = 0;
|
||||
match_data->code = re;
|
||||
match_data->subject = subject;
|
||||
match_data->subject = (rc >= 0 || rc == PCRE2_ERROR_PARTIAL)? subject : NULL;
|
||||
match_data->rc = rc;
|
||||
match_data->startchar = arguments.startchar_ptr - subject;
|
||||
match_data->leftchar = 0;
|
||||
|
26
src/3rdparty/pcre2/src/pcre2_maketables.c
vendored
26
src/3rdparty/pcre2/src/pcre2_maketables.c
vendored
@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
|
||||
|
||||
Written by Philip Hazel
|
||||
Original API code Copyright (c) 1997-2012 University of Cambridge
|
||||
New API code Copyright (c) 2016-2018 University of Cambridge
|
||||
New API code Copyright (c) 2016-2019 University of Cambridge
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
@ -114,17 +114,17 @@ test for alnum specially. */
|
||||
memset(p, 0, cbit_length);
|
||||
for (i = 0; i < 256; i++)
|
||||
{
|
||||
if (isdigit(i)) p[cbit_digit + i/8] |= 1 << (i&7);
|
||||
if (isupper(i)) p[cbit_upper + i/8] |= 1 << (i&7);
|
||||
if (islower(i)) p[cbit_lower + i/8] |= 1 << (i&7);
|
||||
if (isalnum(i)) p[cbit_word + i/8] |= 1 << (i&7);
|
||||
if (i == '_') p[cbit_word + i/8] |= 1 << (i&7);
|
||||
if (isspace(i)) p[cbit_space + i/8] |= 1 << (i&7);
|
||||
if (isxdigit(i))p[cbit_xdigit + i/8] |= 1 << (i&7);
|
||||
if (isgraph(i)) p[cbit_graph + i/8] |= 1 << (i&7);
|
||||
if (isprint(i)) p[cbit_print + i/8] |= 1 << (i&7);
|
||||
if (ispunct(i)) p[cbit_punct + i/8] |= 1 << (i&7);
|
||||
if (iscntrl(i)) p[cbit_cntrl + i/8] |= 1 << (i&7);
|
||||
if (isdigit(i)) p[cbit_digit + i/8] |= 1u << (i&7);
|
||||
if (isupper(i)) p[cbit_upper + i/8] |= 1u << (i&7);
|
||||
if (islower(i)) p[cbit_lower + i/8] |= 1u << (i&7);
|
||||
if (isalnum(i)) p[cbit_word + i/8] |= 1u << (i&7);
|
||||
if (i == '_') p[cbit_word + i/8] |= 1u << (i&7);
|
||||
if (isspace(i)) p[cbit_space + i/8] |= 1u << (i&7);
|
||||
if (isxdigit(i))p[cbit_xdigit + i/8] |= 1u << (i&7);
|
||||
if (isgraph(i)) p[cbit_graph + i/8] |= 1u << (i&7);
|
||||
if (isprint(i)) p[cbit_print + i/8] |= 1u << (i&7);
|
||||
if (ispunct(i)) p[cbit_punct + i/8] |= 1u << (i&7);
|
||||
if (iscntrl(i)) p[cbit_cntrl + i/8] |= 1u << (i&7);
|
||||
}
|
||||
p += cbit_length;
|
||||
|
||||
@ -138,8 +138,8 @@ for (i = 0; i < 256; i++)
|
||||
int x = 0;
|
||||
if (isspace(i)) x += ctype_space;
|
||||
if (isalpha(i)) x += ctype_letter;
|
||||
if (islower(i)) x += ctype_lcletter;
|
||||
if (isdigit(i)) x += ctype_digit;
|
||||
if (isxdigit(i)) x += ctype_xdigit;
|
||||
if (isalnum(i) || i == '_') x += ctype_word;
|
||||
*p++ = x;
|
||||
}
|
||||
|
88
src/3rdparty/pcre2/src/pcre2_match.c
vendored
88
src/3rdparty/pcre2/src/pcre2_match.c
vendored
@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
|
||||
|
||||
Written by Philip Hazel
|
||||
Original API code Copyright (c) 1997-2012 University of Cambridge
|
||||
New API code Copyright (c) 2015-2018 University of Cambridge
|
||||
New API code Copyright (c) 2015-2019 University of Cambridge
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
@ -69,11 +69,12 @@ information, and fields within it. */
|
||||
#define PUBLIC_MATCH_OPTIONS \
|
||||
(PCRE2_ANCHORED|PCRE2_ENDANCHORED|PCRE2_NOTBOL|PCRE2_NOTEOL|PCRE2_NOTEMPTY| \
|
||||
PCRE2_NOTEMPTY_ATSTART|PCRE2_NO_UTF_CHECK|PCRE2_PARTIAL_HARD| \
|
||||
PCRE2_PARTIAL_SOFT|PCRE2_NO_JIT)
|
||||
PCRE2_PARTIAL_SOFT|PCRE2_NO_JIT|PCRE2_COPY_MATCHED_SUBJECT)
|
||||
|
||||
#define PUBLIC_JIT_MATCH_OPTIONS \
|
||||
(PCRE2_NO_UTF_CHECK|PCRE2_NOTBOL|PCRE2_NOTEOL|PCRE2_NOTEMPTY|\
|
||||
PCRE2_NOTEMPTY_ATSTART|PCRE2_PARTIAL_SOFT|PCRE2_PARTIAL_HARD)
|
||||
PCRE2_NOTEMPTY_ATSTART|PCRE2_PARTIAL_SOFT|PCRE2_PARTIAL_HARD|\
|
||||
PCRE2_COPY_MATCHED_SUBJECT)
|
||||
|
||||
/* Non-error returns from and within the match() function. Error returns are
|
||||
externally defined PCRE2_ERROR_xxx codes, which are all negative. */
|
||||
@ -1848,7 +1849,7 @@ fprintf(stderr, "++ op=%d\n", *Fecode);
|
||||
if (Fop == OP_CLASS) RRETURN(MATCH_NOMATCH);
|
||||
}
|
||||
else
|
||||
if ((Lbyte_map[fc/8] & (1 << (fc&7))) == 0) RRETURN(MATCH_NOMATCH);
|
||||
if ((Lbyte_map[fc/8] & (1u << (fc&7))) == 0) RRETURN(MATCH_NOMATCH);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -1870,7 +1871,7 @@ fprintf(stderr, "++ op=%d\n", *Fecode);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
if ((Lbyte_map[fc/8] & (1 << (fc&7))) == 0) RRETURN(MATCH_NOMATCH);
|
||||
if ((Lbyte_map[fc/8] & (1u << (fc&7))) == 0) RRETURN(MATCH_NOMATCH);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1902,7 +1903,7 @@ fprintf(stderr, "++ op=%d\n", *Fecode);
|
||||
if (Fop == OP_CLASS) RRETURN(MATCH_NOMATCH);
|
||||
}
|
||||
else
|
||||
if ((Lbyte_map[fc/8] & (1 << (fc&7))) == 0) RRETURN(MATCH_NOMATCH);
|
||||
if ((Lbyte_map[fc/8] & (1u << (fc&7))) == 0) RRETURN(MATCH_NOMATCH);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -1927,7 +1928,7 @@ fprintf(stderr, "++ op=%d\n", *Fecode);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
if ((Lbyte_map[fc/8] & (1 << (fc&7))) == 0) RRETURN(MATCH_NOMATCH);
|
||||
if ((Lbyte_map[fc/8] & (1u << (fc&7))) == 0) RRETURN(MATCH_NOMATCH);
|
||||
}
|
||||
}
|
||||
/* Control never gets here */
|
||||
@ -1956,7 +1957,7 @@ fprintf(stderr, "++ op=%d\n", *Fecode);
|
||||
if (Fop == OP_CLASS) break;
|
||||
}
|
||||
else
|
||||
if ((Lbyte_map[fc/8] & (1 << (fc&7))) == 0) break;
|
||||
if ((Lbyte_map[fc/8] & (1u << (fc&7))) == 0) break;
|
||||
Feptr += len;
|
||||
}
|
||||
|
||||
@ -1993,7 +1994,7 @@ fprintf(stderr, "++ op=%d\n", *Fecode);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
if ((Lbyte_map[fc/8] & (1 << (fc&7))) == 0) break;
|
||||
if ((Lbyte_map[fc/8] & (1u << (fc&7))) == 0) break;
|
||||
Feptr++;
|
||||
}
|
||||
|
||||
@ -4084,7 +4085,7 @@ fprintf(stderr, "++ op=%d\n", *Fecode);
|
||||
GETCHAR(fc, fptr);
|
||||
}
|
||||
lgb = UCD_GRAPHBREAK(fc);
|
||||
if ((PRIV(ucp_gbtable)[lgb] & (1 << rgb)) == 0) break;
|
||||
if ((PRIV(ucp_gbtable)[lgb] & (1u << rgb)) == 0) break;
|
||||
Feptr = fptr;
|
||||
rgb = lgb;
|
||||
}
|
||||
@ -5014,6 +5015,7 @@ fprintf(stderr, "++ op=%d\n", *Fecode);
|
||||
must record a backtracking point and also set up a chained frame. */
|
||||
|
||||
case OP_ONCE:
|
||||
case OP_SCRIPT_RUN:
|
||||
case OP_SBRA:
|
||||
Lframe_type = GF_NOCAPTURE | Fop;
|
||||
|
||||
@ -5526,6 +5528,14 @@ fprintf(stderr, "++ op=%d\n", *Fecode);
|
||||
case OP_ASSERTBACK_NOT:
|
||||
RRETURN(MATCH_MATCH);
|
||||
|
||||
/* At the end of a script run, apply the script-checking rules. This code
|
||||
will never by exercised if Unicode support it not compiled, because in
|
||||
that environment script runs cause an error at compile time. */
|
||||
|
||||
case OP_SCRIPT_RUN:
|
||||
if (!PRIV(script_run)(P->eptr, Feptr, utf)) RRETURN(MATCH_NOMATCH);
|
||||
break;
|
||||
|
||||
/* Whole-pattern recursion is coded as a recurse into group 0, so it
|
||||
won't be picked up here. Instead, we catch it when the OP_END is reached.
|
||||
Other recursion is handled here. */
|
||||
@ -6000,10 +6010,11 @@ pcre2_match(const pcre2_code *code, PCRE2_SPTR subject, PCRE2_SIZE length,
|
||||
pcre2_match_context *mcontext)
|
||||
{
|
||||
int rc;
|
||||
int was_zero_terminated = 0;
|
||||
const uint8_t *start_bits = NULL;
|
||||
|
||||
const pcre2_real_code *re = (const pcre2_real_code *)code;
|
||||
|
||||
|
||||
BOOL anchored;
|
||||
BOOL firstline;
|
||||
BOOL has_first_cu = FALSE;
|
||||
@ -6043,7 +6054,11 @@ mb->stack_frames = (heapframe *)stack_frames_vector;
|
||||
/* A length equal to PCRE2_ZERO_TERMINATED implies a zero-terminated
|
||||
subject string. */
|
||||
|
||||
if (length == PCRE2_ZERO_TERMINATED) length = PRIV(strlen)(subject);
|
||||
if (length == PCRE2_ZERO_TERMINATED)
|
||||
{
|
||||
length = PRIV(strlen)(subject);
|
||||
was_zero_terminated = 1;
|
||||
}
|
||||
end_subject = subject + length;
|
||||
|
||||
/* Plausibility checks */
|
||||
@ -6158,6 +6173,17 @@ if (mcontext != NULL && mcontext->offset_limit != PCRE2_UNSET &&
|
||||
(re->overall_options & PCRE2_USE_OFFSET_LIMIT) == 0)
|
||||
return PCRE2_ERROR_BADOFFSETLIMIT;
|
||||
|
||||
/* If the match data block was previously used with PCRE2_COPY_MATCHED_SUBJECT,
|
||||
free the memory that was obtained. Set the field to NULL for no match cases. */
|
||||
|
||||
if ((match_data->flags & PCRE2_MD_COPIED_SUBJECT) != 0)
|
||||
{
|
||||
match_data->memctl.free((void *)match_data->subject,
|
||||
match_data->memctl.memory_data);
|
||||
match_data->flags &= ~PCRE2_MD_COPIED_SUBJECT;
|
||||
}
|
||||
match_data->subject = NULL;
|
||||
|
||||
/* If the pattern was successfully studied with JIT support, run the JIT
|
||||
executable instead of the rest of this function. Most options must be set at
|
||||
compile time for the JIT code to be usable. Fallback to the normal code path if
|
||||
@ -6169,7 +6195,19 @@ if (re->executable_jit != NULL && (options & ~PUBLIC_JIT_MATCH_OPTIONS) == 0)
|
||||
{
|
||||
rc = pcre2_jit_match(code, subject, length, start_offset, options,
|
||||
match_data, mcontext);
|
||||
if (rc != PCRE2_ERROR_JIT_BADOPTION) return rc;
|
||||
if (rc != PCRE2_ERROR_JIT_BADOPTION)
|
||||
{
|
||||
if (rc >= 0 && (options & PCRE2_COPY_MATCHED_SUBJECT) != 0)
|
||||
{
|
||||
length = CU2BYTES(length + was_zero_terminated);
|
||||
match_data->subject = match_data->memctl.malloc(length,
|
||||
match_data->memctl.memory_data);
|
||||
if (match_data->subject == NULL) return PCRE2_ERROR_NOMEMORY;
|
||||
memcpy((void *)match_data->subject, subject, length);
|
||||
match_data->flags |= PCRE2_MD_COPIED_SUBJECT;
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -6421,7 +6459,7 @@ for(;;)
|
||||
#if PCRE2_CODE_UNIT_WIDTH != 8
|
||||
if (c > 255) c = 255;
|
||||
#endif
|
||||
ok = (start_bits[c/8] & (1 << (c&7))) != 0;
|
||||
ok = (start_bits[c/8] & (1u << (c&7))) != 0;
|
||||
}
|
||||
}
|
||||
if (!ok)
|
||||
@ -6538,7 +6576,7 @@ for(;;)
|
||||
#if PCRE2_CODE_UNIT_WIDTH != 8
|
||||
if (c > 255) c = 255;
|
||||
#endif
|
||||
if ((start_bits[c/8] & (1 << (c&7))) != 0) break;
|
||||
if ((start_bits[c/8] & (1u << (c&7))) != 0) break;
|
||||
start_match++;
|
||||
}
|
||||
|
||||
@ -6809,13 +6847,13 @@ if (mb->match_frames != mb->stack_frames)
|
||||
/* Fill in fields that are always returned in the match data. */
|
||||
|
||||
match_data->code = re;
|
||||
match_data->subject = subject;
|
||||
match_data->mark = mb->mark;
|
||||
match_data->matchedby = PCRE2_MATCHEDBY_INTERPRETER;
|
||||
|
||||
/* Handle a fully successful match. Set the return code to the number of
|
||||
captured strings, or 0 if there were too many to fit into the ovector, and then
|
||||
set the remaining returned values before returning. */
|
||||
set the remaining returned values before returning. Make a copy of the subject
|
||||
string if requested. */
|
||||
|
||||
if (rc == MATCH_MATCH)
|
||||
{
|
||||
@ -6825,6 +6863,16 @@ if (rc == MATCH_MATCH)
|
||||
match_data->leftchar = mb->start_used_ptr - subject;
|
||||
match_data->rightchar = ((mb->last_used_ptr > mb->end_match_ptr)?
|
||||
mb->last_used_ptr : mb->end_match_ptr) - subject;
|
||||
if ((options & PCRE2_COPY_MATCHED_SUBJECT) != 0)
|
||||
{
|
||||
length = CU2BYTES(length + was_zero_terminated);
|
||||
match_data->subject = match_data->memctl.malloc(length,
|
||||
match_data->memctl.memory_data);
|
||||
if (match_data->subject == NULL) return PCRE2_ERROR_NOMEMORY;
|
||||
memcpy((void *)match_data->subject, subject, length);
|
||||
match_data->flags |= PCRE2_MD_COPIED_SUBJECT;
|
||||
}
|
||||
else match_data->subject = subject;
|
||||
return match_data->rc;
|
||||
}
|
||||
|
||||
@ -6838,10 +6886,14 @@ match_data->mark = mb->nomatch_mark;
|
||||
|
||||
if (rc != MATCH_NOMATCH && rc != PCRE2_ERROR_PARTIAL) match_data->rc = rc;
|
||||
|
||||
/* Handle a partial match. */
|
||||
/* Handle a partial match. If a "soft" partial match was requested, searching
|
||||
for a complete match will have continued, and the value of rc at this point
|
||||
will be MATCH_NOMATCH. For a "hard" partial match, it will already be
|
||||
PCRE2_ERROR_PARTIAL. */
|
||||
|
||||
else if (match_partial != NULL)
|
||||
{
|
||||
match_data->subject = subject;
|
||||
match_data->ovector[0] = match_partial - subject;
|
||||
match_data->ovector[1] = end_subject - subject;
|
||||
match_data->startchar = match_partial - subject;
|
||||
|
8
src/3rdparty/pcre2/src/pcre2_match_data.c
vendored
8
src/3rdparty/pcre2/src/pcre2_match_data.c
vendored
@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
|
||||
|
||||
Written by Philip Hazel
|
||||
Original API code Copyright (c) 1997-2012 University of Cambridge
|
||||
New API code Copyright (c) 2016-2017 University of Cambridge
|
||||
New API code Copyright (c) 2016-2018 University of Cambridge
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
@ -63,6 +63,7 @@ yield = PRIV(memctl_malloc)(
|
||||
(pcre2_memctl *)gcontext);
|
||||
if (yield == NULL) return NULL;
|
||||
yield->oveccount = oveccount;
|
||||
yield->flags = 0;
|
||||
return yield;
|
||||
}
|
||||
|
||||
@ -93,7 +94,12 @@ PCRE2_EXP_DEFN void PCRE2_CALL_CONVENTION
|
||||
pcre2_match_data_free(pcre2_match_data *match_data)
|
||||
{
|
||||
if (match_data != NULL)
|
||||
{
|
||||
if ((match_data->flags & PCRE2_MD_COPIED_SUBJECT) != 0)
|
||||
match_data->memctl.free((void *)match_data->subject,
|
||||
match_data->memctl.memory_data);
|
||||
match_data->memctl.free(match_data, match_data->memctl.memory_data);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
441
src/3rdparty/pcre2/src/pcre2_script_run.c
vendored
Normal file
441
src/3rdparty/pcre2/src/pcre2_script_run.c
vendored
Normal file
@ -0,0 +1,441 @@
|
||||
/*************************************************
|
||||
* Perl-Compatible Regular Expressions *
|
||||
*************************************************/
|
||||
|
||||
/* PCRE is a library of functions to support regular expressions whose syntax
|
||||
and semantics are as close as possible to those of the Perl 5 language.
|
||||
|
||||
Written by Philip Hazel
|
||||
Original API code Copyright (c) 1997-2012 University of Cambridge
|
||||
New API code Copyright (c) 2016-2018 University of Cambridge
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
* Neither the name of the University of Cambridge nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
-----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/* This module contains the function for checking a script run. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "pcre2_internal.h"
|
||||
|
||||
|
||||
/*************************************************
|
||||
* Check script run *
|
||||
*************************************************/
|
||||
|
||||
/* A script run is conceptually a sequence of characters all in the same
|
||||
Unicode script. However, it isn't quite that simple. There are special rules
|
||||
for scripts that are commonly used together, and also special rules for digits.
|
||||
This function implements the appropriate checks, which is possible only when
|
||||
PCRE2 is compiled with Unicode support. The function returns TRUE if there is
|
||||
no Unicode support; however, it should never be called in that circumstance
|
||||
because an error is given by pcre2_compile() if a script run is called for in a
|
||||
version of PCRE2 compiled without Unicode support.
|
||||
|
||||
Arguments:
|
||||
pgr point to the first character
|
||||
endptr point after the last character
|
||||
utf TRUE if in UTF mode
|
||||
|
||||
Returns: TRUE if this is a valid script run
|
||||
*/
|
||||
|
||||
/* These dummy values must be less than the negation of the largest offset in
|
||||
the PRIV(ucd_script_sets) vector, which is held in a 16-bit field in UCD
|
||||
records (and is only likely to be a few hundred). */
|
||||
|
||||
#define SCRIPT_UNSET (-99999)
|
||||
#define SCRIPT_HANPENDING (-99998)
|
||||
#define SCRIPT_HANHIRAKATA (-99997)
|
||||
#define SCRIPT_HANBOPOMOFO (-99996)
|
||||
#define SCRIPT_HANHANGUL (-99995)
|
||||
#define SCRIPT_LIST (-99994)
|
||||
|
||||
#define INTERSECTION_LIST_SIZE 50
|
||||
|
||||
BOOL
|
||||
PRIV(script_run)(PCRE2_SPTR ptr, PCRE2_SPTR endptr, BOOL utf)
|
||||
{
|
||||
#ifdef SUPPORT_UNICODE
|
||||
int require_script = SCRIPT_UNSET;
|
||||
uint8_t intersection_list[INTERSECTION_LIST_SIZE];
|
||||
const uint8_t *require_list = NULL;
|
||||
uint32_t require_digitset = 0;
|
||||
uint32_t c;
|
||||
|
||||
#if PCRE2_CODE_UNIT_WIDTH == 32
|
||||
(void)utf; /* Avoid compiler warning */
|
||||
#endif
|
||||
|
||||
/* Any string containing fewer than 2 characters is a valid script run. */
|
||||
|
||||
if (ptr >= endptr) return TRUE;
|
||||
GETCHARINCTEST(c, ptr);
|
||||
if (ptr >= endptr) return TRUE;
|
||||
|
||||
/* Scan strings of two or more characters, checking the Unicode characteristics
|
||||
of each code point. We make use of the Script Extensions property. There is
|
||||
special code for scripts that can be combined with characters from the Han
|
||||
Chinese script. This may be used in conjunction with four other scripts in
|
||||
these combinations:
|
||||
|
||||
. Han with Hiragana and Katakana is allowed (for Japanese).
|
||||
. Han with Bopomofo is allowed (for Taiwanese Mandarin).
|
||||
. Han with Hangul is allowed (for Korean).
|
||||
|
||||
If the first significant character's script is one of the four, the required
|
||||
script type is immediately known. However, if the first significant
|
||||
character's script is Han, we have to keep checking for a non-Han character.
|
||||
Hence the SCRIPT_HANPENDING state. */
|
||||
|
||||
for (;;)
|
||||
{
|
||||
const ucd_record *ucd = GET_UCD(c);
|
||||
int32_t scriptx = ucd->scriptx;
|
||||
|
||||
/* If the script extension is Unknown, the string is not a valid script run.
|
||||
Such characters can only form script runs of length one. */
|
||||
|
||||
if (scriptx == ucp_Unknown) return FALSE;
|
||||
|
||||
/* A character whose script extension is Inherited is always accepted with
|
||||
any script, and plays no further part in this testing. A character whose
|
||||
script is Common is always accepted, but must still be tested for a digit
|
||||
below. The scriptx value at this point is non-zero, because zero is
|
||||
ucp_Unknown, tested for above. */
|
||||
|
||||
if (scriptx != ucp_Inherited)
|
||||
{
|
||||
if (scriptx != ucp_Common)
|
||||
{
|
||||
/* If the script extension value is positive, the character is not a mark
|
||||
that can be used with many scripts. In the simple case we either set or
|
||||
compare with the required script. However, handling the scripts that can
|
||||
combine with Han are more complicated, as is the case when the previous
|
||||
characters have been man-script marks. */
|
||||
|
||||
if (scriptx > 0)
|
||||
{
|
||||
switch(require_script)
|
||||
{
|
||||
/* Either the first significant character (require_script unset) or
|
||||
after only Han characters. */
|
||||
|
||||
case SCRIPT_UNSET:
|
||||
case SCRIPT_HANPENDING:
|
||||
switch(scriptx)
|
||||
{
|
||||
case ucp_Han:
|
||||
require_script = SCRIPT_HANPENDING;
|
||||
break;
|
||||
|
||||
case ucp_Hiragana:
|
||||
case ucp_Katakana:
|
||||
require_script = SCRIPT_HANHIRAKATA;
|
||||
break;
|
||||
|
||||
case ucp_Bopomofo:
|
||||
require_script = SCRIPT_HANBOPOMOFO;
|
||||
break;
|
||||
|
||||
case ucp_Hangul:
|
||||
require_script = SCRIPT_HANHANGUL;
|
||||
break;
|
||||
|
||||
/* Not a Han-related script. If expecting one, fail. Otherise set
|
||||
the requirement to this script. */
|
||||
|
||||
default:
|
||||
if (require_script == SCRIPT_HANPENDING) return FALSE;
|
||||
require_script = scriptx;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
/* Previously encountered one of the "with Han" scripts. Check that
|
||||
this character is appropriate. */
|
||||
|
||||
case SCRIPT_HANHIRAKATA:
|
||||
if (scriptx != ucp_Han && scriptx != ucp_Hiragana &&
|
||||
scriptx != ucp_Katakana)
|
||||
return FALSE;
|
||||
break;
|
||||
|
||||
case SCRIPT_HANBOPOMOFO:
|
||||
if (scriptx != ucp_Han && scriptx != ucp_Bopomofo) return FALSE;
|
||||
break;
|
||||
|
||||
case SCRIPT_HANHANGUL:
|
||||
if (scriptx != ucp_Han && scriptx != ucp_Hangul) return FALSE;
|
||||
break;
|
||||
|
||||
/* We have a list of scripts to check that is derived from one or
|
||||
more previous characters. This is either one of the lists in
|
||||
ucd_script_sets[] (for one previous character) or the intersection of
|
||||
several lists for multiple characters. */
|
||||
|
||||
case SCRIPT_LIST:
|
||||
{
|
||||
const uint8_t *list;
|
||||
for (list = require_list; *list != 0; list++)
|
||||
{
|
||||
if (*list == scriptx) break;
|
||||
}
|
||||
if (*list == 0) return FALSE;
|
||||
}
|
||||
|
||||
/* The rest of the string must be in this script, but we have to
|
||||
allow for the Han complications. */
|
||||
|
||||
switch(scriptx)
|
||||
{
|
||||
case ucp_Han:
|
||||
require_script = SCRIPT_HANPENDING;
|
||||
break;
|
||||
|
||||
case ucp_Hiragana:
|
||||
case ucp_Katakana:
|
||||
require_script = SCRIPT_HANHIRAKATA;
|
||||
break;
|
||||
|
||||
case ucp_Bopomofo:
|
||||
require_script = SCRIPT_HANBOPOMOFO;
|
||||
break;
|
||||
|
||||
case ucp_Hangul:
|
||||
require_script = SCRIPT_HANHANGUL;
|
||||
break;
|
||||
|
||||
default:
|
||||
require_script = scriptx;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
/* This is the easy case when a single script is required. */
|
||||
|
||||
default:
|
||||
if (scriptx != require_script) return FALSE;
|
||||
break;
|
||||
}
|
||||
} /* End of handing positive scriptx */
|
||||
|
||||
/* If scriptx is negative, this character is a mark-type character that
|
||||
has a list of permitted scripts. */
|
||||
|
||||
else
|
||||
{
|
||||
uint32_t chspecial;
|
||||
const uint8_t *clist, *rlist;
|
||||
const uint8_t *list = PRIV(ucd_script_sets) - scriptx;
|
||||
|
||||
switch(require_script)
|
||||
{
|
||||
case SCRIPT_UNSET:
|
||||
require_list = PRIV(ucd_script_sets) - scriptx;
|
||||
require_script = SCRIPT_LIST;
|
||||
break;
|
||||
|
||||
/* An inspection of the Unicode 11.0.0 files shows that there are the
|
||||
following types of Script Extension list that involve the Han,
|
||||
Bopomofo, Hiragana, Katakana, and Hangul scripts:
|
||||
|
||||
. Bopomofo + Han
|
||||
. Han + Hiragana + Katakana
|
||||
. Hiragana + Katakana
|
||||
. Bopopmofo + Hangul + Han + Hiragana + Katakana
|
||||
|
||||
The following code tries to make sense of this. */
|
||||
|
||||
#define FOUND_BOPOMOFO 1
|
||||
#define FOUND_HIRAGANA 2
|
||||
#define FOUND_KATAKANA 4
|
||||
#define FOUND_HANGUL 8
|
||||
|
||||
case SCRIPT_HANPENDING:
|
||||
chspecial = 0;
|
||||
for (; *list != 0; list++)
|
||||
{
|
||||
switch (*list)
|
||||
{
|
||||
case ucp_Bopomofo: chspecial |= FOUND_BOPOMOFO; break;
|
||||
case ucp_Hiragana: chspecial |= FOUND_HIRAGANA; break;
|
||||
case ucp_Katakana: chspecial |= FOUND_KATAKANA; break;
|
||||
case ucp_Hangul: chspecial |= FOUND_HANGUL; break;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
|
||||
if (chspecial == 0) return FALSE;
|
||||
|
||||
if (chspecial == FOUND_BOPOMOFO)
|
||||
{
|
||||
require_script = SCRIPT_HANBOPOMOFO;
|
||||
}
|
||||
else if (chspecial == (FOUND_HIRAGANA|FOUND_KATAKANA))
|
||||
{
|
||||
require_script = SCRIPT_HANHIRAKATA;
|
||||
}
|
||||
|
||||
/* Otherwise it must be allowed with all of them, so remain in
|
||||
the pending state. */
|
||||
|
||||
break;
|
||||
|
||||
case SCRIPT_HANHIRAKATA:
|
||||
for (; *list != 0; list++)
|
||||
{
|
||||
if (*list == ucp_Hiragana || *list == ucp_Katakana) break;
|
||||
}
|
||||
if (*list == 0) return FALSE;
|
||||
break;
|
||||
|
||||
case SCRIPT_HANBOPOMOFO:
|
||||
for (; *list != 0; list++)
|
||||
{
|
||||
if (*list == ucp_Bopomofo) break;
|
||||
}
|
||||
if (*list == 0) return FALSE;
|
||||
break;
|
||||
|
||||
case SCRIPT_HANHANGUL:
|
||||
for (; *list != 0; list++)
|
||||
{
|
||||
if (*list == ucp_Hangul) break;
|
||||
}
|
||||
if (*list == 0) return FALSE;
|
||||
break;
|
||||
|
||||
/* Previously encountered one or more characters that are allowed
|
||||
with a list of scripts. Build the intersection of the required list
|
||||
with this character's list in intersection_list[]. This code is
|
||||
written so that it still works OK if the required list is already in
|
||||
that vector. */
|
||||
|
||||
case SCRIPT_LIST:
|
||||
{
|
||||
int i = 0;
|
||||
for (rlist = require_list; *rlist != 0; rlist++)
|
||||
{
|
||||
for (clist = list; *clist != 0; clist++)
|
||||
{
|
||||
if (*rlist == *clist)
|
||||
{
|
||||
intersection_list[i++] = *rlist;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (i == 0) return FALSE; /* No scripts in common */
|
||||
|
||||
/* If there's just one script in common, we can set it as the
|
||||
unique required script. Otherwise, terminate the intersection list
|
||||
and make it the required list. */
|
||||
|
||||
if (i == 1)
|
||||
{
|
||||
require_script = intersection_list[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
intersection_list[i] = 0;
|
||||
require_list = intersection_list;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
/* The previously set required script is a single script, not
|
||||
Han-related. Check that it is in this character's list. */
|
||||
|
||||
default:
|
||||
for (; *list != 0; list++)
|
||||
{
|
||||
if (*list == require_script) break;
|
||||
}
|
||||
if (*list == 0) return FALSE;
|
||||
break;
|
||||
}
|
||||
} /* End of handling negative scriptx */
|
||||
} /* End of checking non-Common character */
|
||||
|
||||
/* The character is in an acceptable script. We must now ensure that all
|
||||
decimal digits in the string come from the same set. Some scripts (e.g.
|
||||
Common, Arabic) have more than one set of decimal digits. This code does
|
||||
not allow mixing sets, even within the same script. The vector called
|
||||
PRIV(ucd_digit_sets)[] contains, in its first element, the number of
|
||||
following elements, and then, in ascending order, the code points of the
|
||||
'9' characters in every set of 10 digits. Each set is identified by the
|
||||
offset in the vector of its '9' character. An initial check of the first
|
||||
value picks up ASCII digits quickly. Otherwise, a binary chop is used. */
|
||||
|
||||
if (ucd->chartype == ucp_Nd)
|
||||
{
|
||||
uint32_t digitset;
|
||||
|
||||
if (c <= PRIV(ucd_digit_sets)[1]) digitset = 1; else
|
||||
{
|
||||
int mid;
|
||||
int bot = 1;
|
||||
int top = PRIV(ucd_digit_sets)[0];
|
||||
for (;;)
|
||||
{
|
||||
if (top <= bot + 1) /* <= rather than == is paranoia */
|
||||
{
|
||||
digitset = top;
|
||||
break;
|
||||
}
|
||||
mid = (top + bot) / 2;
|
||||
if (c <= PRIV(ucd_digit_sets)[mid]) top = mid; else bot = mid;
|
||||
}
|
||||
}
|
||||
|
||||
/* A required value of 0 means "unset". */
|
||||
|
||||
if (require_digitset == 0) require_digitset = digitset;
|
||||
else if (digitset != require_digitset) return FALSE;
|
||||
} /* End digit handling */
|
||||
} /* End checking non-Inherited character */
|
||||
|
||||
/* If we haven't yet got to the end, pick up the next character. */
|
||||
|
||||
if (ptr >= endptr) return TRUE;
|
||||
GETCHARINCTEST(c, ptr);
|
||||
} /* End checking loop */
|
||||
|
||||
#else /* NOT SUPPORT_UNICODE */
|
||||
(void)ptr;
|
||||
(void)endptr;
|
||||
(void)utf;
|
||||
return TRUE;
|
||||
#endif /* SUPPORT_UNICODE */
|
||||
}
|
||||
|
||||
/* End of pcre2_script_run.c */
|
16
src/3rdparty/pcre2/src/pcre2_study.c
vendored
16
src/3rdparty/pcre2/src/pcre2_study.c
vendored
@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
|
||||
|
||||
Written by Philip Hazel
|
||||
Original API code Copyright (c) 1997-2012 University of Cambridge
|
||||
New API code Copyright (c) 2016-2018 University of Cambridge
|
||||
New API code Copyright (c) 2016-2019 University of Cambridge
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
@ -54,7 +54,7 @@ collecting data (e.g. minimum matching length). */
|
||||
|
||||
/* Set a bit in the starting code unit bit map. */
|
||||
|
||||
#define SET_BIT(c) re->start_bitmap[(c)/8] |= (1 << ((c)&7))
|
||||
#define SET_BIT(c) re->start_bitmap[(c)/8] |= (1u << ((c)&7))
|
||||
|
||||
/* Returns from set_start_bits() */
|
||||
|
||||
@ -171,6 +171,7 @@ for (;;)
|
||||
/* Fall through */
|
||||
|
||||
case OP_ONCE:
|
||||
case OP_SCRIPT_RUN:
|
||||
case OP_SBRA:
|
||||
case OP_BRAPOS:
|
||||
case OP_SBRAPOS:
|
||||
@ -842,7 +843,7 @@ for (c = 0; c < table_limit; c++)
|
||||
if (table_limit == 32) return;
|
||||
for (c = 128; c < 256; c++)
|
||||
{
|
||||
if ((re->tables[cbits_offset + c/8] & (1 << (c&7))) != 0)
|
||||
if ((re->tables[cbits_offset + c/8] & (1u << (c&7))) != 0)
|
||||
{
|
||||
PCRE2_UCHAR buff[6];
|
||||
(void)PRIV(ord2utf)(c, buff);
|
||||
@ -1075,6 +1076,7 @@ do
|
||||
case OP_CBRAPOS:
|
||||
case OP_SCBRAPOS:
|
||||
case OP_ONCE:
|
||||
case OP_SCRIPT_RUN:
|
||||
case OP_ASSERT:
|
||||
rc = set_start_bits(re, tcode, utf);
|
||||
if (rc == SSB_FAIL || rc == SSB_UNKNOWN) return rc;
|
||||
@ -1505,11 +1507,11 @@ do
|
||||
for (c = 0; c < 16; c++) re->start_bitmap[c] |= classmap[c];
|
||||
for (c = 128; c < 256; c++)
|
||||
{
|
||||
if ((classmap[c/8] & (1 << (c&7))) != 0)
|
||||
if ((classmap[c/8] & (1u << (c&7))) != 0)
|
||||
{
|
||||
int d = (c >> 6) | 0xc0; /* Set bit for this starter */
|
||||
re->start_bitmap[d/8] |= (1 << (d&7)); /* and then skip on to the */
|
||||
c = (c & 0xc0) + 0x40 - 1; /* next relevant character. */
|
||||
int d = (c >> 6) | 0xc0; /* Set bit for this starter */
|
||||
re->start_bitmap[d/8] |= (1u << (d&7)); /* and then skip on to the */
|
||||
c = (c & 0xc0) + 0x40 - 1; /* next relevant character. */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
67
src/3rdparty/pcre2/src/pcre2_substitute.c
vendored
67
src/3rdparty/pcre2/src/pcre2_substitute.c
vendored
@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
|
||||
|
||||
Written by Philip Hazel
|
||||
Original API code Copyright (c) 1997-2012 University of Cambridge
|
||||
New API code Copyright (c) 2016-2018 University of Cambridge
|
||||
New API code Copyright (c) 2016-2019 University of Cambridge
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
@ -129,7 +129,7 @@ for (; ptr < ptrend; ptr++)
|
||||
|
||||
ptr += 1; /* Must point after \ */
|
||||
erc = PRIV(check_escape)(&ptr, ptrend, &ch, &errorcode,
|
||||
code->overall_options, FALSE, NULL);
|
||||
code->overall_options, code->extra_options, FALSE, NULL);
|
||||
ptr -= 1; /* Back to last code unit of escape */
|
||||
if (errorcode != 0)
|
||||
{
|
||||
@ -239,13 +239,17 @@ PCRE2_SIZE extra_needed = 0;
|
||||
PCRE2_SIZE buff_offset, buff_length, lengthleft, fraglength;
|
||||
PCRE2_SIZE *ovector;
|
||||
PCRE2_SIZE ovecsave[3];
|
||||
pcre2_substitute_callout_block scb;
|
||||
|
||||
/* General initialization */
|
||||
|
||||
buff_offset = 0;
|
||||
lengthleft = buff_length = *blength;
|
||||
*blength = PCRE2_UNSET;
|
||||
ovecsave[0] = ovecsave[1] = ovecsave[2] = PCRE2_UNSET;
|
||||
|
||||
/* Partial matching is not valid. */
|
||||
/* Partial matching is not valid. This must come after setting *blength to
|
||||
PCRE2_UNSET, so as not to imply an offset in the replacement. */
|
||||
|
||||
if ((options & (PCRE2_PARTIAL_HARD|PCRE2_PARTIAL_SOFT)) != 0)
|
||||
return PCRE2_ERROR_BADOPTION;
|
||||
@ -264,6 +268,13 @@ if (match_data == NULL)
|
||||
ovector = pcre2_get_ovector_pointer(match_data);
|
||||
ovector_count = pcre2_get_ovector_count(match_data);
|
||||
|
||||
/* Fixed things in the callout block */
|
||||
|
||||
scb.version = 0;
|
||||
scb.input = subject;
|
||||
scb.output = (PCRE2_SPTR)buffer;
|
||||
scb.ovector = ovector;
|
||||
|
||||
/* Find lengths of zero-terminated strings and the end of the replacement. */
|
||||
|
||||
if (length == PCRE2_ZERO_TERMINATED) length = PRIV(strlen)(subject);
|
||||
@ -390,7 +401,7 @@ do
|
||||
rc = PCRE2_ERROR_INTERNAL_DUPMATCH;
|
||||
goto EXIT;
|
||||
}
|
||||
|
||||
|
||||
/* Count substitutions with a paranoid check for integer overflow; surely no
|
||||
real call to this function would ever hit this! */
|
||||
|
||||
@ -401,11 +412,14 @@ do
|
||||
}
|
||||
subs++;
|
||||
|
||||
/* Copy the text leading up to the match. */
|
||||
/* Copy the text leading up to the match, and remember where the insert
|
||||
begins and how many ovector pairs are set. */
|
||||
|
||||
if (rc == 0) rc = ovector_count;
|
||||
fraglength = ovector[0] - start_offset;
|
||||
CHECKMEMCPY(subject + start_offset, fraglength);
|
||||
scb.output_offsets[0] = buff_offset;
|
||||
scb.oveccount = rc;
|
||||
|
||||
/* Process the replacement string. Literal mode is set by \Q, but only in
|
||||
extended mode when backslashes are being interpreted. In extended mode we
|
||||
@ -421,7 +435,7 @@ do
|
||||
|
||||
if (ptr >= repend)
|
||||
{
|
||||
if (ptrstackptr <= 0) break; /* End of replacement string */
|
||||
if (ptrstackptr == 0) break; /* End of replacement string */
|
||||
repend = ptrstack[--ptrstackptr];
|
||||
ptr = ptrstack[--ptrstackptr];
|
||||
continue;
|
||||
@ -702,7 +716,7 @@ do
|
||||
{
|
||||
if (((code->tables + cbits_offset +
|
||||
((forcecase > 0)? cbit_upper:cbit_lower)
|
||||
)[ch/8] & (1 << (ch%8))) == 0)
|
||||
)[ch/8] & (1u << (ch%8))) == 0)
|
||||
ch = (code->tables + fcc_offset)[ch];
|
||||
}
|
||||
forcecase = forcecasereset;
|
||||
@ -760,7 +774,7 @@ do
|
||||
|
||||
ptr++; /* Point after \ */
|
||||
rc = PRIV(check_escape)(&ptr, repend, &ch, &errorcode,
|
||||
code->overall_options, FALSE, NULL);
|
||||
code->overall_options, code->extra_options, FALSE, NULL);
|
||||
if (errorcode != 0) goto BADESCAPE;
|
||||
|
||||
switch(rc)
|
||||
@ -804,7 +818,7 @@ do
|
||||
{
|
||||
if (((code->tables + cbits_offset +
|
||||
((forcecase > 0)? cbit_upper:cbit_lower)
|
||||
)[ch/8] & (1 << (ch%8))) == 0)
|
||||
)[ch/8] & (1u << (ch%8))) == 0)
|
||||
ch = (code->tables + fcc_offset)[ch];
|
||||
}
|
||||
forcecase = forcecasereset;
|
||||
@ -821,10 +835,37 @@ do
|
||||
} /* End handling a literal code unit */
|
||||
} /* End of loop for scanning the replacement. */
|
||||
|
||||
/* The replacement has been copied to the output. Save the details of this
|
||||
match. See above for how this data is used. If we matched an empty string, do
|
||||
the magic for global matches. Finally, update the start offset to point to
|
||||
the rest of the subject string. */
|
||||
/* The replacement has been copied to the output, or its size has been
|
||||
remembered. Do the callout if there is one and we have done an actual
|
||||
replacement. */
|
||||
|
||||
if (!overflowed && mcontext != NULL && mcontext->substitute_callout != NULL)
|
||||
{
|
||||
scb.subscount = subs;
|
||||
scb.output_offsets[1] = buff_offset;
|
||||
rc = mcontext->substitute_callout(&scb, mcontext->substitute_callout_data);
|
||||
|
||||
/* A non-zero return means cancel this substitution. Instead, copy the
|
||||
matched string fragment. */
|
||||
|
||||
if (rc != 0)
|
||||
{
|
||||
PCRE2_SIZE newlength = scb.output_offsets[1] - scb.output_offsets[0];
|
||||
PCRE2_SIZE oldlength = ovector[1] - ovector[0];
|
||||
|
||||
buff_offset -= newlength;
|
||||
lengthleft += newlength;
|
||||
CHECKMEMCPY(subject + ovector[0], oldlength);
|
||||
|
||||
/* A negative return means do not do any more. */
|
||||
|
||||
if (rc < 0) suboptions &= (~PCRE2_SUBSTITUTE_GLOBAL);
|
||||
}
|
||||
}
|
||||
|
||||
/* Save the details of this match. See above for how this data is used. If we
|
||||
matched an empty string, do the magic for global matches. Finally, update the
|
||||
start offset to point to the rest of the subject string. */
|
||||
|
||||
ovecsave[0] = ovector[0];
|
||||
ovecsave[1] = ovector[1];
|
||||
|
71
src/3rdparty/pcre2/src/pcre2_tables.c
vendored
71
src/3rdparty/pcre2/src/pcre2_tables.c
vendored
@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
|
||||
|
||||
Written by Philip Hazel
|
||||
Original API code Copyright (c) 1997-2012 University of Cambridge
|
||||
New API code Copyright (c) 2016-2018 University of Cambridge
|
||||
New API code Copyright (c) 2016-2019 University of Cambridge
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
@ -142,7 +142,7 @@ ucp_gbXX values defined in pcre2_ucp.h. These changed between Unicode versions
|
||||
code points. The left property selects a word from the table, and the right
|
||||
property selects a bit from that word like this:
|
||||
|
||||
PRIV(ucp_gbtable)[left-property] & (1 << right-property)
|
||||
PRIV(ucp_gbtable)[left-property] & (1u << right-property)
|
||||
|
||||
The value is non-zero if a grapheme break is NOT permitted between the relevant
|
||||
two code points. The breaking rules are as follows:
|
||||
@ -183,25 +183,25 @@ are implementing).
|
||||
#define ESZ (1<<ucp_gbExtend)|(1<<ucp_gbSpacingMark)|(1<<ucp_gbZWJ)
|
||||
|
||||
const uint32_t PRIV(ucp_gbtable)[] = {
|
||||
(1<<ucp_gbLF), /* 0 CR */
|
||||
0, /* 1 LF */
|
||||
0, /* 2 Control */
|
||||
ESZ, /* 3 Extend */
|
||||
ESZ|(1<<ucp_gbPrepend)| /* 4 Prepend */
|
||||
(1<<ucp_gbL)|(1<<ucp_gbV)|(1<<ucp_gbT)|
|
||||
(1<<ucp_gbLV)|(1<<ucp_gbLVT)|(1<<ucp_gbOther)|
|
||||
(1<<ucp_gbRegionalIndicator),
|
||||
ESZ, /* 5 SpacingMark */
|
||||
ESZ|(1<<ucp_gbL)|(1<<ucp_gbV)|(1<<ucp_gbLV)| /* 6 L */
|
||||
(1<<ucp_gbLVT),
|
||||
ESZ|(1<<ucp_gbV)|(1<<ucp_gbT), /* 7 V */
|
||||
ESZ|(1<<ucp_gbT), /* 8 T */
|
||||
ESZ|(1<<ucp_gbV)|(1<<ucp_gbT), /* 9 LV */
|
||||
ESZ|(1<<ucp_gbT), /* 10 LVT */
|
||||
(1<<ucp_gbRegionalIndicator), /* 11 RegionalIndicator */
|
||||
ESZ, /* 12 Other */
|
||||
ESZ, /* 13 ZWJ */
|
||||
ESZ|(1<<ucp_gbExtended_Pictographic) /* 14 Extended Pictographic */
|
||||
(1u<<ucp_gbLF), /* 0 CR */
|
||||
0, /* 1 LF */
|
||||
0, /* 2 Control */
|
||||
ESZ, /* 3 Extend */
|
||||
ESZ|(1u<<ucp_gbPrepend)| /* 4 Prepend */
|
||||
(1u<<ucp_gbL)|(1u<<ucp_gbV)|(1u<<ucp_gbT)|
|
||||
(1u<<ucp_gbLV)|(1u<<ucp_gbLVT)|(1u<<ucp_gbOther)|
|
||||
(1u<<ucp_gbRegionalIndicator),
|
||||
ESZ, /* 5 SpacingMark */
|
||||
ESZ|(1u<<ucp_gbL)|(1u<<ucp_gbV)|(1u<<ucp_gbLV)| /* 6 L */
|
||||
(1u<<ucp_gbLVT),
|
||||
ESZ|(1u<<ucp_gbV)|(1u<<ucp_gbT), /* 7 V */
|
||||
ESZ|(1u<<ucp_gbT), /* 8 T */
|
||||
ESZ|(1u<<ucp_gbV)|(1u<<ucp_gbT), /* 9 LV */
|
||||
ESZ|(1u<<ucp_gbT), /* 10 LVT */
|
||||
(1u<<ucp_gbRegionalIndicator), /* 11 RegionalIndicator */
|
||||
ESZ, /* 12 Other */
|
||||
ESZ, /* 13 ZWJ */
|
||||
ESZ|(1u<<ucp_gbExtended_Pictographic) /* 14 Extended Pictographic */
|
||||
};
|
||||
|
||||
#undef ESZ
|
||||
@ -417,6 +417,7 @@ strings to make sure that UTF-8 support works on EBCDIC platforms. */
|
||||
#define STRING_Tifinagh0 STR_T STR_i STR_f STR_i STR_n STR_a STR_g STR_h "\0"
|
||||
#define STRING_Tirhuta0 STR_T STR_i STR_r STR_h STR_u STR_t STR_a "\0"
|
||||
#define STRING_Ugaritic0 STR_U STR_g STR_a STR_r STR_i STR_t STR_i STR_c "\0"
|
||||
#define STRING_Unknown0 STR_U STR_n STR_k STR_n STR_o STR_w STR_n "\0"
|
||||
#define STRING_Vai0 STR_V STR_a STR_i "\0"
|
||||
#define STRING_Warang_Citi0 STR_W STR_a STR_r STR_a STR_n STR_g STR_UNDERSCORE STR_C STR_i STR_t STR_i "\0"
|
||||
#define STRING_Xan0 STR_X STR_a STR_n "\0"
|
||||
@ -611,6 +612,7 @@ const char PRIV(utt_names)[] =
|
||||
STRING_Tifinagh0
|
||||
STRING_Tirhuta0
|
||||
STRING_Ugaritic0
|
||||
STRING_Unknown0
|
||||
STRING_Vai0
|
||||
STRING_Warang_Citi0
|
||||
STRING_Xan0
|
||||
@ -805,19 +807,20 @@ const ucp_type_table PRIV(utt)[] = {
|
||||
{ 1424, PT_SC, ucp_Tifinagh },
|
||||
{ 1433, PT_SC, ucp_Tirhuta },
|
||||
{ 1441, PT_SC, ucp_Ugaritic },
|
||||
{ 1450, PT_SC, ucp_Vai },
|
||||
{ 1454, PT_SC, ucp_Warang_Citi },
|
||||
{ 1466, PT_ALNUM, 0 },
|
||||
{ 1470, PT_PXSPACE, 0 },
|
||||
{ 1474, PT_SPACE, 0 },
|
||||
{ 1478, PT_UCNC, 0 },
|
||||
{ 1482, PT_WORD, 0 },
|
||||
{ 1486, PT_SC, ucp_Yi },
|
||||
{ 1489, PT_GC, ucp_Z },
|
||||
{ 1491, PT_SC, ucp_Zanabazar_Square },
|
||||
{ 1508, PT_PC, ucp_Zl },
|
||||
{ 1511, PT_PC, ucp_Zp },
|
||||
{ 1514, PT_PC, ucp_Zs }
|
||||
{ 1450, PT_SC, ucp_Unknown },
|
||||
{ 1458, PT_SC, ucp_Vai },
|
||||
{ 1462, PT_SC, ucp_Warang_Citi },
|
||||
{ 1474, PT_ALNUM, 0 },
|
||||
{ 1478, PT_PXSPACE, 0 },
|
||||
{ 1482, PT_SPACE, 0 },
|
||||
{ 1486, PT_UCNC, 0 },
|
||||
{ 1490, PT_WORD, 0 },
|
||||
{ 1494, PT_SC, ucp_Yi },
|
||||
{ 1497, PT_GC, ucp_Z },
|
||||
{ 1499, PT_SC, ucp_Zanabazar_Square },
|
||||
{ 1516, PT_PC, ucp_Zl },
|
||||
{ 1519, PT_PC, ucp_Zp },
|
||||
{ 1522, PT_PC, ucp_Zs }
|
||||
};
|
||||
|
||||
const size_t PRIV(utt_size) = sizeof(PRIV(utt)) / sizeof(ucp_type_table);
|
||||
|
7235
src/3rdparty/pcre2/src/pcre2_ucd.c
vendored
7235
src/3rdparty/pcre2/src/pcre2_ucd.c
vendored
File diff suppressed because it is too large
Load Diff
1
src/3rdparty/pcre2/src/pcre2_ucp.h
vendored
1
src/3rdparty/pcre2/src/pcre2_ucp.h
vendored
@ -124,6 +124,7 @@ enum {
|
||||
/* These are the script identifications. */
|
||||
|
||||
enum {
|
||||
ucp_Unknown,
|
||||
ucp_Arabic,
|
||||
ucp_Armenian,
|
||||
ucp_Bengali,
|
||||
|
6
src/3rdparty/pcre2/src/pcre2_xclass.c
vendored
6
src/3rdparty/pcre2/src/pcre2_xclass.c
vendored
@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
|
||||
|
||||
Written by Philip Hazel
|
||||
Original API code Copyright (c) 1997-2012 University of Cambridge
|
||||
New API code Copyright (c) 2016 University of Cambridge
|
||||
New API code Copyright (c) 2016-2019 University of Cambridge
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
@ -85,10 +85,10 @@ if (c < 256)
|
||||
if ((*data & XCL_HASPROP) == 0)
|
||||
{
|
||||
if ((*data & XCL_MAP) == 0) return negated;
|
||||
return (((uint8_t *)(data + 1))[c/8] & (1 << (c&7))) != 0;
|
||||
return (((uint8_t *)(data + 1))[c/8] & (1u << (c&7))) != 0;
|
||||
}
|
||||
if ((*data & XCL_MAP) != 0 &&
|
||||
(((uint8_t *)(data + 1))[c/8] & (1 << (c&7))) != 0)
|
||||
(((uint8_t *)(data + 1))[c/8] & (1u << (c&7))) != 0)
|
||||
return !negated; /* char found */
|
||||
}
|
||||
|
||||
|
@ -530,7 +530,7 @@ typedef double sljit_f64;
|
||||
#endif /* !SLJIT_FUNC */
|
||||
|
||||
#ifndef SLJIT_INDIRECT_CALL
|
||||
#if ((defined SLJIT_CONFIG_PPC_64 && SLJIT_CONFIG_PPC_64) && (defined SLJIT_BIG_ENDIAN && SLJIT_BIG_ENDIAN)) \
|
||||
#if ((defined SLJIT_CONFIG_PPC_64 && SLJIT_CONFIG_PPC_64) && (!defined _CALL_ELF || _CALL_ELF == 1)) \
|
||||
|| ((defined SLJIT_CONFIG_PPC_32 && SLJIT_CONFIG_PPC_32) && defined _AIX)
|
||||
/* It seems certain ppc compilers use an indirect addressing for functions
|
||||
which makes things complicated. */
|
||||
|
@ -94,6 +94,46 @@ static SLJIT_INLINE void free_chunk(void *chunk, sljit_uw size)
|
||||
|
||||
#else
|
||||
|
||||
#ifdef __APPLE__
|
||||
/* Configures TARGET_OS_OSX when appropriate */
|
||||
#include <TargetConditionals.h>
|
||||
|
||||
#if TARGET_OS_OSX && defined(MAP_JIT)
|
||||
#include <sys/utsname.h>
|
||||
#endif /* TARGET_OS_OSX && MAP_JIT */
|
||||
|
||||
#ifdef MAP_JIT
|
||||
|
||||
static SLJIT_INLINE int get_map_jit_flag()
|
||||
{
|
||||
#if TARGET_OS_OSX
|
||||
/* On macOS systems, returns MAP_JIT if it is defined _and_ we're running on a version
|
||||
of macOS where it's OK to have more than one JIT block. On non-macOS systems, returns
|
||||
MAP_JIT if it is defined. */
|
||||
static int map_jit_flag = -1;
|
||||
|
||||
/* The following code is thread safe because multiple initialization
|
||||
sets map_jit_flag to the same value and the code has no side-effects.
|
||||
Changing the kernel version witout system restart is (very) unlikely. */
|
||||
if (map_jit_flag == -1) {
|
||||
struct utsname name;
|
||||
|
||||
uname(&name);
|
||||
|
||||
/* Kernel version for 10.14.0 (Mojave) */
|
||||
map_jit_flag = (atoi(name.release) >= 18) ? MAP_JIT : 0;
|
||||
}
|
||||
|
||||
return map_jit_flag;
|
||||
#else /* !TARGET_OS_OSX */
|
||||
return MAP_JIT;
|
||||
#endif /* TARGET_OS_OSX */
|
||||
}
|
||||
|
||||
#endif /* MAP_JIT */
|
||||
|
||||
#endif /* __APPLE__ */
|
||||
|
||||
static SLJIT_INLINE void* alloc_chunk(sljit_uw size)
|
||||
{
|
||||
void *retval;
|
||||
@ -103,17 +143,17 @@ static SLJIT_INLINE void* alloc_chunk(sljit_uw size)
|
||||
int flags = MAP_PRIVATE | MAP_ANON;
|
||||
|
||||
#ifdef MAP_JIT
|
||||
flags |= MAP_JIT;
|
||||
flags |= get_map_jit_flag();
|
||||
#endif
|
||||
|
||||
retval = mmap(NULL, size, PROT_READ | PROT_WRITE | PROT_EXEC, flags, -1, 0);
|
||||
#else
|
||||
#else /* !MAP_ANON */
|
||||
if (dev_zero < 0) {
|
||||
if (open_dev_zero())
|
||||
return NULL;
|
||||
}
|
||||
retval = mmap(NULL, size, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE, dev_zero, 0);
|
||||
#endif
|
||||
#endif /* MAP_ANON */
|
||||
|
||||
return (retval != MAP_FAILED) ? retval : NULL;
|
||||
}
|
||||
|
11
src/3rdparty/pcre2/src/sljit/sljitLir.c
vendored
11
src/3rdparty/pcre2/src/sljit/sljitLir.c
vendored
@ -201,15 +201,16 @@
|
||||
# define IS_CALL 0x010
|
||||
# define IS_BIT26_COND 0x020
|
||||
# define IS_BIT16_COND 0x040
|
||||
# define IS_BIT23_COND 0x080
|
||||
|
||||
# define IS_COND (IS_BIT26_COND | IS_BIT16_COND)
|
||||
# define IS_COND (IS_BIT26_COND | IS_BIT16_COND | IS_BIT23_COND)
|
||||
|
||||
# define PATCH_B 0x080
|
||||
# define PATCH_J 0x100
|
||||
# define PATCH_B 0x100
|
||||
# define PATCH_J 0x200
|
||||
|
||||
#if (defined SLJIT_CONFIG_MIPS_64 && SLJIT_CONFIG_MIPS_64)
|
||||
# define PATCH_ABS32 0x200
|
||||
# define PATCH_ABS48 0x400
|
||||
# define PATCH_ABS32 0x400
|
||||
# define PATCH_ABS48 0x800
|
||||
#endif
|
||||
|
||||
/* instruction types */
|
||||
|
20
src/3rdparty/pcre2/src/sljit/sljitNativeARM_64.c
vendored
20
src/3rdparty/pcre2/src/sljit/sljitNativeARM_64.c
vendored
@ -51,7 +51,7 @@ static const sljit_u8 freg_map[SLJIT_NUMBER_OF_FLOAT_REGISTERS + 3] = {
|
||||
0, 0, 1, 2, 3, 4, 5, 6, 7
|
||||
};
|
||||
|
||||
#define W_OP (1 << 31)
|
||||
#define W_OP (1u << 31)
|
||||
#define RD(rd) (reg_map[rd])
|
||||
#define RT(rt) (reg_map[rt])
|
||||
#define RN(rn) (reg_map[rn] << 5)
|
||||
@ -560,7 +560,7 @@ static sljit_s32 emit_op_imm(struct sljit_compiler *compiler, sljit_s32 flags, s
|
||||
/* dst must be register, TMP_REG1
|
||||
arg1 must be register, TMP_REG1, imm
|
||||
arg2 must be register, TMP_REG2, imm */
|
||||
sljit_ins inv_bits = (flags & INT_OP) ? (1 << 31) : 0;
|
||||
sljit_ins inv_bits = (flags & INT_OP) ? W_OP : 0;
|
||||
sljit_ins inst_bits;
|
||||
sljit_s32 op = (flags & 0xffff);
|
||||
sljit_s32 reg;
|
||||
@ -710,7 +710,7 @@ static sljit_s32 emit_op_imm(struct sljit_compiler *compiler, sljit_s32 flags, s
|
||||
return push_inst(compiler, ORR | RD(dst) | RN(TMP_ZERO) | RM(arg2));
|
||||
case SLJIT_MOV_U8:
|
||||
SLJIT_ASSERT(!(flags & SET_FLAGS) && arg1 == TMP_REG1);
|
||||
return push_inst(compiler, (UBFM ^ (1 << 31)) | RD(dst) | RN(arg2) | (7 << 10));
|
||||
return push_inst(compiler, (UBFM ^ W_OP) | RD(dst) | RN(arg2) | (7 << 10));
|
||||
case SLJIT_MOV_S8:
|
||||
SLJIT_ASSERT(!(flags & SET_FLAGS) && arg1 == TMP_REG1);
|
||||
if (!(flags & INT_OP))
|
||||
@ -718,7 +718,7 @@ static sljit_s32 emit_op_imm(struct sljit_compiler *compiler, sljit_s32 flags, s
|
||||
return push_inst(compiler, (SBFM ^ inv_bits) | RD(dst) | RN(arg2) | (7 << 10));
|
||||
case SLJIT_MOV_U16:
|
||||
SLJIT_ASSERT(!(flags & SET_FLAGS) && arg1 == TMP_REG1);
|
||||
return push_inst(compiler, (UBFM ^ (1 << 31)) | RD(dst) | RN(arg2) | (15 << 10));
|
||||
return push_inst(compiler, (UBFM ^ W_OP) | RD(dst) | RN(arg2) | (15 << 10));
|
||||
case SLJIT_MOV_S16:
|
||||
SLJIT_ASSERT(!(flags & SET_FLAGS) && arg1 == TMP_REG1);
|
||||
if (!(flags & INT_OP))
|
||||
@ -728,7 +728,7 @@ static sljit_s32 emit_op_imm(struct sljit_compiler *compiler, sljit_s32 flags, s
|
||||
SLJIT_ASSERT(!(flags & SET_FLAGS) && arg1 == TMP_REG1);
|
||||
if ((flags & INT_OP) && dst == arg2)
|
||||
return SLJIT_SUCCESS;
|
||||
return push_inst(compiler, (ORR ^ (1 << 31)) | RD(dst) | RN(TMP_ZERO) | RM(arg2));
|
||||
return push_inst(compiler, (ORR ^ W_OP) | RD(dst) | RN(TMP_ZERO) | RM(arg2));
|
||||
case SLJIT_MOV_S32:
|
||||
SLJIT_ASSERT(!(flags & SET_FLAGS) && arg1 == TMP_REG1);
|
||||
if ((flags & INT_OP) && dst == arg2)
|
||||
@ -1080,7 +1080,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_return(struct sljit_compiler *comp
|
||||
|
||||
SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op0(struct sljit_compiler *compiler, sljit_s32 op)
|
||||
{
|
||||
sljit_ins inv_bits = (op & SLJIT_I32_OP) ? (1 << 31) : 0;
|
||||
sljit_ins inv_bits = (op & SLJIT_I32_OP) ? W_OP : 0;
|
||||
|
||||
CHECK_ERROR();
|
||||
CHECK(check_sljit_emit_op0(compiler, op));
|
||||
@ -1360,7 +1360,7 @@ static SLJIT_INLINE sljit_s32 sljit_emit_fop1_conv_sw_from_f64(struct sljit_comp
|
||||
sljit_ins inv_bits = (op & SLJIT_F32_OP) ? (1 << 22) : 0;
|
||||
|
||||
if (GET_OPCODE(op) == SLJIT_CONV_S32_FROM_F64)
|
||||
inv_bits |= (1 << 31);
|
||||
inv_bits |= W_OP;
|
||||
|
||||
if (src & SLJIT_MEM) {
|
||||
emit_fop_mem(compiler, (op & SLJIT_F32_OP) ? INT_SIZE : WORD_SIZE, TMP_FREG1, src, srcw);
|
||||
@ -1382,7 +1382,7 @@ static SLJIT_INLINE sljit_s32 sljit_emit_fop1_conv_f64_from_sw(struct sljit_comp
|
||||
sljit_ins inv_bits = (op & SLJIT_F32_OP) ? (1 << 22) : 0;
|
||||
|
||||
if (GET_OPCODE(op) == SLJIT_CONV_F64_FROM_S32)
|
||||
inv_bits |= (1 << 31);
|
||||
inv_bits |= W_OP;
|
||||
|
||||
if (src & SLJIT_MEM) {
|
||||
emit_op_mem(compiler, ((GET_OPCODE(op) == SLJIT_CONV_F64_FROM_S32) ? INT_SIZE : WORD_SIZE), TMP_REG1, src, srcw, TMP_REG1);
|
||||
@ -1662,7 +1662,7 @@ static SLJIT_INLINE struct sljit_jump* emit_cmp_to0(struct sljit_compiler *compi
|
||||
sljit_s32 src, sljit_sw srcw)
|
||||
{
|
||||
struct sljit_jump *jump;
|
||||
sljit_ins inv_bits = (type & SLJIT_I32_OP) ? (1 << 31) : 0;
|
||||
sljit_ins inv_bits = (type & SLJIT_I32_OP) ? W_OP : 0;
|
||||
|
||||
SLJIT_ASSERT((type & 0xff) == SLJIT_EQUAL || (type & 0xff) == SLJIT_NOT_EQUAL);
|
||||
ADJUST_LOCAL_OFFSET(src, srcw);
|
||||
@ -1787,7 +1787,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_cmov(struct sljit_compiler *compil
|
||||
sljit_s32 dst_reg,
|
||||
sljit_s32 src, sljit_sw srcw)
|
||||
{
|
||||
sljit_ins inv_bits = (dst_reg & SLJIT_I32_OP) ? (1 << 31) : 0;
|
||||
sljit_ins inv_bits = (dst_reg & SLJIT_I32_OP) ? W_OP : 0;
|
||||
sljit_ins cc;
|
||||
|
||||
CHECK_ERROR();
|
||||
|
@ -368,16 +368,21 @@ static SLJIT_INLINE sljit_s32 emit_single_op(struct sljit_compiler *compiler, sl
|
||||
SLJIT_ASSERT(!(flags & SRC2_IMM));
|
||||
|
||||
if (GET_FLAG_TYPE(op) != SLJIT_MUL_OVERFLOW) {
|
||||
#if (defined SLJIT_MIPS_R1 && SLJIT_MIPS_R1)
|
||||
#if (defined SLJIT_MIPS_R1 && SLJIT_MIPS_R1) || (defined SLJIT_MIPS_R6 && SLJIT_MIPS_R6)
|
||||
return push_inst(compiler, MUL | S(src1) | T(src2) | D(dst), DR(dst));
|
||||
#else
|
||||
#else /* !SLJIT_MIPS_R1 && !SLJIT_MIPS_R6 */
|
||||
FAIL_IF(push_inst(compiler, MULT | S(src1) | T(src2), MOVABLE_INS));
|
||||
return push_inst(compiler, MFLO | D(dst), DR(dst));
|
||||
#endif
|
||||
#endif /* SLJIT_MIPS_R1 || SLJIT_MIPS_R6 */
|
||||
}
|
||||
#if (defined SLJIT_MIPS_R6 && SLJIT_MIPS_R6)
|
||||
FAIL_IF(push_inst(compiler, MUL | S(src1) | T(src2) | D(dst), DR(dst)));
|
||||
FAIL_IF(push_inst(compiler, MUH | S(src1) | T(src2) | DA(EQUAL_FLAG), EQUAL_FLAG));
|
||||
#else /* !SLJIT_MIPS_R6 */
|
||||
FAIL_IF(push_inst(compiler, MULT | S(src1) | T(src2), MOVABLE_INS));
|
||||
FAIL_IF(push_inst(compiler, MFHI | DA(EQUAL_FLAG), EQUAL_FLAG));
|
||||
FAIL_IF(push_inst(compiler, MFLO | D(dst), DR(dst)));
|
||||
#endif /* SLJIT_MIPS_R6 */
|
||||
FAIL_IF(push_inst(compiler, SRA | T(dst) | DA(OTHER_FLAG) | SH_IMM(31), OTHER_FLAG));
|
||||
return push_inst(compiler, SUBU | SA(EQUAL_FLAG) | TA(OTHER_FLAG) | DA(OTHER_FLAG), OTHER_FLAG);
|
||||
|
||||
|
@ -459,19 +459,26 @@ static SLJIT_INLINE sljit_s32 emit_single_op(struct sljit_compiler *compiler, sl
|
||||
SLJIT_ASSERT(!(flags & SRC2_IMM));
|
||||
|
||||
if (GET_FLAG_TYPE(op) != SLJIT_MUL_OVERFLOW) {
|
||||
#if (defined SLJIT_MIPS_R1 && SLJIT_MIPS_R1)
|
||||
#if (defined SLJIT_MIPS_R6 && SLJIT_MIPS_R6)
|
||||
return push_inst(compiler, SELECT_OP(DMUL, MUL) | S(src1) | T(src2) | D(dst), DR(dst));
|
||||
#elif (defined SLJIT_MIPS_R1 && SLJIT_MIPS_R1)
|
||||
if (op & SLJIT_I32_OP)
|
||||
return push_inst(compiler, MUL | S(src1) | T(src2) | D(dst), DR(dst));
|
||||
FAIL_IF(push_inst(compiler, DMULT | S(src1) | T(src2), MOVABLE_INS));
|
||||
return push_inst(compiler, MFLO | D(dst), DR(dst));
|
||||
#else
|
||||
#else /* !SLJIT_MIPS_R6 && !SLJIT_MIPS_R1 */
|
||||
FAIL_IF(push_inst(compiler, SELECT_OP(DMULT, MULT) | S(src1) | T(src2), MOVABLE_INS));
|
||||
return push_inst(compiler, MFLO | D(dst), DR(dst));
|
||||
#endif
|
||||
#endif /* SLJIT_MIPS_R6 */
|
||||
}
|
||||
#if (defined SLJIT_MIPS_R6 && SLJIT_MIPS_R6)
|
||||
FAIL_IF(push_inst(compiler, SELECT_OP(DMUL, MUL) | S(src1) | T(src2) | D(dst), DR(dst)));
|
||||
FAIL_IF(push_inst(compiler, SELECT_OP(DMUH, MUH) | S(src1) | T(src2) | DA(EQUAL_FLAG), EQUAL_FLAG));
|
||||
#else /* !SLJIT_MIPS_R6 */
|
||||
FAIL_IF(push_inst(compiler, SELECT_OP(DMULT, MULT) | S(src1) | T(src2), MOVABLE_INS));
|
||||
FAIL_IF(push_inst(compiler, MFHI | DA(EQUAL_FLAG), EQUAL_FLAG));
|
||||
FAIL_IF(push_inst(compiler, MFLO | D(dst), DR(dst)));
|
||||
#endif /* SLJIT_MIPS_R6 */
|
||||
FAIL_IF(push_inst(compiler, SELECT_OP(DSRA32, SRA) | T(dst) | DA(OTHER_FLAG) | SH_IMM(31), OTHER_FLAG));
|
||||
return push_inst(compiler, SELECT_OP(DSUBU, SUBU) | SA(EQUAL_FLAG) | TA(OTHER_FLAG) | DA(OTHER_FLAG), OTHER_FLAG);
|
||||
|
||||
|
@ -27,17 +27,31 @@
|
||||
/* Latest MIPS architecture. */
|
||||
/* Automatically detect SLJIT_MIPS_R1 */
|
||||
|
||||
#if (defined __mips_isa_rev) && (__mips_isa_rev >= 6)
|
||||
#define SLJIT_MIPS_R6 1
|
||||
#endif
|
||||
|
||||
SLJIT_API_FUNC_ATTRIBUTE const char* sljit_get_platform_name(void)
|
||||
{
|
||||
#if (defined SLJIT_MIPS_R1 && SLJIT_MIPS_R1)
|
||||
#if (defined SLJIT_MIPS_R6 && SLJIT_MIPS_R6)
|
||||
|
||||
#if (defined SLJIT_CONFIG_MIPS_32 && SLJIT_CONFIG_MIPS_32)
|
||||
return "MIPS32-R6" SLJIT_CPUINFO;
|
||||
#else /* !SLJIT_CONFIG_MIPS_32 */
|
||||
return "MIPS64-R6" SLJIT_CPUINFO;
|
||||
#endif /* SLJIT_CONFIG_MIPS_32 */
|
||||
|
||||
#elif (defined SLJIT_MIPS_R1 && SLJIT_MIPS_R1)
|
||||
|
||||
#if (defined SLJIT_CONFIG_MIPS_32 && SLJIT_CONFIG_MIPS_32)
|
||||
return "MIPS32-R1" SLJIT_CPUINFO;
|
||||
#else
|
||||
#else /* !SLJIT_CONFIG_MIPS_32 */
|
||||
return "MIPS64-R1" SLJIT_CPUINFO;
|
||||
#endif
|
||||
#endif /* SLJIT_CONFIG_MIPS_32 */
|
||||
|
||||
#else /* SLJIT_MIPS_R1 */
|
||||
return "MIPS III" SLJIT_CPUINFO;
|
||||
#endif
|
||||
#endif /* SLJIT_MIPS_R6 */
|
||||
}
|
||||
|
||||
/* Length of an instruction word
|
||||
@ -62,6 +76,7 @@ typedef sljit_u32 sljit_ins;
|
||||
|
||||
#define TMP_FREG1 (SLJIT_NUMBER_OF_FLOAT_REGISTERS + 1)
|
||||
#define TMP_FREG2 (SLJIT_NUMBER_OF_FLOAT_REGISTERS + 2)
|
||||
#define TMP_FREG3 (SLJIT_NUMBER_OF_FLOAT_REGISTERS + 3)
|
||||
|
||||
static const sljit_u8 reg_map[SLJIT_NUMBER_OF_REGISTERS + 5] = {
|
||||
0, 2, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 24, 23, 22, 21, 20, 19, 18, 17, 16, 29, 4, 25, 31
|
||||
@ -69,14 +84,14 @@ static const sljit_u8 reg_map[SLJIT_NUMBER_OF_REGISTERS + 5] = {
|
||||
|
||||
#if (defined SLJIT_CONFIG_MIPS_32 && SLJIT_CONFIG_MIPS_32)
|
||||
|
||||
static const sljit_u8 freg_map[SLJIT_NUMBER_OF_FLOAT_REGISTERS + 3] = {
|
||||
0, 0, 14, 2, 4, 6, 8, 12, 10
|
||||
static const sljit_u8 freg_map[SLJIT_NUMBER_OF_FLOAT_REGISTERS + 4] = {
|
||||
0, 0, 14, 2, 4, 6, 8, 12, 10, 16
|
||||
};
|
||||
|
||||
#else
|
||||
|
||||
static const sljit_u8 freg_map[SLJIT_NUMBER_OF_FLOAT_REGISTERS + 3] = {
|
||||
0, 0, 13, 14, 15, 16, 17, 12, 18
|
||||
static const sljit_u8 freg_map[SLJIT_NUMBER_OF_FLOAT_REGISTERS + 4] = {
|
||||
0, 0, 13, 14, 15, 16, 17, 12, 18, 10
|
||||
};
|
||||
|
||||
#endif
|
||||
@ -102,6 +117,11 @@ static const sljit_u8 freg_map[SLJIT_NUMBER_OF_FLOAT_REGISTERS + 3] = {
|
||||
#define FR(dr) (freg_map[dr])
|
||||
#define HI(opcode) ((opcode) << 26)
|
||||
#define LO(opcode) (opcode)
|
||||
#if (defined SLJIT_MIPS_R6 && SLJIT_MIPS_R6)
|
||||
/* CMP.cond.fmt */
|
||||
/* S = (20 << 21) D = (21 << 21) */
|
||||
#define CMP_FMT_S (20 << 21)
|
||||
#endif /* SLJIT_MIPS_R6 */
|
||||
/* S = (16 << 21) D = (17 << 21) */
|
||||
#define FMT_S (16 << 21)
|
||||
#define FMT_D (17 << 21)
|
||||
@ -114,8 +134,13 @@ static const sljit_u8 freg_map[SLJIT_NUMBER_OF_FLOAT_REGISTERS + 3] = {
|
||||
#define ANDI (HI(12))
|
||||
#define B (HI(4))
|
||||
#define BAL (HI(1) | (17 << 16))
|
||||
#if (defined SLJIT_MIPS_R6 && SLJIT_MIPS_R6)
|
||||
#define BC1EQZ (HI(17) | (9 << 21) | FT(TMP_FREG3))
|
||||
#define BC1NEZ (HI(17) | (13 << 21) | FT(TMP_FREG3))
|
||||
#else /* !SLJIT_MIPS_R6 */
|
||||
#define BC1F (HI(17) | (8 << 21))
|
||||
#define BC1T (HI(17) | (8 << 21) | (1 << 16))
|
||||
#endif /* SLJIT_MIPS_R6 */
|
||||
#define BEQ (HI(4))
|
||||
#define BGEZ (HI(1) | (1 << 16))
|
||||
#define BGTZ (HI(7))
|
||||
@ -124,20 +149,42 @@ static const sljit_u8 freg_map[SLJIT_NUMBER_OF_FLOAT_REGISTERS + 3] = {
|
||||
#define BNE (HI(5))
|
||||
#define BREAK (HI(0) | LO(13))
|
||||
#define CFC1 (HI(17) | (2 << 21))
|
||||
#define C_UN_S (HI(17) | FMT_S | LO(49))
|
||||
#if (defined SLJIT_MIPS_R6 && SLJIT_MIPS_R6)
|
||||
#define C_UEQ_S (HI(17) | CMP_FMT_S | LO(3))
|
||||
#define C_ULE_S (HI(17) | CMP_FMT_S | LO(7))
|
||||
#define C_ULT_S (HI(17) | CMP_FMT_S | LO(5))
|
||||
#define C_UN_S (HI(17) | CMP_FMT_S | LO(1))
|
||||
#define C_FD (FD(TMP_FREG3))
|
||||
#else /* !SLJIT_MIPS_R6 */
|
||||
#define C_UEQ_S (HI(17) | FMT_S | LO(51))
|
||||
#define C_ULE_S (HI(17) | FMT_S | LO(55))
|
||||
#define C_ULT_S (HI(17) | FMT_S | LO(53))
|
||||
#define C_UN_S (HI(17) | FMT_S | LO(49))
|
||||
#define C_FD (0)
|
||||
#endif /* SLJIT_MIPS_R6 */
|
||||
#define CVT_S_S (HI(17) | FMT_S | LO(32))
|
||||
#define DADDIU (HI(25))
|
||||
#define DADDU (HI(0) | LO(45))
|
||||
#if (defined SLJIT_MIPS_R6 && SLJIT_MIPS_R6)
|
||||
#define DDIV (HI(0) | (2 << 6) | LO(30))
|
||||
#define DDIVU (HI(0) | (2 << 6) | LO(31))
|
||||
#define DMOD (HI(0) | (3 << 6) | LO(30))
|
||||
#define DMODU (HI(0) | (3 << 6) | LO(31))
|
||||
#define DIV (HI(0) | (2 << 6) | LO(26))
|
||||
#define DIVU (HI(0) | (2 << 6) | LO(27))
|
||||
#define DMUH (HI(0) | (3 << 6) | LO(28))
|
||||
#define DMUHU (HI(0) | (3 << 6) | LO(29))
|
||||
#define DMUL (HI(0) | (2 << 6) | LO(28))
|
||||
#define DMULU (HI(0) | (2 << 6) | LO(29))
|
||||
#else /* !SLJIT_MIPS_R6 */
|
||||
#define DDIV (HI(0) | LO(30))
|
||||
#define DDIVU (HI(0) | LO(31))
|
||||
#define DIV (HI(0) | LO(26))
|
||||
#define DIVU (HI(0) | LO(27))
|
||||
#define DIV_S (HI(17) | FMT_S | LO(3))
|
||||
#define DMULT (HI(0) | LO(28))
|
||||
#define DMULTU (HI(0) | LO(29))
|
||||
#endif /* SLJIT_MIPS_R6 */
|
||||
#define DIV_S (HI(17) | FMT_S | LO(3))
|
||||
#define DSLL (HI(0) | LO(56))
|
||||
#define DSLL32 (HI(0) | LO(60))
|
||||
#define DSLLV (HI(0) | LO(20))
|
||||
@ -151,18 +198,34 @@ static const sljit_u8 freg_map[SLJIT_NUMBER_OF_FLOAT_REGISTERS + 3] = {
|
||||
#define J (HI(2))
|
||||
#define JAL (HI(3))
|
||||
#define JALR (HI(0) | LO(9))
|
||||
#if (defined SLJIT_MIPS_R6 && SLJIT_MIPS_R6)
|
||||
#define JR (HI(0) | LO(9))
|
||||
#else /* !SLJIT_MIPS_R6 */
|
||||
#define JR (HI(0) | LO(8))
|
||||
#endif /* SLJIT_MIPS_R6 */
|
||||
#define LD (HI(55))
|
||||
#define LUI (HI(15))
|
||||
#define LW (HI(35))
|
||||
#define MFC1 (HI(17))
|
||||
#if !(defined SLJIT_MIPS_R6 && SLJIT_MIPS_R6)
|
||||
#define MFHI (HI(0) | LO(16))
|
||||
#define MFLO (HI(0) | LO(18))
|
||||
#else /* SLJIT_MIPS_R6 */
|
||||
#define MOD (HI(0) | (3 << 6) | LO(26))
|
||||
#define MODU (HI(0) | (3 << 6) | LO(27))
|
||||
#endif /* !SLJIT_MIPS_R6 */
|
||||
#define MOV_S (HI(17) | FMT_S | LO(6))
|
||||
#define MTC1 (HI(17) | (4 << 21))
|
||||
#define MUL_S (HI(17) | FMT_S | LO(2))
|
||||
#if (defined SLJIT_MIPS_R6 && SLJIT_MIPS_R6)
|
||||
#define MUH (HI(0) | (3 << 6) | LO(24))
|
||||
#define MUHU (HI(0) | (3 << 6) | LO(25))
|
||||
#define MUL (HI(0) | (2 << 6) | LO(24))
|
||||
#define MULU (HI(0) | (2 << 6) | LO(25))
|
||||
#else /* !SLJIT_MIPS_R6 */
|
||||
#define MULT (HI(0) | LO(24))
|
||||
#define MULTU (HI(0) | LO(25))
|
||||
#endif /* SLJIT_MIPS_R6 */
|
||||
#define MUL_S (HI(17) | FMT_S | LO(2))
|
||||
#define NEG_S (HI(17) | FMT_S | LO(7))
|
||||
#define NOP (HI(0) | LO(0))
|
||||
#define NOR (HI(0) | LO(39))
|
||||
@ -188,14 +251,18 @@ static const sljit_u8 freg_map[SLJIT_NUMBER_OF_FLOAT_REGISTERS + 3] = {
|
||||
#define XOR (HI(0) | LO(38))
|
||||
#define XORI (HI(14))
|
||||
|
||||
#if (defined SLJIT_MIPS_R1 && SLJIT_MIPS_R1)
|
||||
#if (defined SLJIT_MIPS_R1 && SLJIT_MIPS_R1) || (defined SLJIT_MIPS_R6 && SLJIT_MIPS_R6)
|
||||
#define CLZ (HI(28) | LO(32))
|
||||
#if (defined SLJIT_MIPS_R6 && SLJIT_MIPS_R6)
|
||||
#define DCLZ (LO(18))
|
||||
#else /* !SLJIT_MIPS_R6 */
|
||||
#define DCLZ (HI(28) | LO(36))
|
||||
#define MOVF (HI(0) | (0 << 16) | LO(1))
|
||||
#define MOVN (HI(0) | LO(11))
|
||||
#define MOVT (HI(0) | (1 << 16) | LO(1))
|
||||
#define MOVZ (HI(0) | LO(10))
|
||||
#define MUL (HI(28) | LO(2))
|
||||
#endif /* SLJIT_MIPS_R6 */
|
||||
#define PREF (HI(51))
|
||||
#define PREFX (HI(19) | LO(15))
|
||||
#define SEB (HI(31) | (16 << 6) | LO(32))
|
||||
@ -234,7 +301,13 @@ static sljit_s32 push_inst(struct sljit_compiler *compiler, sljit_ins ins, sljit
|
||||
|
||||
static SLJIT_INLINE sljit_ins invert_branch(sljit_s32 flags)
|
||||
{
|
||||
return (flags & IS_BIT26_COND) ? (1 << 26) : (1 << 16);
|
||||
if (flags & IS_BIT26_COND)
|
||||
return (1 << 26);
|
||||
#if (defined SLJIT_MIPS_R6 && SLJIT_MIPS_R6)
|
||||
if (flags & IS_BIT23_COND)
|
||||
return (1 << 23);
|
||||
#endif /* SLJIT_MIPS_R6 */
|
||||
return (1 << 16);
|
||||
}
|
||||
|
||||
static SLJIT_INLINE sljit_ins* detect_jump_type(struct sljit_jump *jump, sljit_ins *code_ptr, sljit_ins *code, sljit_sw executable_offset)
|
||||
@ -1075,34 +1148,62 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op0(struct sljit_compiler *compile
|
||||
return push_inst(compiler, NOP, UNMOVABLE_INS);
|
||||
case SLJIT_LMUL_UW:
|
||||
case SLJIT_LMUL_SW:
|
||||
#if (defined SLJIT_MIPS_R6 && SLJIT_MIPS_R6)
|
||||
#if (defined SLJIT_CONFIG_MIPS_64 && SLJIT_CONFIG_MIPS_64)
|
||||
FAIL_IF(push_inst(compiler, (op == SLJIT_LMUL_UW ? DMULU : DMUL) | S(SLJIT_R0) | T(SLJIT_R1) | D(TMP_REG3), DR(TMP_REG3)));
|
||||
FAIL_IF(push_inst(compiler, (op == SLJIT_LMUL_UW ? DMUHU : DMUH) | S(SLJIT_R0) | T(SLJIT_R1) | D(TMP_REG1), DR(TMP_REG1)));
|
||||
#else /* !SLJIT_CONFIG_MIPS_64 */
|
||||
FAIL_IF(push_inst(compiler, (op == SLJIT_LMUL_UW ? MULU : MUL) | S(SLJIT_R0) | T(SLJIT_R1) | D(TMP_REG3), DR(TMP_REG3)));
|
||||
FAIL_IF(push_inst(compiler, (op == SLJIT_LMUL_UW ? MUHU : MUH) | S(SLJIT_R0) | T(SLJIT_R1) | D(TMP_REG1), DR(TMP_REG1)));
|
||||
#endif /* SLJIT_CONFIG_MIPS_64 */
|
||||
FAIL_IF(push_inst(compiler, ADDU_W | S(TMP_REG3) | TA(0) | D(SLJIT_R0), DR(SLJIT_R0)));
|
||||
return push_inst(compiler, ADDU_W | S(TMP_REG1) | TA(0) | D(SLJIT_R1), DR(SLJIT_R1));
|
||||
#else /* !SLJIT_MIPS_R6 */
|
||||
#if (defined SLJIT_CONFIG_MIPS_64 && SLJIT_CONFIG_MIPS_64)
|
||||
FAIL_IF(push_inst(compiler, (op == SLJIT_LMUL_UW ? DMULTU : DMULT) | S(SLJIT_R0) | T(SLJIT_R1), MOVABLE_INS));
|
||||
#else
|
||||
#else /* !SLJIT_CONFIG_MIPS_64 */
|
||||
FAIL_IF(push_inst(compiler, (op == SLJIT_LMUL_UW ? MULTU : MULT) | S(SLJIT_R0) | T(SLJIT_R1), MOVABLE_INS));
|
||||
#endif
|
||||
#endif /* SLJIT_CONFIG_MIPS_64 */
|
||||
FAIL_IF(push_inst(compiler, MFLO | D(SLJIT_R0), DR(SLJIT_R0)));
|
||||
return push_inst(compiler, MFHI | D(SLJIT_R1), DR(SLJIT_R1));
|
||||
#endif /* SLJIT_MIPS_R6 */
|
||||
case SLJIT_DIVMOD_UW:
|
||||
case SLJIT_DIVMOD_SW:
|
||||
case SLJIT_DIV_UW:
|
||||
case SLJIT_DIV_SW:
|
||||
SLJIT_COMPILE_ASSERT((SLJIT_DIVMOD_UW & 0x2) == 0 && SLJIT_DIV_UW - 0x2 == SLJIT_DIVMOD_UW, bad_div_opcode_assignments);
|
||||
#if (defined SLJIT_MIPS_R6 && SLJIT_MIPS_R6)
|
||||
#if (defined SLJIT_CONFIG_MIPS_64 && SLJIT_CONFIG_MIPS_64)
|
||||
if (int_op) {
|
||||
FAIL_IF(push_inst(compiler, ((op | 0x2) == SLJIT_DIV_UW ? DIVU : DIV) | S(SLJIT_R0) | T(SLJIT_R1) | D(TMP_REG3), DR(TMP_REG3)));
|
||||
FAIL_IF(push_inst(compiler, ((op | 0x2) == SLJIT_DIV_UW ? MODU : MOD) | S(SLJIT_R0) | T(SLJIT_R1) | D(TMP_REG1), DR(TMP_REG1)));
|
||||
}
|
||||
else {
|
||||
FAIL_IF(push_inst(compiler, ((op | 0x2) == SLJIT_DIV_UW ? DDIVU : DDIV) | S(SLJIT_R0) | T(SLJIT_R1) | D(TMP_REG3), DR(TMP_REG3)));
|
||||
FAIL_IF(push_inst(compiler, ((op | 0x2) == SLJIT_DIV_UW ? DMODU : DMOD) | S(SLJIT_R0) | T(SLJIT_R1) | D(TMP_REG1), DR(TMP_REG1)));
|
||||
}
|
||||
#else /* !SLJIT_CONFIG_MIPS_64 */
|
||||
FAIL_IF(push_inst(compiler, ((op | 0x2) == SLJIT_DIV_UW ? DIVU : DIV) | S(SLJIT_R0) | T(SLJIT_R1) | D(TMP_REG3), DR(TMP_REG3)));
|
||||
FAIL_IF(push_inst(compiler, ((op | 0x2) == SLJIT_DIV_UW ? MODU : MOD) | S(SLJIT_R0) | T(SLJIT_R1) | D(TMP_REG1), DR(TMP_REG1)));
|
||||
#endif /* SLJIT_CONFIG_MIPS_64 */
|
||||
FAIL_IF(push_inst(compiler, ADDU_W | S(TMP_REG3) | TA(0) | D(SLJIT_R0), DR(SLJIT_R0)));
|
||||
return (op >= SLJIT_DIV_UW) ? SLJIT_SUCCESS : push_inst(compiler, ADDU_W | S(TMP_REG1) | TA(0) | D(SLJIT_R1), DR(SLJIT_R1));
|
||||
#else /* !SLJIT_MIPS_R6 */
|
||||
#if !(defined SLJIT_MIPS_R1 && SLJIT_MIPS_R1)
|
||||
FAIL_IF(push_inst(compiler, NOP, UNMOVABLE_INS));
|
||||
FAIL_IF(push_inst(compiler, NOP, UNMOVABLE_INS));
|
||||
#endif
|
||||
|
||||
#endif /* !SLJIT_MIPS_R1 */
|
||||
#if (defined SLJIT_CONFIG_MIPS_64 && SLJIT_CONFIG_MIPS_64)
|
||||
if (int_op)
|
||||
FAIL_IF(push_inst(compiler, ((op | 0x2) == SLJIT_DIV_UW ? DIVU : DIV) | S(SLJIT_R0) | T(SLJIT_R1), MOVABLE_INS));
|
||||
else
|
||||
FAIL_IF(push_inst(compiler, ((op | 0x2) == SLJIT_DIV_UW ? DDIVU : DDIV) | S(SLJIT_R0) | T(SLJIT_R1), MOVABLE_INS));
|
||||
#else
|
||||
#else /* !SLJIT_CONFIG_MIPS_64 */
|
||||
FAIL_IF(push_inst(compiler, ((op | 0x2) == SLJIT_DIV_UW ? DIVU : DIV) | S(SLJIT_R0) | T(SLJIT_R1), MOVABLE_INS));
|
||||
#endif
|
||||
|
||||
#endif /* SLJIT_CONFIG_MIPS_64 */
|
||||
FAIL_IF(push_inst(compiler, MFLO | D(SLJIT_R0), DR(SLJIT_R0)));
|
||||
return (op >= SLJIT_DIV_UW) ? SLJIT_SUCCESS : push_inst(compiler, MFHI | D(SLJIT_R1), DR(SLJIT_R1));
|
||||
#endif /* SLJIT_MIPS_R6 */
|
||||
}
|
||||
|
||||
return SLJIT_SUCCESS;
|
||||
@ -1408,8 +1509,7 @@ static SLJIT_INLINE sljit_s32 sljit_emit_fop1_cmp(struct sljit_compiler *compile
|
||||
inst = C_UN_S;
|
||||
break;
|
||||
}
|
||||
|
||||
return push_inst(compiler, inst | FMT(op) | FT(src2) | FS(src1), UNMOVABLE_INS);
|
||||
return push_inst(compiler, inst | FMT(op) | FT(src2) | FS(src1) | C_FD, UNMOVABLE_INS);
|
||||
}
|
||||
|
||||
SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fop1(struct sljit_compiler *compiler, sljit_s32 op,
|
||||
@ -1608,16 +1708,30 @@ SLJIT_API_FUNC_ATTRIBUTE struct sljit_label* sljit_emit_label(struct sljit_compi
|
||||
flags = IS_BIT26_COND; \
|
||||
delay_check = src;
|
||||
|
||||
#if (defined SLJIT_MIPS_R6 && SLJIT_MIPS_R6)
|
||||
|
||||
#define BR_T() \
|
||||
inst = BC1NEZ; \
|
||||
flags = IS_BIT23_COND; \
|
||||
delay_check = FCSR_FCC;
|
||||
#define BR_F() \
|
||||
inst = BC1EQZ; \
|
||||
flags = IS_BIT23_COND; \
|
||||
delay_check = FCSR_FCC;
|
||||
|
||||
#else /* !SLJIT_MIPS_R6 */
|
||||
|
||||
#define BR_T() \
|
||||
inst = BC1T | JUMP_LENGTH; \
|
||||
flags = IS_BIT16_COND; \
|
||||
delay_check = FCSR_FCC;
|
||||
|
||||
#define BR_F() \
|
||||
inst = BC1F | JUMP_LENGTH; \
|
||||
flags = IS_BIT16_COND; \
|
||||
delay_check = FCSR_FCC;
|
||||
|
||||
#endif /* SLJIT_MIPS_R6 */
|
||||
|
||||
SLJIT_API_FUNC_ATTRIBUTE struct sljit_jump* sljit_emit_jump(struct sljit_compiler *compiler, sljit_s32 type)
|
||||
{
|
||||
struct sljit_jump *jump;
|
||||
@ -1927,7 +2041,11 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op_flags(struct sljit_compiler *co
|
||||
case SLJIT_GREATER_EQUAL_F64:
|
||||
case SLJIT_UNORDERED_F64:
|
||||
case SLJIT_ORDERED_F64:
|
||||
#if (defined SLJIT_MIPS_R6 && SLJIT_MIPS_R6)
|
||||
FAIL_IF(push_inst(compiler, MFC1 | TA(dst_ar) | FS(TMP_FREG3), dst_ar));
|
||||
#else /* !SLJIT_MIPS_R6 */
|
||||
FAIL_IF(push_inst(compiler, CFC1 | TA(dst_ar) | DA(FCSR_REG), dst_ar));
|
||||
#endif /* SLJIT_MIPS_R6 */
|
||||
FAIL_IF(push_inst(compiler, SRL | TA(dst_ar) | DA(dst_ar) | SH_IMM(23), dst_ar));
|
||||
FAIL_IF(push_inst(compiler, ANDI | SA(dst_ar) | TA(dst_ar) | IMM(1), dst_ar));
|
||||
src_ar = dst_ar;
|
||||
|
@ -42,7 +42,7 @@ typedef sljit_u32 sljit_ins;
|
||||
#include <sys/cache.h>
|
||||
#endif
|
||||
|
||||
#if (defined SLJIT_LITTLE_ENDIAN && SLJIT_LITTLE_ENDIAN)
|
||||
#if (defined _CALL_ELF && _CALL_ELF == 2)
|
||||
#define SLJIT_PASS_ENTRY_ADDR_TO_CALL 1
|
||||
#endif
|
||||
|
||||
|
@ -166,11 +166,11 @@ public class CursorHandle implements ViewTreeObserver.OnPreDrawListener
|
||||
int y2 = y + location[1] + m_yShift;
|
||||
|
||||
if (m_id == QtNative.IdCursorHandle) {
|
||||
x2 -= m_cursorView.getWidth() / 2 ;
|
||||
x2 -= m_popup.getWidth() / 2 ;
|
||||
} else if ((m_id == QtNative.IdLeftHandle && !m_rtl) || (m_id == QtNative.IdRightHandle && m_rtl)) {
|
||||
x2 -= m_cursorView.getWidth() * 3 / 4;
|
||||
x2 -= m_popup.getWidth() * 3 / 4;
|
||||
} else {
|
||||
x2 -= m_cursorView.getWidth() / 4;
|
||||
x2 -= m_popup.getWidth() / 4;
|
||||
}
|
||||
|
||||
if (m_popup.isShowing()) {
|
||||
|
@ -59,7 +59,8 @@ import android.view.ViewGroup;
|
||||
import android.R;
|
||||
|
||||
// Helper class that manages a cursor or selection handle
|
||||
public class EditPopupMenu implements ViewTreeObserver.OnPreDrawListener, EditContextView.OnClickListener
|
||||
public class EditPopupMenu implements ViewTreeObserver.OnPreDrawListener, View.OnLayoutChangeListener,
|
||||
EditContextView.OnClickListener
|
||||
{
|
||||
private View m_layout = null;
|
||||
private EditContextView m_view = null;
|
||||
@ -67,10 +68,15 @@ public class EditPopupMenu implements ViewTreeObserver.OnPreDrawListener, EditCo
|
||||
private int m_posX;
|
||||
private int m_posY;
|
||||
private int m_buttons;
|
||||
private CursorHandle m_cursorHandle;
|
||||
private CursorHandle m_leftSelectionHandle;
|
||||
private CursorHandle m_rightSelectionHandle;
|
||||
|
||||
public EditPopupMenu(Activity activity, View layout)
|
||||
{
|
||||
m_view = new EditContextView(activity, this);
|
||||
m_view.addOnLayoutChangeListener(this);
|
||||
|
||||
m_layout = layout;
|
||||
}
|
||||
|
||||
@ -90,13 +96,9 @@ public class EditPopupMenu implements ViewTreeObserver.OnPreDrawListener, EditCo
|
||||
m_layout.getViewTreeObserver().addOnPreDrawListener(this);
|
||||
}
|
||||
|
||||
public int getHeight()
|
||||
{
|
||||
return m_view.getHeight();
|
||||
}
|
||||
|
||||
// Show the handle at a given position (or move it if it is already shown)
|
||||
public void setPosition(final int x, final int y, final int buttons)
|
||||
public void setPosition(final int x, final int y, final int buttons,
|
||||
CursorHandle cursorHandle, CursorHandle leftSelectionHandle, CursorHandle rightSelectionHandle)
|
||||
{
|
||||
initOverlay();
|
||||
|
||||
@ -109,6 +111,14 @@ public class EditPopupMenu implements ViewTreeObserver.OnPreDrawListener, EditCo
|
||||
|
||||
x2 -= m_view.getWidth() / 2 ;
|
||||
|
||||
y2 -= m_view.getHeight();
|
||||
if (y2 < 0) {
|
||||
if (cursorHandle != null)
|
||||
y2 = cursorHandle.bottom();
|
||||
else if (leftSelectionHandle != null && rightSelectionHandle != null)
|
||||
y2 = Math.max(leftSelectionHandle.bottom(), rightSelectionHandle.bottom());
|
||||
}
|
||||
|
||||
if (m_layout.getWidth() < x + m_view.getWidth() / 2)
|
||||
x2 = m_layout.getWidth() - m_view.getWidth();
|
||||
|
||||
@ -123,6 +133,9 @@ public class EditPopupMenu implements ViewTreeObserver.OnPreDrawListener, EditCo
|
||||
m_posX = x;
|
||||
m_posY = y;
|
||||
m_buttons = buttons;
|
||||
m_cursorHandle = cursorHandle;
|
||||
m_leftSelectionHandle = leftSelectionHandle;
|
||||
m_rightSelectionHandle = rightSelectionHandle;
|
||||
}
|
||||
|
||||
public void hide() {
|
||||
@ -138,11 +151,20 @@ public class EditPopupMenu implements ViewTreeObserver.OnPreDrawListener, EditCo
|
||||
// For example if the keyboard appears.
|
||||
// Adjust the position of the handle accordingly
|
||||
if (m_popup != null && m_popup.isShowing())
|
||||
setPosition(m_posX, m_posY, m_buttons);
|
||||
setPosition(m_posX, m_posY, m_buttons, m_cursorHandle, m_leftSelectionHandle, m_rightSelectionHandle);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLayoutChange(View v, int left, int top, int right, int bottom,
|
||||
int oldLeft, int oldTop, int oldRight, int oldBottom)
|
||||
{
|
||||
if ((right - left != oldRight - oldLeft || bottom - top != oldBottom - oldTop) &&
|
||||
m_popup != null && m_popup.isShowing())
|
||||
setPosition(m_posX, m_posY, m_buttons, m_cursorHandle, m_leftSelectionHandle, m_rightSelectionHandle);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void contextButtonClicked(int buttonId) {
|
||||
switch (buttonId) {
|
||||
|
@ -552,16 +552,8 @@ public class QtActivityDelegate
|
||||
editButtons &= ~EditContextView.PASTE_BUTTON;
|
||||
|
||||
if ((mode & CursorHandleShowEdit) == CursorHandleShowEdit && editButtons != 0) {
|
||||
editY -= m_editPopupMenu.getHeight();
|
||||
if (editY < 0) {
|
||||
if (m_cursorHandle != null)
|
||||
editY = m_cursorHandle.bottom();
|
||||
else if (m_leftSelectionHandle != null && m_rightSelectionHandle != null)
|
||||
editY = Math.max(m_leftSelectionHandle.bottom(), m_rightSelectionHandle.bottom());
|
||||
else
|
||||
return;
|
||||
}
|
||||
m_editPopupMenu.setPosition(editX, editY, editButtons);
|
||||
m_editPopupMenu.setPosition(editX, editY, editButtons, m_cursorHandle, m_leftSelectionHandle,
|
||||
m_rightSelectionHandle);
|
||||
} else {
|
||||
if (m_editPopupMenu != null)
|
||||
m_editPopupMenu.hide();
|
||||
|
@ -128,7 +128,7 @@ QT_BEGIN_NAMESPACE
|
||||
const auto qTraceExit_ ## x ## __COUNTER__ = qScopeGuard([&]() { Q_TRACE(x, __VA_ARGS__); });
|
||||
# define Q_TRACE_SCOPE(x, ...) \
|
||||
Q_TRACE(x ## _entry, __VA_ARGS__); \
|
||||
Q_TRACE_EXIT(x ## _exit, __VA_ARGS__);
|
||||
Q_TRACE_EXIT(x ## _exit);
|
||||
# define Q_UNCONDITIONAL_TRACE(x, ...) QtPrivate::do_trace_ ## x(__VA_ARGS__)
|
||||
# define Q_TRACE_ENABLED(x) QtPrivate::trace_ ## x ## _enabled()
|
||||
#else
|
||||
|
@ -321,7 +321,8 @@ void QDirIteratorPrivate::checkAndPushDirectory(const QFileInfo &fileInfo)
|
||||
|
||||
bool QDirIteratorPrivate::matchesFilters(const QString &fileName, const QFileInfo &fi) const
|
||||
{
|
||||
Q_ASSERT(!fileName.isEmpty());
|
||||
if (fileName.isEmpty())
|
||||
return false;
|
||||
|
||||
// filter . and ..?
|
||||
const int fileNameSize = fileName.size();
|
||||
|
@ -999,7 +999,12 @@ void QProcessPrivate::setErrorAndEmit(QProcess::ProcessError error, const QStrin
|
||||
Q_ASSERT(error != QProcess::UnknownError);
|
||||
setError(error, description);
|
||||
emit q->errorOccurred(processError);
|
||||
#if QT_DEPRECATED_SINCE(5, 6)
|
||||
QT_WARNING_PUSH
|
||||
QT_WARNING_DISABLE_DEPRECATED
|
||||
emit q->error(processError);
|
||||
QT_WARNING_POP
|
||||
#endif
|
||||
}
|
||||
|
||||
/*!
|
||||
|
@ -108,8 +108,7 @@ using QProcEnvKey = QByteArray;
|
||||
class QProcEnvValue
|
||||
{
|
||||
public:
|
||||
QProcEnvValue() {}
|
||||
QProcEnvValue(const QProcEnvValue &other) { *this = other; }
|
||||
QProcEnvValue() = default;
|
||||
explicit QProcEnvValue(const QString &value) : stringValue(value) {}
|
||||
explicit QProcEnvValue(const QByteArray &value) : byteValue(value) {}
|
||||
bool operator==(const QProcEnvValue &other) const
|
||||
|
@ -999,6 +999,7 @@ void QCoreApplication::setQuitLockEnabled(bool enabled)
|
||||
quitLockRefEnabled = enabled;
|
||||
}
|
||||
|
||||
#if QT_DEPRECATED_SINCE(5, 6)
|
||||
/*!
|
||||
\internal
|
||||
\deprecated
|
||||
@ -1010,6 +1011,7 @@ bool QCoreApplication::notifyInternal(QObject *receiver, QEvent *event)
|
||||
{
|
||||
return notifyInternal2(receiver, event);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*!
|
||||
\internal
|
||||
@ -1183,28 +1185,26 @@ bool QCoreApplicationPrivate::notify_helper(QObject *receiver, QEvent * event)
|
||||
{
|
||||
// Note: when adjusting the tracepoints in here
|
||||
// consider adjusting QApplicationPrivate::notify_helper too.
|
||||
Q_TRACE_SCOPE(QCoreApplication_notify, receiver, event, event->type());
|
||||
Q_TRACE(QCoreApplication_notify_entry, receiver, event, event->type());
|
||||
bool consumed = false;
|
||||
bool filtered = false;
|
||||
Q_TRACE_EXIT(QCoreApplication_notify_exit, consumed, filtered);
|
||||
|
||||
// send to all application event filters (only does anything in the main thread)
|
||||
if (QCoreApplication::self
|
||||
&& receiver->d_func()->threadData->thread == mainThread()
|
||||
&& QCoreApplication::self->d_func()->sendThroughApplicationEventFilters(receiver, event)) {
|
||||
Q_TRACE(QCoreApplication_notify_event_filtered, receiver, event, event->type());
|
||||
return true;
|
||||
filtered = true;
|
||||
return filtered;
|
||||
}
|
||||
// send to all receiver event filters
|
||||
if (sendThroughObjectEventFilters(receiver, event)) {
|
||||
Q_TRACE(QCoreApplication_notify_event_filtered, receiver, event, event->type());
|
||||
return true;
|
||||
filtered = true;
|
||||
return filtered;
|
||||
}
|
||||
|
||||
Q_TRACE(QCoreApplication_notify_before_delivery, receiver, event, event->type());
|
||||
|
||||
// deliver the event
|
||||
const bool consumed = receiver->event(event);
|
||||
|
||||
Q_TRACE(QCoreApplication_notify_after_delivery, receiver, event, event->type(), consumed);
|
||||
|
||||
consumed = receiver->event(event);
|
||||
return consumed;
|
||||
}
|
||||
|
||||
|
@ -1457,8 +1457,9 @@ QThread *QObject::thread() const
|
||||
|
||||
\snippet code/src_corelib_kernel_qobject.cpp 7
|
||||
|
||||
If \a targetThread is zero, all event processing for this object
|
||||
and its children stops.
|
||||
If \a targetThread is \nullptr, all event processing for this object
|
||||
and its children stops, as they are no longer associated with any
|
||||
thread.
|
||||
|
||||
Note that all active timers for the object will be reset. The
|
||||
timers are first stopped in the current thread and restarted (with
|
||||
@ -1469,13 +1470,18 @@ QThread *QObject::thread() const
|
||||
A QEvent::ThreadChange event is sent to this object just before
|
||||
the thread affinity is changed. You can handle this event to
|
||||
perform any special processing. Note that any new events that are
|
||||
posted to this object will be handled in the \a targetThread.
|
||||
posted to this object will be handled in the \a targetThread,
|
||||
provided it is non-null: when it is \nullptr, no event processing
|
||||
for this object or its children can happen, as they are no longer
|
||||
associated with any thread.
|
||||
|
||||
\warning This function is \e not thread-safe; the current thread
|
||||
must be same as the current thread affinity. In other words, this
|
||||
function can only "push" an object from the current thread to
|
||||
another thread, it cannot "pull" an object from any arbitrary
|
||||
thread to the current thread.
|
||||
thread to the current thread. There is one exception to this rule
|
||||
however: objects with no thread affinity can be "pulled" to the
|
||||
current thread.
|
||||
|
||||
\sa thread()
|
||||
*/
|
||||
@ -3653,12 +3659,13 @@ void doActivate(QObject *sender, int signal_index, void **argv)
|
||||
if (sp->blockSig)
|
||||
return;
|
||||
|
||||
Q_TRACE_SCOPE(QMetaObject_activate, sender, signal_index);
|
||||
|
||||
if (sp->isDeclarativeSignalConnected(signal_index)
|
||||
&& QAbstractDeclarativeData::signalEmitted) {
|
||||
Q_TRACE(QMetaObject_activate_begin_declarative_signal, sender, signal_index);
|
||||
Q_TRACE_SCOPE(QMetaObject_activate_declarative_signal, sender, signal_index);
|
||||
QAbstractDeclarativeData::signalEmitted(sp->declarativeData, sender,
|
||||
signal_index, argv);
|
||||
Q_TRACE(QMetaObject_activate_end_declarative_signal, sender, signal_index);
|
||||
}
|
||||
|
||||
const QSignalSpyCallbackSet *signal_spy_set = callbacks_enabled ? qt_signal_spy_callback_set.load() : nullptr;
|
||||
@ -3671,8 +3678,6 @@ void doActivate(QObject *sender, int signal_index, void **argv)
|
||||
// The possible declarative connection is done, and nothing else is connected
|
||||
if (callbacks_enabled && signal_spy_set->signal_begin_callback != nullptr)
|
||||
signal_spy_set->signal_begin_callback(sender, signal_index, argv);
|
||||
Q_TRACE(QMetaObject_activate_begin_signal, sender, signal_index);
|
||||
Q_TRACE(QMetaObject_activate_end_signal, sender, signal_index);
|
||||
if (callbacks_enabled && signal_spy_set->signal_end_callback != nullptr)
|
||||
signal_spy_set->signal_end_callback(sender, signal_index);
|
||||
return;
|
||||
@ -3680,7 +3685,6 @@ void doActivate(QObject *sender, int signal_index, void **argv)
|
||||
|
||||
if (callbacks_enabled && signal_spy_set->signal_begin_callback != nullptr)
|
||||
signal_spy_set->signal_begin_callback(sender, signal_index, argv);
|
||||
Q_TRACE(QMetaObject_activate_begin_signal, sender, signal_index);
|
||||
|
||||
bool senderDeleted = false;
|
||||
{
|
||||
@ -3758,9 +3762,11 @@ void doActivate(QObject *sender, int signal_index, void **argv)
|
||||
if (c->isSlotObject) {
|
||||
c->slotObj->ref();
|
||||
QScopedPointer<QtPrivate::QSlotObjectBase, QSlotObjectBaseDeleter> obj(c->slotObj);
|
||||
Q_TRACE(QMetaObject_activate_begin_slot_functor, obj.data());
|
||||
obj->call(receiver, argv);
|
||||
Q_TRACE(QMetaObject_activate_end_slot_functor, obj.data());
|
||||
|
||||
{
|
||||
Q_TRACE_SCOPE(QMetaObject_activate_slot_functor, obj.data());
|
||||
obj->call(receiver, argv);
|
||||
}
|
||||
} else if (c->callFunction && c->method_offset <= receiver->metaObject()->methodOffset()) {
|
||||
//we compare the vtable to make sure we are not in the destructor of the object.
|
||||
const int method_relative = c->method_relative;
|
||||
@ -3768,11 +3774,12 @@ void doActivate(QObject *sender, int signal_index, void **argv)
|
||||
const int methodIndex = (Q_HAS_TRACEPOINTS || callbacks_enabled) ? c->method() : 0;
|
||||
if (callbacks_enabled && signal_spy_set->slot_begin_callback != nullptr)
|
||||
signal_spy_set->slot_begin_callback(receiver, methodIndex, argv);
|
||||
Q_TRACE(QMetaObject_activate_begin_slot, receiver, methodIndex);
|
||||
|
||||
callFunction(receiver, QMetaObject::InvokeMetaMethod, method_relative, argv);
|
||||
{
|
||||
Q_TRACE_SCOPE(QMetaObject_activate_slot, receiver, methodIndex);
|
||||
callFunction(receiver, QMetaObject::InvokeMetaMethod, method_relative, argv);
|
||||
}
|
||||
|
||||
Q_TRACE(QMetaObject_activate_end_slot, receiver, methodIndex);
|
||||
if (callbacks_enabled && signal_spy_set->slot_end_callback != nullptr)
|
||||
signal_spy_set->slot_end_callback(receiver, methodIndex);
|
||||
} else {
|
||||
@ -3781,11 +3788,12 @@ void doActivate(QObject *sender, int signal_index, void **argv)
|
||||
if (callbacks_enabled && signal_spy_set->slot_begin_callback != nullptr) {
|
||||
signal_spy_set->slot_begin_callback(receiver, method, argv);
|
||||
}
|
||||
Q_TRACE(QMetaObject_activate_begin_slot, receiver, method);
|
||||
|
||||
QMetaObject::metacall(receiver, QMetaObject::InvokeMetaMethod, method, argv);
|
||||
{
|
||||
Q_TRACE_SCOPE(QMetaObject_activate_slot, receiver, method);
|
||||
QMetaObject::metacall(receiver, QMetaObject::InvokeMetaMethod, method, argv);
|
||||
}
|
||||
|
||||
Q_TRACE(QMetaObject_activate_end_slot, receiver, method);
|
||||
if (callbacks_enabled && signal_spy_set->slot_end_callback != nullptr)
|
||||
signal_spy_set->slot_end_callback(receiver, method);
|
||||
}
|
||||
@ -3803,8 +3811,6 @@ void doActivate(QObject *sender, int signal_index, void **argv)
|
||||
|
||||
if (callbacks_enabled && signal_spy_set->signal_end_callback != nullptr)
|
||||
signal_spy_set->signal_end_callback(sender, signal_index);
|
||||
Q_TRACE(QMetaObject_activate_end_signal, sender, signal_index);
|
||||
|
||||
}
|
||||
|
||||
/*!
|
||||
|
@ -37,6 +37,9 @@
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include "qglobal.h"
|
||||
#if QT_DEPRECATED_SINCE(5, 10)
|
||||
|
||||
#include "qsignalmapper.h"
|
||||
#include "qhash.h"
|
||||
#include "qobject_p.h"
|
||||
@ -312,3 +315,4 @@ QT_END_NAMESPACE
|
||||
|
||||
#include "moc_qsignalmapper.cpp"
|
||||
|
||||
#endif
|
||||
|
@ -393,10 +393,13 @@ class Q_CORE_EXPORT QVariant
|
||||
: type(variantType), is_shared(false), is_null(false)
|
||||
{}
|
||||
|
||||
inline Private(const Private &other) noexcept
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
Private(const Private &other) noexcept
|
||||
: data(other.data), type(other.type),
|
||||
is_shared(other.is_shared), is_null(other.is_null)
|
||||
{}
|
||||
Private &operator=(const Private &other) noexcept = default;
|
||||
#endif
|
||||
union Data
|
||||
{
|
||||
char c;
|
||||
|
@ -16,7 +16,7 @@ QEvent_ctor(QEvent *event, int type)
|
||||
QEvent_dtor(QEvent *event, int type)
|
||||
|
||||
QCoreApplication_postEvent_entry(QObject *receiver, QEvent *event, int type)
|
||||
QCoreApplication_postEvent_exit(QObject *receiver, QEvent *event, int type)
|
||||
QCoreApplication_postEvent_exit()
|
||||
QCoreApplication_postEvent_event_compressed(QObject *receiver, QEvent *event)
|
||||
QCoreApplication_postEvent_event_posted(QObject *receiver, QEvent *event, int type)
|
||||
|
||||
@ -24,21 +24,18 @@ QCoreApplication_sendEvent(QObject *receiver, QEvent *event, int type)
|
||||
QCoreApplication_sendSpontaneousEvent(QObject *receiver, QEvent *event, int type)
|
||||
|
||||
QCoreApplication_notify_entry(QObject *receiver, QEvent *event, int type)
|
||||
QCoreApplication_notify_exit(QObject *receiver, QEvent *event, int type)
|
||||
QCoreApplication_notify_event_filtered(QObject *receiver, QEvent *event, int type)
|
||||
QCoreApplication_notify_before_delivery(QObject *receiver, QEvent *event, int type)
|
||||
QCoreApplication_notify_after_delivery(QObject *receiver, QEvent *event, int type, bool consumed)
|
||||
QCoreApplication_notify_exit(bool consumed, bool filtered)
|
||||
|
||||
QObject_ctor(QObject *object)
|
||||
QObject_dtor(QObject *object)
|
||||
|
||||
QMetaObject_activate_begin_signal(QObject *sender, int signalIndex)
|
||||
QMetaObject_activate_end_signal(QObject *sender, int signalIndex)
|
||||
QMetaObject_activate_begin_slot(QObject *receiver, int slotIndex)
|
||||
QMetaObject_activate_end_slot(QObject *receiver, int slotIndex)
|
||||
QMetaObject_activate_begin_slot_functor(void *slotObject)
|
||||
QMetaObject_activate_end_slot_functor(void *slotObject)
|
||||
QMetaObject_activate_begin_declarative_signal(QObject *sender, int signalIndex)
|
||||
QMetaObject_activate_end_declarative_signal(QObject *sender, int signalIndex)
|
||||
QMetaObject_activate_entry(QObject *sender, int signalIndex)
|
||||
QMetaObject_activate_exit()
|
||||
QMetaObject_activate_slot_entry(QObject *receiver, int slotIndex)
|
||||
QMetaObject_activate_slot_exit()
|
||||
QMetaObject_activate_slot_functor_entry(void *slotObject)
|
||||
QMetaObject_activate_slot_functor_exit()
|
||||
QMetaObject_activate_declarative_signal_entry(QObject *sender, int signalIndex)
|
||||
QMetaObject_activate_declarative_signal_exit()
|
||||
|
||||
qt_message_print(int type, const char *category, const char *function, const char *file, int line, const QString &message)
|
||||
|
@ -67,7 +67,7 @@ template <> struct QListSpecialMethods<QByteArray>
|
||||
{
|
||||
#ifndef Q_CLANG_QDOC
|
||||
protected:
|
||||
~QListSpecialMethods() {}
|
||||
~QListSpecialMethods() = default;
|
||||
#endif
|
||||
public:
|
||||
inline QByteArray join() const
|
||||
|
@ -74,7 +74,7 @@ template <typename T> class QSet;
|
||||
template <typename T> struct QListSpecialMethods
|
||||
{
|
||||
protected:
|
||||
~QListSpecialMethods() {}
|
||||
~QListSpecialMethods() = default;
|
||||
};
|
||||
template <> struct QListSpecialMethods<QByteArray>;
|
||||
template <> struct QListSpecialMethods<QString>;
|
||||
@ -247,6 +247,8 @@ public:
|
||||
// can't remove it in Qt 5, since doing so would make the type trivial,
|
||||
// which changes the way it's passed to functions by value.
|
||||
inline iterator(const iterator &o) noexcept : i(o.i){}
|
||||
inline iterator &operator=(const iterator &o) noexcept
|
||||
{ i = o.i; return *this; }
|
||||
#endif
|
||||
inline T &operator*() const { return i->t(); }
|
||||
inline T *operator->() const { return &i->t(); }
|
||||
@ -300,6 +302,8 @@ public:
|
||||
// can't remove it in Qt 5, since doing so would make the type trivial,
|
||||
// which changes the way it's passed to functions by value.
|
||||
inline const_iterator(const const_iterator &o) noexcept : i(o.i) {}
|
||||
inline const_iterator &operator=(const const_iterator &o) noexcept
|
||||
{ i = o.i; return *this; }
|
||||
#endif
|
||||
#ifdef QT_STRICT_ITERATORS
|
||||
inline explicit const_iterator(const iterator &o) noexcept : i(o.i) {}
|
||||
|
@ -332,6 +332,17 @@ static QString macCurrencySymbol(QLocale::CurrencySymbolFormat format)
|
||||
return QString();
|
||||
}
|
||||
|
||||
static QString macZeroDigit()
|
||||
{
|
||||
QCFType<CFLocaleRef> locale = CFLocaleCopyCurrent();
|
||||
QCFType<CFNumberFormatterRef> numberFormatter =
|
||||
CFNumberFormatterCreate(nullptr, locale, kCFNumberFormatterNoStyle);
|
||||
static const int zeroDigit = 0;
|
||||
QCFType<CFStringRef> value = CFNumberFormatterCreateStringWithValue(nullptr, numberFormatter,
|
||||
kCFNumberIntType, &zeroDigit);
|
||||
return QString::fromCFString(value);
|
||||
}
|
||||
|
||||
#ifndef QT_NO_SYSTEMLOCALE
|
||||
static QString macFormatCurrency(const QSystemLocale::CurrencyToStringArgument &arg)
|
||||
{
|
||||
@ -437,8 +448,9 @@ QVariant QSystemLocale::query(QueryType type, QVariant in = QVariant()) const
|
||||
|
||||
case NegativeSign:
|
||||
case PositiveSign:
|
||||
case ZeroDigit:
|
||||
break;
|
||||
case ZeroDigit:
|
||||
return QVariant(macZeroDigit());
|
||||
|
||||
case MeasurementSystem:
|
||||
return QVariant(static_cast<int>(macMeasurementSystem()));
|
||||
|
@ -649,19 +649,7 @@
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn template <class T> QSharedPointer<T> QSharedPointer<T>::create()
|
||||
\since 5.1
|
||||
|
||||
Creates a QSharedPointer object and allocates a new item of type \tt T. The
|
||||
QSharedPointer internals and the object are allocated in one single memory
|
||||
allocation, which could help reduce memory fragmentation in a long-running
|
||||
application.
|
||||
|
||||
This function calls the default constructor for type \tt T.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn template <class T> QSharedPointer<T> QSharedPointer<T>::create(...)
|
||||
\fn template <class T> template <typename... Args> QSharedPointer<T> QSharedPointer<T>::create(Args &&... args)
|
||||
\overload
|
||||
\since 5.1
|
||||
|
||||
@ -671,18 +659,7 @@
|
||||
application.
|
||||
|
||||
This function will attempt to call a constructor for type \tt T that can
|
||||
accept all the arguments passed. Arguments will be perfectly-forwarded.
|
||||
|
||||
\note This function is only fully available with a C++11 compiler that
|
||||
supports perfect forwarding of an arbitrary number of arguments.
|
||||
|
||||
If the compiler does not support the necessary C++11 features,
|
||||
then a restricted version is available since Qt 5.4: you may pass
|
||||
one (but just one) argument, and it will always be passed by const
|
||||
reference.
|
||||
|
||||
If you target Qt before version 5.4, you must use the overload
|
||||
that calls the default constructor.
|
||||
accept all the arguments passed (\a args). Arguments will be perfectly-forwarded.
|
||||
*/
|
||||
|
||||
/*!
|
||||
|
@ -97,8 +97,8 @@ public:
|
||||
template <class X> QSharedPointer<X> constCast() const;
|
||||
template <class X> QSharedPointer<X> objectCast() const;
|
||||
|
||||
static inline QSharedPointer<T> create();
|
||||
static inline QSharedPointer<T> create(...);
|
||||
template <typename... Args>
|
||||
static inline QSharedPointer<T> create(Args &&... args);
|
||||
};
|
||||
|
||||
template <class T>
|
||||
|
@ -67,7 +67,7 @@ template <> struct QListSpecialMethods<QString>
|
||||
{
|
||||
#ifndef Q_QDOC
|
||||
protected:
|
||||
~QListSpecialMethods() {}
|
||||
~QListSpecialMethods() = default;
|
||||
#endif
|
||||
public:
|
||||
inline void sort(Qt::CaseSensitivity cs = Qt::CaseSensitive);
|
||||
|
@ -1203,14 +1203,14 @@
|
||||
"label": " Using system FreeType",
|
||||
"enable": "input.freetype == 'system'",
|
||||
"disable": "input.freetype == 'qt'",
|
||||
"autoDetect": "!config.win32",
|
||||
"autoDetect": "!config.msvc",
|
||||
"condition": "features.freetype && libs.freetype",
|
||||
"output": [ "privateFeature" ]
|
||||
},
|
||||
"fontconfig": {
|
||||
"label": "Fontconfig",
|
||||
"autoDetect": "!config.darwin",
|
||||
"condition": "!config.win32 && features.system-freetype && libs.fontconfig",
|
||||
"condition": "!config.msvc && features.system-freetype && libs.fontconfig",
|
||||
"output": [ "privateFeature", "feature" ]
|
||||
},
|
||||
"gbm": {
|
||||
|
@ -181,7 +181,9 @@ ulong QGuiApplicationPrivate::mousePressTime = 0;
|
||||
Qt::MouseButton QGuiApplicationPrivate::mousePressButton = Qt::NoButton;
|
||||
int QGuiApplicationPrivate::mousePressX = 0;
|
||||
int QGuiApplicationPrivate::mousePressY = 0;
|
||||
int QGuiApplicationPrivate::mouse_double_click_distance = -1;
|
||||
|
||||
static int mouseDoubleClickDistance = -1;
|
||||
static int touchDoubleTapDistance = -1;
|
||||
|
||||
QWindow *QGuiApplicationPrivate::currentMousePressWindow = 0;
|
||||
|
||||
@ -259,6 +261,12 @@ static inline void clearFontUnlocked()
|
||||
QGuiApplicationPrivate::app_font = 0;
|
||||
}
|
||||
|
||||
static void initThemeHints()
|
||||
{
|
||||
mouseDoubleClickDistance = QGuiApplicationPrivate::platformTheme()->themeHint(QPlatformTheme::MouseDoubleClickDistance).toInt();
|
||||
touchDoubleTapDistance = QGuiApplicationPrivate::platformTheme()->themeHint(QPlatformTheme::TouchDoubleTapDistance).toInt();
|
||||
}
|
||||
|
||||
static bool checkNeedPortalSupport()
|
||||
{
|
||||
#if QT_CONFIG(dbus)
|
||||
@ -1523,8 +1531,7 @@ void QGuiApplicationPrivate::init()
|
||||
|
||||
initPalette();
|
||||
QFont::initialize();
|
||||
|
||||
mouse_double_click_distance = platformTheme()->themeHint(QPlatformTheme::MouseDoubleClickDistance).toInt();
|
||||
initThemeHints();
|
||||
|
||||
#ifndef QT_NO_CURSOR
|
||||
QCursorData::initialize();
|
||||
@ -2036,8 +2043,10 @@ void QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::Mo
|
||||
|
||||
if (mouseMove) {
|
||||
QGuiApplicationPrivate::lastCursorPosition = globalPoint;
|
||||
if (qAbs(globalPoint.x() - mousePressX) > mouse_double_click_distance||
|
||||
qAbs(globalPoint.y() - mousePressY) > mouse_double_click_distance)
|
||||
const auto doubleClickDistance = e->source == Qt::MouseEventNotSynthesized ?
|
||||
mouseDoubleClickDistance : touchDoubleTapDistance;
|
||||
if (qAbs(globalPoint.x() - mousePressX) > doubleClickDistance ||
|
||||
qAbs(globalPoint.y() - mousePressY) > doubleClickDistance)
|
||||
mousePressButton = Qt::NoButton;
|
||||
} else {
|
||||
mouse_buttons = e->buttons;
|
||||
@ -3963,6 +3972,7 @@ void QGuiApplicationPrivate::notifyThemeChanged()
|
||||
clearFontUnlocked();
|
||||
initFontUnlocked();
|
||||
}
|
||||
initThemeHints();
|
||||
}
|
||||
|
||||
void QGuiApplicationPrivate::sendApplicationPaletteChange(bool toAllWidgets, const char *className)
|
||||
|
@ -216,7 +216,6 @@ public:
|
||||
static Qt::MouseButton mousePressButton;
|
||||
static int mousePressX;
|
||||
static int mousePressY;
|
||||
static int mouse_double_click_distance;
|
||||
static QPointF lastCursorPosition;
|
||||
static QWindow *currentMouseWindow;
|
||||
static QWindow *currentMousePressWindow;
|
||||
|
@ -93,6 +93,8 @@ public:
|
||||
return indices16.size();
|
||||
}
|
||||
|
||||
QVertexIndexVector() = default;
|
||||
QVertexIndexVector(const QVertexIndexVector &other) = default;
|
||||
inline QVertexIndexVector &operator = (const QVertexIndexVector &other)
|
||||
{
|
||||
if (t == UnsignedInt)
|
||||
|
@ -8,7 +8,7 @@ QGuiApplicationPrivate_init_entry()
|
||||
QGuiApplicationPrivate_init_exit()
|
||||
|
||||
QGuiApplicationPrivate_processWindowSystemEvent_entry(int type)
|
||||
QGuiApplicationPrivate_processWindowSystemEvent_exit(int type)
|
||||
QGuiApplicationPrivate_processWindowSystemEvent_exit()
|
||||
|
||||
QFontDatabase_addApplicationFont(const QString &filename)
|
||||
QFontDatabase_load(const QString &family, int pointSize)
|
||||
|
@ -49,6 +49,8 @@
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
#ifndef QT_NO_PDF
|
||||
|
||||
// This map is used for symbol fonts to get the correct glyph names for the latin range
|
||||
static const unsigned short symbol_map[0x100] = {
|
||||
0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007,
|
||||
@ -90,7 +92,7 @@ static const unsigned short symbol_map[0x100] = {
|
||||
|
||||
// ---------------------------- PS/PDF helper methods -----------------------------------
|
||||
|
||||
#ifndef QT_NO_PDF
|
||||
|
||||
|
||||
QByteArray QFontSubset::glyphName(unsigned short unicode, bool symbol)
|
||||
{
|
||||
|
@ -1721,6 +1721,8 @@ QStringList QTextHtmlStyleSelector::nodeNames(NodePtr node) const
|
||||
|
||||
#endif // QT_NO_CSSPARSER
|
||||
|
||||
#ifndef QT_NO_CSSPARSER
|
||||
|
||||
static inline int findAttribute(const QStringList &attributes, const QString &name)
|
||||
{
|
||||
int idx = -1;
|
||||
@ -1730,8 +1732,6 @@ static inline int findAttribute(const QStringList &attributes, const QString &na
|
||||
return idx;
|
||||
}
|
||||
|
||||
#ifndef QT_NO_CSSPARSER
|
||||
|
||||
QString QTextHtmlStyleSelector::attribute(NodePtr node, const QString &name) const
|
||||
{
|
||||
const QStringList &attributes = parser->at(node.id).attributes;
|
||||
|
@ -263,6 +263,7 @@ public:
|
||||
iterator() : p(nullptr), b(0), e(0), n(0) {}
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
|
||||
iterator(const iterator &o) : p(o.p), b(o.b), e(o.e), n(o.n) {}
|
||||
iterator &operator=(const iterator &o) = default;
|
||||
#endif
|
||||
|
||||
QTextFragment fragment() const;
|
||||
|
@ -44,6 +44,8 @@
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
Q_LOGGING_CATEGORY(ShaderGenerator, "ShaderGenerator", QtWarningMsg)
|
||||
|
||||
namespace
|
||||
{
|
||||
QByteArray toGlsl(QShaderLanguage::StorageQualifier qualifier, const QShaderFormat &format)
|
||||
@ -342,18 +344,120 @@ QByteArray QShaderGenerator::createShaderCode(const QStringList &enabledLayers)
|
||||
code << QByteArrayLiteral("void main()");
|
||||
code << QByteArrayLiteral("{");
|
||||
|
||||
// Table to store temporary variables that should be replaced by global
|
||||
// variables. This avoids having vec3 v56 = vertexPosition; when we could
|
||||
const QRegularExpression localToGlobalRegExp(QStringLiteral("^.*\\s+(\\w+)\\s*=\\s*((?:\\w+\\(.*\\))|(?:\\w+)).*;$"));
|
||||
const QRegularExpression temporaryVariableToAssignmentRegExp(QStringLiteral("^(.*\\s+(v\\d+))\\s*=\\s*(.*);$"));
|
||||
const QRegularExpression temporaryVariableInAssignmentRegExp(QStringLiteral("\\W*(v\\d+)\\W*"));
|
||||
const QRegularExpression outputToTemporaryAssignmentRegExp(QStringLiteral("^\\s*(\\w+)\\s*=\\s*(.*);$"));
|
||||
|
||||
struct Variable;
|
||||
|
||||
struct Assignment
|
||||
{
|
||||
QString expression;
|
||||
QVector<Variable *> referencedVariables;
|
||||
};
|
||||
|
||||
struct Variable
|
||||
{
|
||||
enum Type {
|
||||
GlobalInput,
|
||||
TemporaryAssignment,
|
||||
Output
|
||||
};
|
||||
|
||||
QString name;
|
||||
QString declaration;
|
||||
int referenceCount = 0;
|
||||
Assignment assignment;
|
||||
Type type = TemporaryAssignment;
|
||||
bool substituted = false;
|
||||
|
||||
static void substitute(Variable *v)
|
||||
{
|
||||
if (v->substituted)
|
||||
return;
|
||||
|
||||
qCDebug(ShaderGenerator) << "Begin Substituting " << v->name << " = " << v->assignment.expression;
|
||||
for (Variable *ref : qAsConst(v->assignment.referencedVariables)) {
|
||||
// Recursively substitute
|
||||
Variable::substitute(ref);
|
||||
|
||||
// Replace all variables referenced only once in the assignment
|
||||
// by their actual expression
|
||||
if (ref->referenceCount == 1 || ref->type == Variable::GlobalInput) {
|
||||
const QRegularExpression r(QStringLiteral("(.*\\b)(%1)(\\b.*)").arg(ref->name));
|
||||
if (v->assignment.referencedVariables.size() == 1)
|
||||
v->assignment.expression.replace(r,
|
||||
QStringLiteral("\\1%2\\3").arg(ref->assignment.expression));
|
||||
else
|
||||
v->assignment.expression.replace(r,
|
||||
QStringLiteral("(\\1%2\\3)").arg(ref->assignment.expression));
|
||||
}
|
||||
}
|
||||
qCDebug(ShaderGenerator) << "Done Substituting " << v->name << " = " << v->assignment.expression;
|
||||
v->substituted = true;
|
||||
}
|
||||
};
|
||||
|
||||
struct LineContent
|
||||
{
|
||||
QByteArray rawContent;
|
||||
Variable *var = nullptr;
|
||||
};
|
||||
|
||||
// Table to store temporary variables that should be replaced:
|
||||
// - If variable references a a global variables
|
||||
// -> we will use the global variable directly
|
||||
// - If variable references a function results
|
||||
// -> will be kept only if variable is referenced more than once.
|
||||
// This avoids having vec3 v56 = vertexPosition; when we could
|
||||
// just use vertexPosition directly.
|
||||
// The added benefit is when having arrays, we don't try to create
|
||||
// mat4 v38 = skinningPalelette[100] which would be invalid
|
||||
QHash<QString, QString> localReferencesToGlobalInputs;
|
||||
const QRegularExpression localToGlobalRegExp(QStringLiteral("^.*\\s+(\\w+)\\s*=\\s*(\\w+).*;$"));
|
||||
QVector<Variable> temporaryVariables;
|
||||
// Reserve more than enough space to ensure no reallocation will take place
|
||||
temporaryVariables.reserve(nodes.size() * 8);
|
||||
|
||||
QVector<LineContent> lines;
|
||||
|
||||
auto createVariable = [&] () -> Variable * {
|
||||
Q_ASSERT(temporaryVariables.capacity() > 0);
|
||||
temporaryVariables.resize(temporaryVariables.size() + 1);
|
||||
return &temporaryVariables.last();
|
||||
};
|
||||
|
||||
auto findVariable = [&] (const QString &name) -> Variable * {
|
||||
const auto end = temporaryVariables.end();
|
||||
auto it = std::find_if(temporaryVariables.begin(), end,
|
||||
[=] (const Variable &a) { return a.name == name; });
|
||||
if (it != end)
|
||||
return &(*it);
|
||||
return nullptr;
|
||||
};
|
||||
|
||||
auto gatherTemporaryVariablesFromAssignment = [&] (Variable *v, const QString &assignmentContent) {
|
||||
QRegularExpressionMatchIterator subMatchIt = temporaryVariableInAssignmentRegExp.globalMatch(assignmentContent);
|
||||
while (subMatchIt.hasNext()) {
|
||||
const QRegularExpressionMatch subMatch = subMatchIt.next();
|
||||
const QString variableName = subMatch.captured(1);
|
||||
|
||||
// Variable we care about should already exists -> an expression cannot reference a variable that hasn't been defined
|
||||
Variable *u = findVariable(variableName);
|
||||
Q_ASSERT(u);
|
||||
|
||||
// Increase reference count for u
|
||||
++u->referenceCount;
|
||||
// Insert u as reference for variable v
|
||||
v->assignment.referencedVariables.push_back(u);
|
||||
}
|
||||
};
|
||||
|
||||
for (const QShaderGraph::Statement &statement : graph.createStatements(enabledLayers)) {
|
||||
const QShaderNode node = statement.node;
|
||||
QByteArray line = node.rule(format).substitution;
|
||||
const QVector<QShaderNodePort> ports = node.ports();
|
||||
|
||||
// Generate temporary variable names vN
|
||||
for (const QShaderNodePort &port : ports) {
|
||||
const QString portName = port.name;
|
||||
const QShaderNodePort::Direction portDirection = port.direction;
|
||||
@ -374,47 +478,117 @@ QByteArray QShaderGenerator::createShaderCode(const QStringList &enabledLayers)
|
||||
line.replace(placeholder, variable);
|
||||
}
|
||||
|
||||
// Substitute variable names by generated vN variable names
|
||||
const QByteArray substitutionedLine = replaceParameters(line, node, format);
|
||||
|
||||
Variable *v = nullptr;
|
||||
|
||||
switch (node.type()) {
|
||||
// Record name of temporary variable that possibly references a global input
|
||||
// We will replace the temporary variables by the matching global variables later
|
||||
bool isAGlobalInputVariable = false;
|
||||
if (node.type() == QShaderNode::Input) {
|
||||
case QShaderNode::Input: {
|
||||
const QRegularExpressionMatch match = localToGlobalRegExp.match(QString::fromUtf8(substitutionedLine));
|
||||
if (match.hasMatch()) {
|
||||
const QString localVariable = match.captured(1);
|
||||
const QString globalVariable = match.captured(2);
|
||||
if (globalInputVariables.contains(globalVariable)) {
|
||||
const QString localVariable = match.captured(1);
|
||||
// TO DO: Clean globalVariable (remove brackets ...)
|
||||
localReferencesToGlobalInputs.insert(localVariable, globalVariable);
|
||||
isAGlobalInputVariable = true;
|
||||
}
|
||||
|
||||
v = createVariable();
|
||||
v->name = localVariable;
|
||||
v->type = Variable::GlobalInput;
|
||||
|
||||
Assignment assignment;
|
||||
assignment.expression = globalVariable;
|
||||
v->assignment = assignment;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// Only insert content for lines aren't inputs or have not matching
|
||||
// globalVariables for now
|
||||
if (!isAGlobalInputVariable)
|
||||
code << QByteArrayLiteral(" ") + substitutionedLine;
|
||||
case QShaderNode::Function: {
|
||||
const QRegularExpressionMatch match = temporaryVariableToAssignmentRegExp.match(QString::fromUtf8(substitutionedLine));
|
||||
if (match.hasMatch()) {
|
||||
const QString localVariableDeclaration = match.captured(1);
|
||||
const QString localVariableName = match.captured(2);
|
||||
const QString assignmentContent = match.captured(3);
|
||||
|
||||
// Add new variable -> it cannot exist already
|
||||
v = createVariable();
|
||||
v->name = localVariableName;
|
||||
v->declaration = localVariableDeclaration;
|
||||
v->assignment.expression = assignmentContent;
|
||||
|
||||
// Find variables that may be referenced in the assignment
|
||||
gatherTemporaryVariablesFromAssignment(v, assignmentContent);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case QShaderNode::Output: {
|
||||
const QRegularExpressionMatch match = outputToTemporaryAssignmentRegExp.match(QString::fromUtf8(substitutionedLine));
|
||||
if (match.hasMatch()) {
|
||||
const QString outputDeclaration = match.captured(1);
|
||||
const QString assignmentContent = match.captured(2);
|
||||
|
||||
v = createVariable();
|
||||
v->name = outputDeclaration;
|
||||
v->declaration = outputDeclaration;
|
||||
v->type = Variable::Output;
|
||||
|
||||
Assignment assignment;
|
||||
assignment.expression = assignmentContent;
|
||||
v->assignment = assignment;
|
||||
|
||||
// Find variables that may be referenced in the assignment
|
||||
gatherTemporaryVariablesFromAssignment(v, assignmentContent);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case QShaderNode::Invalid:
|
||||
break;
|
||||
}
|
||||
|
||||
LineContent lineContent;
|
||||
lineContent.rawContent = QByteArray(QByteArrayLiteral(" ") + substitutionedLine);
|
||||
lineContent.var = v;
|
||||
lines << lineContent;
|
||||
}
|
||||
|
||||
// Go through all lines
|
||||
// Perform substitution of line with temporary variables substitution
|
||||
for (LineContent &lineContent : lines) {
|
||||
Variable *v = lineContent.var;
|
||||
qCDebug(ShaderGenerator) << lineContent.rawContent;
|
||||
if (v != nullptr) {
|
||||
Variable::substitute(v);
|
||||
|
||||
qCDebug(ShaderGenerator) << "Line " << lineContent.rawContent << "is assigned to temporary" << v->name;
|
||||
|
||||
// Check number of occurrences a temporary variable is referenced
|
||||
if (v->referenceCount == 1 || v->type == Variable::GlobalInput) {
|
||||
// If it is referenced only once, no point in creating a temporary
|
||||
// Clear content for current line
|
||||
lineContent.rawContent.clear();
|
||||
// We assume expression that were referencing vN will have vN properly substituted
|
||||
} else {
|
||||
lineContent.rawContent = QStringLiteral(" %1 = %2;").arg(v->declaration)
|
||||
.arg(v->assignment.expression)
|
||||
.toUtf8();
|
||||
}
|
||||
|
||||
qCDebug(ShaderGenerator) << "Updated Line is " << lineContent.rawContent;
|
||||
}
|
||||
}
|
||||
|
||||
// Go throug all lines and insert content
|
||||
for (const LineContent &lineContent : qAsConst(lines)) {
|
||||
if (!lineContent.rawContent.isEmpty()) {
|
||||
code << lineContent.rawContent;
|
||||
}
|
||||
}
|
||||
|
||||
code << QByteArrayLiteral("}");
|
||||
code << QByteArray();
|
||||
|
||||
// Replace occurrences of local variables which reference a global variable
|
||||
// by the global variables directly
|
||||
auto it = localReferencesToGlobalInputs.cbegin();
|
||||
const auto end = localReferencesToGlobalInputs.cend();
|
||||
QString codeString = QString::fromUtf8(code.join('\n'));
|
||||
|
||||
while (it != end) {
|
||||
const QRegularExpression r(QStringLiteral("\\b(%1)([\\b|\\.|;|\\)|\\[|\\s|\\*|\\+|\\/|\\-|,])").arg(it.key()),
|
||||
QRegularExpression::MultilineOption);
|
||||
codeString.replace(r, QStringLiteral("%1\\2").arg(it.value()));
|
||||
++it;
|
||||
}
|
||||
|
||||
return codeString.toUtf8();
|
||||
return code.join('\n');
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
@ -54,9 +54,13 @@
|
||||
#include <QtGui/private/qtguiglobal_p.h>
|
||||
|
||||
#include <QtGui/private/qshadergraph_p.h>
|
||||
#include <QtCore/QLoggingCategory>
|
||||
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
Q_DECLARE_LOGGING_CATEGORY(ShaderGenerator)
|
||||
|
||||
class QShaderGenerator
|
||||
{
|
||||
public:
|
||||
|
@ -818,7 +818,6 @@ void QHttp2ProtocolHandler::handleGOAWAY()
|
||||
// and a NO_ERROR code."
|
||||
if (lastStreamID != Http2::lastValidStreamID || errorCode != HTTP2_NO_ERROR)
|
||||
return connectionError(PROTOCOL_ERROR, "GOAWAY invalid stream/error code");
|
||||
lastStreamID = 1;
|
||||
} else {
|
||||
lastStreamID += 2;
|
||||
}
|
||||
@ -836,6 +835,14 @@ void QHttp2ProtocolHandler::handleGOAWAY()
|
||||
QString message;
|
||||
qt_error(errorCode, error, message);
|
||||
|
||||
// Even if the GOAWAY frame contains NO_ERROR we must send an error
|
||||
// when terminating streams to ensure users can distinguish from a
|
||||
// successful completion.
|
||||
if (errorCode == HTTP2_NO_ERROR) {
|
||||
error = QNetworkReply::ContentReSendError;
|
||||
message = QLatin1String("Server stopped accepting new streams before this stream was established");
|
||||
}
|
||||
|
||||
for (quint32 id = lastStreamID; id < nextID; id += 2) {
|
||||
const auto it = activeStreams.find(id);
|
||||
if (it != activeStreams.end()) {
|
||||
|
@ -1118,7 +1118,7 @@ static bool addFontToDatabase(QString familyName,
|
||||
}
|
||||
|
||||
static int QT_WIN_CALLBACK storeFont(const LOGFONT *logFont, const TEXTMETRIC *textmetric,
|
||||
DWORD type, LPARAM)
|
||||
DWORD type, LPARAM lparam)
|
||||
{
|
||||
const ENUMLOGFONTEX *f = reinterpret_cast<const ENUMLOGFONTEX *>(logFont);
|
||||
const QString familyName = QString::fromWCharArray(f->elfLogFont.lfFaceName);
|
||||
@ -1128,8 +1128,16 @@ static int QT_WIN_CALLBACK storeFont(const LOGFONT *logFont, const TEXTMETRIC *t
|
||||
// to the documentation is identical to a TEXTMETRIC except for the last four
|
||||
// members, which we don't use anyway
|
||||
const FONTSIGNATURE *signature = nullptr;
|
||||
if (type & TRUETYPE_FONTTYPE)
|
||||
if (type & TRUETYPE_FONTTYPE) {
|
||||
signature = &reinterpret_cast<const NEWTEXTMETRICEX *>(textmetric)->ntmFontSig;
|
||||
// We get a callback for each script-type supported, but we register them all
|
||||
// at once using the signature, so we only need one call to addFontToDatabase().
|
||||
QSet<QPair<QString,QString>> *foundFontAndStyles = reinterpret_cast<QSet<QPair<QString,QString>> *>(lparam);
|
||||
QPair<QString,QString> fontAndStyle(familyName, styleName);
|
||||
if (foundFontAndStyles->contains(fontAndStyle))
|
||||
return 1;
|
||||
foundFontAndStyles->insert(fontAndStyle);
|
||||
}
|
||||
addFontToDatabase(familyName, styleName, *logFont, textmetric, signature, type);
|
||||
|
||||
// keep on enumerating
|
||||
@ -1149,7 +1157,8 @@ void QWindowsFontDatabase::populateFamily(const QString &familyName)
|
||||
familyName.toWCharArray(lf.lfFaceName);
|
||||
lf.lfFaceName[familyName.size()] = 0;
|
||||
lf.lfPitchAndFamily = 0;
|
||||
EnumFontFamiliesEx(dummy, &lf, storeFont, 0, 0);
|
||||
QSet<QPair<QString,QString>> foundFontAndStyles;
|
||||
EnumFontFamiliesEx(dummy, &lf, storeFont, reinterpret_cast<intptr_t>(&foundFontAndStyles), 0);
|
||||
ReleaseDC(0, dummy);
|
||||
}
|
||||
|
||||
|
@ -307,7 +307,7 @@ static bool addFontToDatabase(QString familyName,
|
||||
}
|
||||
|
||||
static int QT_WIN_CALLBACK storeFont(const LOGFONT *logFont, const TEXTMETRIC *textmetric,
|
||||
DWORD type, LPARAM)
|
||||
DWORD type, LPARAM lparam)
|
||||
{
|
||||
const ENUMLOGFONTEX *f = reinterpret_cast<const ENUMLOGFONTEX *>(logFont);
|
||||
const QString faceName = QString::fromWCharArray(f->elfLogFont.lfFaceName);
|
||||
@ -318,8 +318,16 @@ static int QT_WIN_CALLBACK storeFont(const LOGFONT *logFont, const TEXTMETRIC *t
|
||||
// to the documentation is identical to a TEXTMETRIC except for the last four
|
||||
// members, which we don't use anyway
|
||||
const FONTSIGNATURE *signature = nullptr;
|
||||
if (type & TRUETYPE_FONTTYPE)
|
||||
if (type & TRUETYPE_FONTTYPE) {
|
||||
signature = &reinterpret_cast<const NEWTEXTMETRICEX *>(textmetric)->ntmFontSig;
|
||||
// We get a callback for each script-type supported, but we register them all
|
||||
// at once using the signature, so we only need one call to addFontToDatabase().
|
||||
QSet<QPair<QString,QString>> *foundFontAndStyles = reinterpret_cast<QSet<QPair<QString,QString>> *>(lparam);
|
||||
QPair<QString,QString> fontAndStyle(faceName, styleName);
|
||||
if (foundFontAndStyles->contains(fontAndStyle))
|
||||
return 1;
|
||||
foundFontAndStyles->insert(fontAndStyle);
|
||||
}
|
||||
addFontToDatabase(faceName, styleName, fullName, *logFont, textmetric, signature, type);
|
||||
|
||||
// keep on enumerating
|
||||
@ -348,7 +356,8 @@ void QWindowsFontDatabaseFT::populateFamily(const QString &familyName)
|
||||
lf.lfFaceName[familyName.size()] = 0;
|
||||
lf.lfCharSet = DEFAULT_CHARSET;
|
||||
lf.lfPitchAndFamily = 0;
|
||||
EnumFontFamiliesEx(dummy, &lf, storeFont, 0, 0);
|
||||
QSet<QPair<QString,QString>> foundFontAndStyles;
|
||||
EnumFontFamiliesEx(dummy, &lf, storeFont, reinterpret_cast<intptr_t>(&foundFontAndStyles), 0);
|
||||
ReleaseDC(0, dummy);
|
||||
}
|
||||
|
||||
|
@ -55,6 +55,8 @@
|
||||
#include <QtDBus/QDBusConnection>
|
||||
#include <QtDBus/QDBusVariant>
|
||||
|
||||
#include <QtGui/qtgui-config.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class QDBusServiceWatcher;
|
||||
|
@ -978,15 +978,25 @@ jboolean QAndroidInputContext::deleteSurroundingText(jint leftLength, jint right
|
||||
m_composingText.clear();
|
||||
m_composingTextStart = -1;
|
||||
|
||||
QString text = query->value(Qt::ImSurroundingText).toString();
|
||||
if (text.isEmpty())
|
||||
return JNI_TRUE;
|
||||
|
||||
if (leftLength < 0) {
|
||||
rightLength += -leftLength;
|
||||
leftLength = 0;
|
||||
}
|
||||
|
||||
QVariant textBeforeCursor = query->value(Qt::ImTextBeforeCursor);
|
||||
QVariant textAfterCursor = query->value(Qt::ImTextAfterCursor);
|
||||
if (textBeforeCursor.isValid() && textAfterCursor.isValid()) {
|
||||
leftLength = qMin(leftLength, textBeforeCursor.toString().length());
|
||||
rightLength = qMin(rightLength, textAfterCursor.toString().length());
|
||||
} else {
|
||||
int cursorPos = query->value(Qt::ImCursorPosition).toInt();
|
||||
leftLength = qMin(leftLength, cursorPos);
|
||||
rightLength = qMin(rightLength, query->value(Qt::ImSurroundingText).toString().length() - cursorPos);
|
||||
}
|
||||
|
||||
if (leftLength == 0 && rightLength == 0)
|
||||
return JNI_TRUE;
|
||||
|
||||
QInputMethodEvent event;
|
||||
event.setCommitString(QString(), -leftLength, leftLength+rightLength);
|
||||
sendInputMethodEvent(&event);
|
||||
@ -1075,6 +1085,14 @@ const QAndroidInputContext::ExtractedText &QAndroidInputContext::getExtractedTex
|
||||
int cpos = localPos + composeLength; //actual cursor pos relative to the current block
|
||||
|
||||
int localOffset = 0; // start of extracted text relative to the current block
|
||||
if (blockPos > 0) {
|
||||
QString prevBlockEnding = query->value(Qt::ImTextBeforeCursor).toString();
|
||||
prevBlockEnding.chop(localPos);
|
||||
if (prevBlockEnding.endsWith(QLatin1Char('\n'))) {
|
||||
localOffset = -qMin(20, prevBlockEnding.length());
|
||||
blockText = prevBlockEnding.right(-localOffset) + blockText;
|
||||
}
|
||||
}
|
||||
|
||||
// It is documented that we should try to return hintMaxChars
|
||||
// characters, but that's not what the standard Android controls do, and
|
||||
|
@ -42,8 +42,9 @@
|
||||
#define QCOCOASYSTEMTRAYICON_P_H
|
||||
|
||||
#include <QtCore/qglobal.h>
|
||||
#include <QtGui/qtguiglobal.h>
|
||||
|
||||
#ifndef QT_NO_SYSTEMTRAYICON
|
||||
#if QT_CONFIG(systemtrayicon)
|
||||
|
||||
#include "QtCore/qstring.h"
|
||||
#include "QtGui/qpa/qplatformsystemtrayicon.h"
|
||||
|
@ -293,7 +293,26 @@ static QPoint mapWindowCoordinates(QWindow *source, QWindow *target, QPoint poin
|
||||
QCocoaDrag* nativeDrag = QCocoaIntegration::instance()->drag();
|
||||
nativeDrag->setAcceptedAction(qt_mac_mapNSDragOperation(operation));
|
||||
|
||||
// Qt starts drag-and-drop on a mouse button press event. Cococa in
|
||||
// this case won't send the matching release event, so we have to
|
||||
// synthesize it here.
|
||||
m_buttons = currentlyPressedMouseButtons();
|
||||
const auto modifiers = [QNSView convertKeyModifiers:NSApp.currentEvent.modifierFlags];
|
||||
|
||||
NSPoint windowPoint = [self.window convertRectFromScreen:NSMakeRect(screenPoint.x, screenPoint.y, 1, 1)].origin;
|
||||
NSPoint nsViewPoint = [self convertPoint: windowPoint fromView: nil];
|
||||
|
||||
QPoint qtWindowPoint(nsViewPoint.x, nsViewPoint.y);
|
||||
QPoint qtScreenPoint = QCocoaScreen::mapFromNative(screenPoint).toPoint();
|
||||
|
||||
QWindowSystemInterface::handleMouseEvent(
|
||||
target,
|
||||
mapWindowCoordinates(m_platformWindow->window(), target, qtWindowPoint),
|
||||
qtScreenPoint,
|
||||
m_buttons,
|
||||
Qt::NoButton,
|
||||
QEvent::MouseButtonRelease,
|
||||
modifiers);
|
||||
|
||||
qCDebug(lcQpaMouse) << "Drag session" << session << "ended, with" << m_buttons;
|
||||
}
|
||||
|
@ -404,7 +404,7 @@ function QtLoader(config)
|
||||
Module.preRun = Module.preRun || []
|
||||
Module.preRun.push(function() {
|
||||
for (var [key, value] of Object.entries(config.environment)) {
|
||||
Module.ENV[key.toUpperCase()] = value;
|
||||
ENV[key.toUpperCase()] = value;
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -568,11 +568,8 @@ void QWasmEventTranslator::processMouse(int eventType, const EmscriptenMouseEven
|
||||
switch (eventType) {
|
||||
case EMSCRIPTEN_EVENT_MOUSEDOWN:
|
||||
{
|
||||
if (window2) {
|
||||
window2->raise();
|
||||
if (!window2->isActive())
|
||||
window2->requestActivate();
|
||||
}
|
||||
if (window2)
|
||||
window2->requestActivate();
|
||||
|
||||
pressedButtons.setFlag(button);
|
||||
|
||||
|
@ -550,6 +550,7 @@ void QXcbIntegration::beep() const
|
||||
return;
|
||||
xcb_connection_t *connection = static_cast<QXcbScreen *>(screen)->xcb_connection();
|
||||
xcb_bell(connection, 0);
|
||||
xcb_flush(connection);
|
||||
}
|
||||
|
||||
bool QXcbIntegration::nativePaintingEnabled() const
|
||||
|
@ -1730,6 +1730,11 @@ bool scanImports(Options *options, QSet<QString> *usedDependencies)
|
||||
.arg(shellQuote(rootPath))
|
||||
.arg(importPaths.join(QLatin1Char(' ')));
|
||||
|
||||
if (options->verbose) {
|
||||
fprintf(stdout, "Running qmlimportscanner with the following command: %s\n",
|
||||
qmlImportScanner.toLocal8Bit().constData());
|
||||
}
|
||||
|
||||
FILE *qmlImportScannerCommand = popen(qmlImportScanner.toLocal8Bit().constData(), QT_POPEN_READ);
|
||||
if (qmlImportScannerCommand == 0) {
|
||||
fprintf(stderr, "Couldn't run qmlimportscanner.\n");
|
||||
@ -2898,6 +2903,8 @@ int main(int argc, char *argv[])
|
||||
return CannotCopyQtFiles;
|
||||
if (!copyAndroidExtraResources(options))
|
||||
return CannotCopyAndroidExtraResources;
|
||||
if (!copyAndroidExtraLibs(options))
|
||||
return CannotCopyAndroidExtraLibs;
|
||||
if (!stripLibraries(options))
|
||||
return CannotStripLibraries;
|
||||
if (!updateAndroidFiles(options))
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user