diff --git a/examples/network/doc/images/googlesuggest-example.png b/examples/network/doc/images/googlesuggest-example.png index 477d444cbd..c704f5b2b4 100644 Binary files a/examples/network/doc/images/googlesuggest-example.png and b/examples/network/doc/images/googlesuggest-example.png differ diff --git a/examples/network/doc/src/googlesuggest.qdoc b/examples/network/doc/src/googlesuggest.qdoc index 912947dfdf..168515446f 100644 --- a/examples/network/doc/src/googlesuggest.qdoc +++ b/examples/network/doc/src/googlesuggest.qdoc @@ -68,12 +68,8 @@ in the explicit \c editor member variable. We then create a QTreeWidget as a toplevel widget and configure the various - properties to give it the look of a popup widget. - - The popup will be populated by the results returned from Google. We set - the number of columns to be two, since we want to display both the - suggested search term and the number of hits it will trigger in the search - engine. + properties to give it the look of a popup widget. The widget is populated + with the results by Google Suggest API request. Furthermore, we install the GSuggestCompletion instance as an event filter on the QTreeWidget, and connect the \c itemClicked() signal with the \c @@ -110,8 +106,8 @@ \snippet googlesuggest/googlesuggest.cpp 4 The \c showCompletion() function populates the QTreeWidget with the results - returned from the query. It takes two QStringLists, one with the suggested - search terms and the other with the corresponding number of hits. + returned from the query. It takes a QStringList of the suggested search + terms. \snippet googlesuggest/googlesuggest.cpp 5 diff --git a/examples/network/googlesuggest/googlesuggest.cpp b/examples/network/googlesuggest/googlesuggest.cpp index ce727e7675..576629d46b 100644 --- a/examples/network/googlesuggest/googlesuggest.cpp +++ b/examples/network/googlesuggest/googlesuggest.cpp @@ -38,7 +38,6 @@ ** ****************************************************************************/ - //! [1] #include "googlesuggest.h" @@ -54,7 +53,7 @@ GSuggestCompletion::GSuggestCompletion(QLineEdit *parent): QObject(parent), edit popup->setFocusProxy(parent); popup->setMouseTracking(true); - popup->setColumnCount(2); + popup->setColumnCount(1); popup->setUniformRowHeights(true); popup->setRootIsDecorated(false); popup->setEditTriggers(QTreeWidget::NoEditTriggers); @@ -137,10 +136,10 @@ bool GSuggestCompletion::eventFilter(QObject *obj, QEvent *ev) //! [4] //! [5] -void GSuggestCompletion::showCompletion(const QStringList &choices, const QStringList &hits) +void GSuggestCompletion::showCompletion(const QStringList &choices) { - if (choices.isEmpty() || choices.count() != hits.count()) + if (choices.isEmpty()) return; const QPalette &pal = editor->palette(); @@ -152,19 +151,12 @@ void GSuggestCompletion::showCompletion(const QStringList &choices, const QStrin QTreeWidgetItem * item; item = new QTreeWidgetItem(popup); item->setText(0, choices[i]); - item->setText(1, hits[i]); - item->setTextAlignment(1, Qt::AlignRight); - item->setTextColor(1, color); + item->setTextColor(0, color); } popup->setCurrentItem(popup->topLevelItem(0)); popup->resizeColumnToContents(0); - popup->resizeColumnToContents(1); - popup->adjustSize(); popup->setUpdatesEnabled(true); - int h = popup->sizeHintForRow(0) * qMin(7, choices.count()) + 3; - popup->resize(popup->width(), h); - popup->move(editor->mapToGlobal(QPoint(0, editor->height()))); popup->setFocus(); popup->show(); @@ -207,7 +199,6 @@ void GSuggestCompletion::handleNetworkData(QNetworkReply *networkReply) QUrl url = networkReply->url(); if (!networkReply->error()) { QStringList choices; - QStringList hits; QByteArray response(networkReply->readAll()); QXmlStreamReader xml(response); @@ -218,17 +209,11 @@ void GSuggestCompletion::handleNetworkData(QNetworkReply *networkReply) QStringRef str = xml.attributes().value("data"); choices << str.toString(); } - if (xml.tokenType() == QXmlStreamReader::StartElement) - if (xml.name() == "num_queries") { - QStringRef str = xml.attributes().value("int"); - hits << str.toString(); - } } - showCompletion(choices, hits); + showCompletion(choices); } networkReply->deleteLater(); } //! [9] - diff --git a/examples/network/googlesuggest/googlesuggest.h b/examples/network/googlesuggest/googlesuggest.h index dfa04cd009..e53fe996d4 100644 --- a/examples/network/googlesuggest/googlesuggest.h +++ b/examples/network/googlesuggest/googlesuggest.h @@ -61,7 +61,7 @@ public: GSuggestCompletion(QLineEdit *parent = 0); ~GSuggestCompletion(); bool eventFilter(QObject *obj, QEvent *ev) Q_DECL_OVERRIDE; - void showCompletion(const QStringList &choices, const QStringList &hits); + void showCompletion(const QStringList &choices); public slots: diff --git a/mkspecs/common/qcc-base-qnx-armle-v7.conf b/mkspecs/common/qcc-base-qnx-armle-v7.conf index 331a65b2bf..12d393f070 100644 --- a/mkspecs/common/qcc-base-qnx-armle-v7.conf +++ b/mkspecs/common/qcc-base-qnx-armle-v7.conf @@ -10,6 +10,7 @@ include(unix.conf) QMAKE_CC = qcc -Vgcc_ntoarmv7le QMAKE_CXX = qcc -Vgcc_ntoarmv7le QNX_CPUDIR = armle-v7 +QMAKE_CFLAGS += -mfpu=neon include(qcc-base-qnx.conf) diff --git a/mkspecs/common/qcc-base.conf b/mkspecs/common/qcc-base.conf index f529d7fc7b..09fdabce43 100644 --- a/mkspecs/common/qcc-base.conf +++ b/mkspecs/common/qcc-base.conf @@ -33,7 +33,6 @@ QMAKE_CFLAGS_SSE4_1 += -msse4.1 QMAKE_CFLAGS_SSE4_2 += -msse4.2 QMAKE_CFLAGS_AVX += -mavx QMAKE_CFLAGS_AVX2 += -mavx2 -QMAKE_CFLAGS_NEON += -mfpu=neon QMAKE_CXXFLAGS += $$QMAKE_CFLAGS -lang-c++ QMAKE_CXXFLAGS_DEPS += $$QMAKE_CFLAGS_DEPS diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf index ff1f5f8940..89870f4f51 100644 --- a/mkspecs/features/qt_functions.prf +++ b/mkspecs/features/qt_functions.prf @@ -80,7 +80,7 @@ defineTest(qtAddModule) { unset(LINKAGE) mac:contains(MODULE_CONFIG, lib_bundle) { FRAMEWORK_INCLUDE = $${MODULE_LIBS}/$${MODULE_NAME}.framework/Headers - !qt_no_framework_direct_includes:exists($$FRAMEWORK_INCLUDE) { + !qt_no_framework_direct_includes { INCLUDEPATH *= $$FRAMEWORK_INCLUDE } contains(MODULE_CONFIG, internal_module): \ diff --git a/mkspecs/features/static_runtime.prf b/mkspecs/features/static_runtime.prf new file mode 100644 index 0000000000..3275e6e2e2 --- /dev/null +++ b/mkspecs/features/static_runtime.prf @@ -0,0 +1,7 @@ +msvc { + # -MD becomes -MT, -MDd becomes -MTd + QMAKE_CFLAGS ~= s,^-MD(d?)$, -MT\1,g + QMAKE_CXXFLAGS ~= s,^-MD(d?)$, -MT\1,g +} else: mingw { + QMAKE_LFLAGS += -static +} diff --git a/mkspecs/features/testcase.prf b/mkspecs/features/testcase.prf index c77f3b70ab..a6ef930128 100644 --- a/mkspecs/features/testcase.prf +++ b/mkspecs/features/testcase.prf @@ -52,25 +52,18 @@ insignificant_test:check.commands = -$${check.commands} QMAKE_EXTRA_TARGETS *= check -!debug_and_release|build_pass { +isEmpty(BUILDS)|build_pass { check.depends = first } else { + # For exclusive builds, only run the test once. check.CONFIG = recursive - # In debug and release mode, only run the test once. - # Run debug if that is the preferred config, release otherwise. - debug_and_release { - check.target = dummy_check - check.recurse_target = check - CONFIG(debug, debug|release) { - real_check.depends = debug-check - real_check.target = check - QMAKE_EXTRA_TARGETS += real_check - } else { - real_check.depends = release-check - real_check.target = check - QMAKE_EXTRA_TARGETS += real_check - } - } + check.target = check_all + check.recurse_target = check + check.commands = + + check_first.depends = $$eval($$first(BUILDS).target)-check + check_first.target = check + QMAKE_EXTRA_TARGETS += check_first } !no_testcase_installs:!contains(INSTALLS, target) { diff --git a/mkspecs/features/unix/separate_debug_info.prf b/mkspecs/features/unix/separate_debug_info.prf index 394d5f42bc..7d9022f8d7 100644 --- a/mkspecs/features/unix/separate_debug_info.prf +++ b/mkspecs/features/unix/separate_debug_info.prf @@ -9,19 +9,21 @@ have_target:!static:!isEmpty(QMAKE_OBJCOPY) { debug_info_keep = --only-keep-debug debug_info_strip = --strip-debug } - QMAKE_SEPARATE_DEBUG_INFO = test -z \"$(DESTDIR)\" || cd \"$(DESTDIR)\" ; targ=`basename $(TARGET)`; $$QMAKE_OBJCOPY $$debug_info_keep \"\$\$targ\" \"\$\$targ.$$debug_info_suffix\" && $$QMAKE_OBJCOPY $$debug_info_strip \"\$\$targ\" && $$QMAKE_OBJCOPY --add-gnu-debuglink=\"\$\$targ.$$debug_info_suffix\" \"\$\$targ\" && chmod -x \"\$\$targ.$$debug_info_suffix\" - QMAKE_INSTALL_SEPARATE_DEBUG_INFO = test -z \"$(DESTDIR)\" || cd \"$(DESTDIR)\" ; $(INSTALL_FILE) `basename $(TARGET)`.$$debug_info_suffix $(INSTALL_ROOT)/\$\$target_path/ + load(resolve_target) + QMAKE_TARGET_DEBUG_INFO = $${QMAKE_RESOLVED_TARGET}.$$debug_info_suffix + + shell_target = $$shell_quote($$relative_path($$QMAKE_RESOLVED_TARGET, $$OUT_PWD)) + shell_target_debug_info = $$shell_quote($$relative_path($$QMAKE_TARGET_DEBUG_INFO, $$OUT_PWD)) + copy_debug_info = $$QMAKE_OBJCOPY $$debug_info_keep $$shell_target $$shell_target_debug_info + strip_debug_info = $$QMAKE_OBJCOPY $$debug_info_strip $$shell_target + link_debug_info = $$QMAKE_OBJCOPY --add-gnu-debuglink=$$shell_target_debug_info $$shell_target + chmod_debug_info = chmod -x $$shell_target_debug_info !isEmpty(QMAKE_POST_LINK):QMAKE_POST_LINK = $$escape_expand(\\n\\t)$$QMAKE_POST_LINK - QMAKE_POST_LINK = $$QMAKE_SEPARATE_DEBUG_INFO $$QMAKE_POST_LINK + QMAKE_POST_LINK = $$copy_debug_info && $$strip_debug_info && $$link_debug_info && $$chmod_debug_info $$QMAKE_POST_LINK silent:QMAKE_POST_LINK = @echo creating $@.$$debug_info_suffix && $$QMAKE_POST_LINK - isEmpty(DESTDIR) { - target.targets += "`basename $(TARGET)`.$$debug_info_suffix" - QMAKE_DISTCLEAN += "`basename $(TARGET)`.$$debug_info_suffix" - } else { - target.targets += "$(DESTDIR)/`basename $(TARGET)`.$$debug_info_suffix" - QMAKE_DISTCLEAN += "$(DESTDIR)/`basename $(TARGET)`.$$debug_info_suffix" - } + target.targets += $$QMAKE_TARGET_DEBUG_INFO + QMAKE_DISTCLEAN += $$QMAKE_TARGET_DEBUG_INFO } diff --git a/mkspecs/features/winrt/package_manifest.prf b/mkspecs/features/winrt/package_manifest.prf index 6726611f74..7e5effa438 100644 --- a/mkspecs/features/winrt/package_manifest.prf +++ b/mkspecs/features/winrt/package_manifest.prf @@ -71,7 +71,9 @@ exists($$UUID_CACHE) { include($$UUID_CACHE) } else { - WINRT_UUID = "WINRT_MANIFEST.identity = $$system(uuidgen)" + WINRT_UUID = $$system(uuidgen) + isEmpty(WINRT_UUID): error("Unable to generate a UUID. Make sure uuidgen is in your PATH.") + WINRT_UUID = "WINRT_MANIFEST.identity = $$WINRT_UUID" write_file($$UUID_CACHE, WINRT_UUID)|error("Unable to write the UUID cache; aborting.") eval($$WINRT_UUID) } diff --git a/mkspecs/macx-ios-clang/features/default_post.prf b/mkspecs/macx-ios-clang/features/default_post.prf index f9a8921a09..c9d3a5d85b 100644 --- a/mkspecs/macx-ios-clang/features/default_post.prf +++ b/mkspecs/macx-ios-clang/features/default_post.prf @@ -41,7 +41,6 @@ equals(TEMPLATE, app) { RESOURCES = INSTALLS = QMAKE_EXTRA_COMPILERS = - QMAKE_EXTRA_TARGETS = !build_pass { CONFIG += debug_and_release @@ -97,7 +96,24 @@ equals(TEMPLATE, app) { target = $${sdk}-$${cfg}$${action_target_suffix} - $${target}.commands = "@bash -o pipefail -c 'xcodebuild $$action -scheme $(TARGET) -sdk $$sdk -configuration $$title($$cfg) | grep -v setenv'" + xcodebuild = "xcodebuild $$action -scheme $(TARGET) -sdk $$sdk -configuration $$title($$cfg)" + + equals(action, test):equals(sdk, iphoneos) { + AVAILABLE_DEVICE_IDS = "$(shell system_profiler SPUSBDataType | sed -n -E -e '/(iPhone|iPad|iPod)/,/Serial/s/ *Serial Number: *(.+)/\1/p')" + CUSTOM_DEVICE_IDS = "$(filter $(EXPORT_AVAILABLE_DEVICE_IDS), $(IOS_TEST_DEVICE_IDS))" + TEST_DEVICE_IDS = "$(strip $(if $(EXPORT_CUSTOM_DEVICE_IDS), $(EXPORT_CUSTOM_DEVICE_IDS), $(EXPORT_AVAILABLE_DEVICE_IDS)))" + + QMAKE_EXTRA_VARIABLES += AVAILABLE_DEVICE_IDS CUSTOM_DEVICE_IDS TEST_DEVICE_IDS + + xcodebuild = "@$(if $(EXPORT_TEST_DEVICE_IDS),"\ + "echo Running tests on $(words $(EXPORT_TEST_DEVICE_IDS)) device\\(s\\): && ("\ + "$(foreach deviceid, $(EXPORT_TEST_DEVICE_IDS),"\ + "(echo Testing on device ID '$(deviceid)' ... && $${xcodebuild} -destination 'platform=iOS,id=$(deviceid)' && echo) &&"\ + ") echo Tests completed successfully on all devices"\ + "), $(error No iOS devices connected, please connect at least one device that can be used for testing.))" + } + + $${target}.commands = $$xcodebuild QMAKE_EXTRA_TARGETS += $$target $${action_target}.depends += $$target diff --git a/qmake/generators/mac/pbuilder_pbx.cpp b/qmake/generators/mac/pbuilder_pbx.cpp index e2b5f5f90b..ec18d1f9b3 100644 --- a/qmake/generators/mac/pbuilder_pbx.cpp +++ b/qmake/generators/mac/pbuilder_pbx.cpp @@ -558,6 +558,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) << "\t\t\t" << writeSettings("name", "Qt Qmake") << ";\n" << "\t\t\t" << writeSettings("shellPath", "/bin/sh") << ";\n" << "\t\t\t" << writeSettings("shellScript", "make -C " + IoUtils::shellQuoteUnix(qmake_getpwd()) + " -f " + IoUtils::shellQuoteUnix(mkfile)) << ";\n" + << "\t\t\t" << writeSettings("showEnvVarsInLog", "0") << ";\n" << "\t\t};\n"; } @@ -795,6 +796,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) << "\t\t\t" << writeSettings("name", "Qt Preprocessors") << ";\n" << "\t\t\t" << writeSettings("shellPath", "/bin/sh") << ";\n" << "\t\t\t" << writeSettings("shellScript", "make -C " + IoUtils::shellQuoteUnix(qmake_getpwd()) + " -f " + IoUtils::shellQuoteUnix(mkfile)) << ";\n" + << "\t\t\t" << writeSettings("showEnvVarsInLog", "0") << ";\n" << "\t\t};\n"; } @@ -1070,6 +1072,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) << "\t\t\t" << writeSettings("name", "Qt Postlink") << ";\n" << "\t\t\t" << writeSettings("shellPath", "/bin/sh") << ";\n" << "\t\t\t" << writeSettings("shellScript", project->values("QMAKE_POST_LINK")) << ";\n" + << "\t\t\t" << writeSettings("showEnvVarsInLog", "0") << ";\n" << "\t\t};\n"; } @@ -1088,6 +1091,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) << "\t\t\t" << writeSettings("runOnlyForDeploymentPostprocessing", "0", SettingsNoQuote) << ";\n" << "\t\t\t" << writeSettings("shellPath", "/bin/sh") << ";\n" << "\t\t\t" << writeSettings("shellScript", fixForOutput("cp -r $BUILT_PRODUCTS_DIR/$FULL_PRODUCT_NAME " + IoUtils::shellQuoteUnix(destDir))) << ";\n" + << "\t\t\t" << writeSettings("showEnvVarsInLog", "0") << ";\n" << "\t\t};\n"; } bool copyBundleResources = project->isActiveConfig("app_bundle") && project->first("TEMPLATE") == "app"; diff --git a/qmake/generators/win32/msvc_nmake.cpp b/qmake/generators/win32/msvc_nmake.cpp index c719aa4cbf..740c8c4d13 100644 --- a/qmake/generators/win32/msvc_nmake.cpp +++ b/qmake/generators/win32/msvc_nmake.cpp @@ -388,6 +388,7 @@ void NmakeMakefileGenerator::init() ProString version = project->first("TARGET_VERSION_EXT"); if(project->isActiveConfig("shared")) { project->values("QMAKE_CLEAN").append(project->first("DESTDIR") + project->first("TARGET") + version + ".exp"); + project->values("QMAKE_DISTCLEAN").append(project->first("DESTDIR") + project->first("TARGET") + version + ".lib"); } if (project->isActiveConfig("debug_info")) { QString pdbfile = project->first("DESTDIR") + project->first("TARGET") + version + ".pdb"; diff --git a/src/3rdparty/forkfd/forkfd.c b/src/3rdparty/forkfd/forkfd.c index 1b3e162a7e..a8205065c5 100644 --- a/src/3rdparty/forkfd/forkfd.c +++ b/src/3rdparty/forkfd/forkfd.c @@ -38,7 +38,7 @@ #ifndef _GNU_SOURCE # define _GNU_SOURCE # define _POSIX_C_SOURCE 200809L -# define _XOPEN_SOURCE 500 +# define _XOPEN_SOURCE 700 #endif #include "forkfd.h" @@ -436,6 +436,7 @@ static int create_pipe(int filedes[], int flags) return ret; } +#ifndef FORKFD_NO_FORKFD /** * @brief forkfd returns a file descriptor representing a child process * @return a file descriptor, or -1 in case of failure @@ -590,8 +591,9 @@ err_free: freeInfo(header, info); return -1; } +#endif // FORKFD_NO_FORKFD -#ifdef _POSIX_SPAWN +#if defined(_POSIX_SPAWN) && !defined(FORKFD_NO_SPAWNFD) int spawnfd(int flags, pid_t *ppid, const char *path, const posix_spawn_file_actions_t *file_actions, posix_spawnattr_t *attrp, char *const argv[], char *const envp[]) { @@ -652,4 +654,4 @@ err_free: out: return -1; } -#endif // _POSIX_SPAWN +#endif // _POSIX_SPAWN && !FORKFD_NO_SPAWNFD diff --git a/src/3rdparty/freebsd/0001-Patch-the-FreeBSD-strto-u-ll-functions-to-work-insid.patch b/src/3rdparty/freebsd/0001-Patch-the-FreeBSD-strto-u-ll-functions-to-work-insid.patch index ac7580d5c4..b21d483a9c 100644 --- a/src/3rdparty/freebsd/0001-Patch-the-FreeBSD-strto-u-ll-functions-to-work-insid.patch +++ b/src/3rdparty/freebsd/0001-Patch-the-FreeBSD-strto-u-ll-functions-to-work-insid.patch @@ -9,15 +9,15 @@ Changes: - rename from strtoxx_l to qt_strtoxx (merging the two functions) - remove __restrict - remove the locale_t parameter and use ascii_isspace instead of isspace_l + - fix compilation with -Wcast-qual (requires C++) -Change-Id: I1e522e12da90eb35eefcf4025102dc11b22c60a5 --- - src/3rdparty/freebsd/strtoll.c | 27 +++++---------------------- - src/3rdparty/freebsd/strtoull.c | 27 +++++---------------------- - 2 files changed, 10 insertions(+), 44 deletions(-) + src/3rdparty/freebsd/strtoll.c | 27 ++++----------------------- + src/3rdparty/freebsd/strtoull.c | 27 ++++----------------------- + 2 files changed, 8 insertions(+), 46 deletions(-) diff --git a/src/3rdparty/freebsd/strtoll.c b/src/3rdparty/freebsd/strtoll.c -index 16a8196..0ded267 100644 +index 16a8196..7b4505e 100644 --- a/src/3rdparty/freebsd/strtoll.c +++ b/src/3rdparty/freebsd/strtoll.c @@ -32,18 +32,6 @@ @@ -39,7 +39,7 @@ index 16a8196..0ded267 100644 /* * Convert a string to a long long integer. * -@@ -51,15 +39,15 @@ __FBSDID("$FreeBSD$"); +@@ -51,15 +39,13 @@ __FBSDID("$FreeBSD$"); * alphabets and digits are each contiguous. */ long long @@ -72,7 +72,8 @@ index 16a8196..0ded267 100644 - acc = -acc; + acc = (unsigned long long) -(long long)acc; if (endptr != NULL) - *endptr = (char *)(any ? s - 1 : nptr); +- *endptr = (char *)(any ? s - 1 : nptr); ++ *endptr = const_cast(any ? s - 1 : nptr); return (acc); } -long long @@ -81,7 +82,7 @@ index 16a8196..0ded267 100644 - return strtoll_l(nptr, endptr, base, __get_locale()); -} diff --git a/src/3rdparty/freebsd/strtoull.c b/src/3rdparty/freebsd/strtoull.c -index dc40e0e..cb04adb 100644 +index dc40e0e..1eb9257 100644 --- a/src/3rdparty/freebsd/strtoull.c +++ b/src/3rdparty/freebsd/strtoull.c @@ -32,18 +32,6 @@ @@ -103,7 +104,7 @@ index dc40e0e..cb04adb 100644 /* * Convert a string to an unsigned long long integer. * -@@ -51,15 +39,15 @@ __FBSDID("$FreeBSD$"); +@@ -51,15 +39,13 @@ __FBSDID("$FreeBSD$"); * alphabets and digits are each contiguous. */ unsigned long long @@ -136,7 +137,8 @@ index dc40e0e..cb04adb 100644 - acc = -acc; + acc = (unsigned long long) -(long long)acc; if (endptr != NULL) - *endptr = (char *)(any ? s - 1 : nptr); +- *endptr = (char *)(any ? s - 1 : nptr); ++ *endptr = const_cast(any ? s - 1 : nptr); return (acc); } -unsigned long long @@ -145,5 +147,5 @@ index dc40e0e..cb04adb 100644 - return strtoull_l(nptr, endptr, base, __get_locale()); -} -- -1.8.4.5 +2.1.4 diff --git a/src/3rdparty/freebsd/strtoll.c b/src/3rdparty/freebsd/strtoll.c index 6f06e03dc8..7b4505eddc 100644 --- a/src/3rdparty/freebsd/strtoll.c +++ b/src/3rdparty/freebsd/strtoll.c @@ -129,6 +129,6 @@ noconv: } else if (neg) acc = (unsigned long long) -(long long)acc; if (endptr != NULL) - *endptr = (char *)(any ? s - 1 : nptr); + *endptr = const_cast(any ? s - 1 : nptr); return (acc); } diff --git a/src/3rdparty/freebsd/strtoull.c b/src/3rdparty/freebsd/strtoull.c index 7cb97f02f4..1eb92578d4 100644 --- a/src/3rdparty/freebsd/strtoull.c +++ b/src/3rdparty/freebsd/strtoull.c @@ -107,6 +107,6 @@ noconv: } else if (neg) acc = (unsigned long long) -(long long)acc; if (endptr != NULL) - *endptr = (char *)(any ? s - 1 : nptr); + *endptr = const_cast(any ? s - 1 : nptr); return (acc); } diff --git a/src/3rdparty/freetype.pri b/src/3rdparty/freetype.pri new file mode 100644 index 0000000000..33981c6e3c --- /dev/null +++ b/src/3rdparty/freetype.pri @@ -0,0 +1,67 @@ +QT_FREETYPE_DIR = $$PWD/freetype + +SOURCES += \ + $$QT_FREETYPE_DIR/src/autofit/afangles.c \ + $$QT_FREETYPE_DIR/src/autofit/afdummy.c \ + $$QT_FREETYPE_DIR/src/autofit/afglobal.c \ + $$QT_FREETYPE_DIR/src/autofit/afhints.c \ + $$QT_FREETYPE_DIR/src/autofit/aflatin.c \ + $$QT_FREETYPE_DIR/src/autofit/afloader.c \ + $$QT_FREETYPE_DIR/src/autofit/afmodule.c \ + $$QT_FREETYPE_DIR/src/autofit/autofit.c \ + $$QT_FREETYPE_DIR/src/base/ftbase.c \ + $$QT_FREETYPE_DIR/src/base/ftbitmap.c \ + $$QT_FREETYPE_DIR/src/base/ftbbox.c \ + $$QT_FREETYPE_DIR/src/base/ftdebug.c \ + $$QT_FREETYPE_DIR/src/base/ftglyph.c \ + $$QT_FREETYPE_DIR/src/base/ftinit.c \ + $$QT_FREETYPE_DIR/src/base/ftlcdfil.c \ + $$QT_FREETYPE_DIR/src/base/ftmm.c \ + $$QT_FREETYPE_DIR/src/base/ftsynth.c \ + $$QT_FREETYPE_DIR/src/base/fttype1.c \ + $$QT_FREETYPE_DIR/src/bdf/bdf.c \ + $$QT_FREETYPE_DIR/src/cache/ftcache.c \ + $$QT_FREETYPE_DIR/src/cff/cff.c \ + $$QT_FREETYPE_DIR/src/cid/type1cid.c \ + $$QT_FREETYPE_DIR/src/gzip/ftgzip.c \ + $$QT_FREETYPE_DIR/src/lzw/ftlzw.c \ + $$QT_FREETYPE_DIR/src/otvalid/otvalid.c \ + $$QT_FREETYPE_DIR/src/otvalid/otvbase.c \ + $$QT_FREETYPE_DIR/src/otvalid/otvcommn.c \ + $$QT_FREETYPE_DIR/src/otvalid/otvgdef.c \ + $$QT_FREETYPE_DIR/src/otvalid/otvgpos.c \ + $$QT_FREETYPE_DIR/src/otvalid/otvgsub.c \ + $$QT_FREETYPE_DIR/src/otvalid/otvjstf.c \ + $$QT_FREETYPE_DIR/src/otvalid/otvmod.c \ + $$QT_FREETYPE_DIR/src/pcf/pcf.c \ + $$QT_FREETYPE_DIR/src/pfr/pfr.c \ + $$QT_FREETYPE_DIR/src/psaux/psaux.c \ + $$QT_FREETYPE_DIR/src/pshinter/pshinter.c \ + $$QT_FREETYPE_DIR/src/psnames/psmodule.c \ + $$QT_FREETYPE_DIR/src/raster/raster.c \ + $$QT_FREETYPE_DIR/src/sfnt/sfnt.c \ + $$QT_FREETYPE_DIR/src/smooth/smooth.c \ + $$QT_FREETYPE_DIR/src/truetype/truetype.c \ + $$QT_FREETYPE_DIR/src/type1/type1.c \ + $$QT_FREETYPE_DIR/src/type42/type42.c \ + $$QT_FREETYPE_DIR/src/winfonts/winfnt.c + +win32 { + SOURCES += $$QT_FREETYPE_DIR/src/base/ftsystem.c +} else { + SOURCES += $$QT_FREETYPE_DIR/builds/unix/ftsystem.c + INCLUDEPATH += $$QT_FREETYPE_DIR/builds/unix +} + +INCLUDEPATH += $$QT_FREETYPE_DIR/src $$QT_FREETYPE_DIR/include + +DEFINES += FT2_BUILD_LIBRARY +contains(QT_CONFIG, system-zlib) { + DEFINES += FT_CONFIG_OPTION_SYSTEM_ZLIB + include($$PWD/zlib_dependency.pri) +} + +# disable warnings about "unsafe" methods in C code +msvc:QMAKE_CFLAGS_WARN_ON += -wd"4996" + +TR_EXCLUDE += $$QT_FREETYPE_DIR/* diff --git a/src/3rdparty/harfbuzz-ng/NEWS b/src/3rdparty/harfbuzz-ng/NEWS index 3a33bdf5cb..dbbfbba195 100644 --- a/src/3rdparty/harfbuzz-ng/NEWS +++ b/src/3rdparty/harfbuzz-ng/NEWS @@ -1,3 +1,13 @@ +Overview of changes leading to 0.9.39 +Wednesday, March 4, 2015 +===================================== + +- Critical hb-coretext fixes. +- Optimizations and refactoring; no functional change + expected. +- Misc build fixes. + + Overview of changes leading to 0.9.38 Friday, January 23, 2015 ===================================== diff --git a/src/3rdparty/harfbuzz-ng/src/hb-buffer.cc b/src/3rdparty/harfbuzz-ng/src/hb-buffer.cc index 0500aa23ce..942177cbd0 100644 --- a/src/3rdparty/harfbuzz-ng/src/hb-buffer.cc +++ b/src/3rdparty/harfbuzz-ng/src/hb-buffer.cc @@ -454,7 +454,7 @@ hb_buffer_t::reverse_range (unsigned int start, info[j] = t; } - if (pos) { + if (have_positions) { for (i = start, j = end - 1; i < j; i++, j--) { hb_glyph_position_t t; diff --git a/src/3rdparty/harfbuzz-ng/src/hb-open-file-private.hh b/src/3rdparty/harfbuzz-ng/src/hb-open-file-private.hh index 7500c32f15..178bc7ccb8 100644 --- a/src/3rdparty/harfbuzz-ng/src/hb-open-file-private.hh +++ b/src/3rdparty/harfbuzz-ng/src/hb-open-file-private.hh @@ -53,7 +53,8 @@ struct TTCHeader; typedef struct TableRecord { - inline bool sanitize (hb_sanitize_context_t *c) { + inline bool sanitize (hb_sanitize_context_t *c) const + { TRACE_SANITIZE (this); return TRACE_RETURN (c->check_struct (this)); } @@ -102,7 +103,8 @@ typedef struct OffsetTable } public: - inline bool sanitize (hb_sanitize_context_t *c) { + inline bool sanitize (hb_sanitize_context_t *c) const + { TRACE_SANITIZE (this); return TRACE_RETURN (c->check_struct (this) && c->check_array (tables, TableRecord::static_size, numTables)); } @@ -130,7 +132,8 @@ struct TTCHeaderVersion1 inline unsigned int get_face_count (void) const { return table.len; } inline const OpenTypeFontFace& get_face (unsigned int i) const { return this+table[i]; } - inline bool sanitize (hb_sanitize_context_t *c) { + inline bool sanitize (hb_sanitize_context_t *c) const + { TRACE_SANITIZE (this); return TRACE_RETURN (table.sanitize (c, this)); } @@ -169,7 +172,8 @@ struct TTCHeader } } - inline bool sanitize (hb_sanitize_context_t *c) { + inline bool sanitize (hb_sanitize_context_t *c) const + { TRACE_SANITIZE (this); if (unlikely (!u.header.version.sanitize (c))) return TRACE_RETURN (false); switch (u.header.version.major) { @@ -233,7 +237,8 @@ struct OpenTypeFontFile } } - inline bool sanitize (hb_sanitize_context_t *c) { + inline bool sanitize (hb_sanitize_context_t *c) const + { TRACE_SANITIZE (this); if (unlikely (!u.tag.sanitize (c))) return TRACE_RETURN (false); switch (u.tag) { diff --git a/src/3rdparty/harfbuzz-ng/src/hb-open-type-private.hh b/src/3rdparty/harfbuzz-ng/src/hb-open-type-private.hh index 477d9e28b2..75a0f568d1 100644 --- a/src/3rdparty/harfbuzz-ng/src/hb-open-type-private.hh +++ b/src/3rdparty/harfbuzz-ng/src/hb-open-type-private.hh @@ -179,10 +179,13 @@ struct hb_sanitize_context_t inline const char *get_name (void) { return "SANITIZE"; } static const unsigned int max_debug_depth = HB_DEBUG_SANITIZE; typedef bool return_t; + template + inline bool may_dispatch (const T *obj, const F *format) + { return format->sanitize (this); } template inline return_t dispatch (const T &obj) { return obj.sanitize (this); } static return_t default_return_value (void) { return true; } - bool stop_sublookup_iteration (const return_t r HB_UNUSED) const { return false; } + bool stop_sublookup_iteration (const return_t r) const { return !r; } inline void init (hb_blob_t *b) { @@ -270,9 +273,9 @@ struct hb_sanitize_context_t } template - inline bool try_set (Type *obj, const ValueType &v) { + inline bool try_set (const Type *obj, const ValueType &v) { if (this->may_edit (obj, obj->static_size)) { - obj->set (v); + const_cast (obj)->set (v); return true; } return false; @@ -546,12 +549,6 @@ struct BEInt return (v[0] << 8) + (v[1] ); } - inline bool operator == (const BEInt& o) const - { - return v[0] == o.v[0] - && v[1] == o.v[1]; - } - inline bool operator != (const BEInt& o) const { return !(*this == o); } private: uint8_t v[2]; }; template @@ -570,13 +567,6 @@ struct BEInt + (v[1] << 8) + (v[2] ); } - inline bool operator == (const BEInt& o) const - { - return v[0] == o.v[0] - && v[1] == o.v[1] - && v[2] == o.v[2]; - } - inline bool operator != (const BEInt& o) const { return !(*this == o); } private: uint8_t v[3]; }; template @@ -597,14 +587,6 @@ struct BEInt + (v[2] << 8) + (v[3] ); } - inline bool operator == (const BEInt& o) const - { - return v[0] == o.v[0] - && v[1] == o.v[1] - && v[2] == o.v[2] - && v[3] == o.v[3]; - } - inline bool operator != (const BEInt& o) const { return !(*this == o); } private: uint8_t v[4]; }; @@ -614,12 +596,19 @@ struct IntType { inline void set (Type i) { v.set (i); } inline operator Type(void) const { return v; } - inline bool operator == (const IntType &o) const { return v == o.v; } - inline bool operator != (const IntType &o) const { return v != o.v; } + inline bool operator == (const IntType &o) const { return (Type) v == (Type) o.v; } + inline bool operator != (const IntType &o) const { return !(*this == o); } static inline int cmp (const IntType *a, const IntType *b) { return b->cmp (*a); } - inline int cmp (IntType va) const { Type a = va; Type b = v; return a < b ? -1 : a == b ? 0 : +1; } - inline int cmp (Type a) const { Type b = v; return a < b ? -1 : a == b ? 0 : +1; } - inline bool sanitize (hb_sanitize_context_t *c) { + inline int cmp (Type a) const + { + Type b = v; + if (sizeof (Type) < sizeof (int)) + return (int) a - (int) b; + else + return a < b ? -1 : a == b ? 0 : +1; + } + inline bool sanitize (hb_sanitize_context_t *c) const + { TRACE_SANITIZE (this); return TRACE_RETURN (likely (c->check_struct (this))); } @@ -646,7 +635,8 @@ typedef USHORT UFWORD; * 1904. The value is represented as a signed 64-bit integer. */ struct LONGDATETIME { - inline bool sanitize (hb_sanitize_context_t *c) { + inline bool sanitize (hb_sanitize_context_t *c) const + { TRACE_SANITIZE (this); return TRACE_RETURN (likely (c->check_struct (this))); } @@ -670,7 +660,10 @@ struct Tag : ULONG DEFINE_NULL_DATA (Tag, " "); /* Glyph index number, same as uint16 (length = 16 bits) */ -typedef USHORT GlyphID; +struct GlyphID : USHORT { + static inline int cmp (const GlyphID *a, const GlyphID *b) { return b->USHORT::cmp (*a); } + inline int cmp (hb_codepoint_t a) const { return (int) a - (int) *this; } +}; /* Script/language-system/feature index */ struct Index : USHORT { @@ -719,7 +712,8 @@ struct FixedVersion { inline uint32_t to_int (void) const { return (major << 16) + minor; } - inline bool sanitize (hb_sanitize_context_t *c) { + inline bool sanitize (hb_sanitize_context_t *c) const + { TRACE_SANITIZE (this); return TRACE_RETURN (c->check_struct (this)); } @@ -747,33 +741,35 @@ struct OffsetTo : Offset return StructAtOffset (base, offset); } - inline Type& serialize (hb_serialize_context_t *c, void *base) + inline Type& serialize (hb_serialize_context_t *c, const void *base) { Type *t = c->start_embed (); this->set ((char *) t - (char *) base); /* TODO(serialize) Overflow? */ return *t; } - inline bool sanitize (hb_sanitize_context_t *c, void *base) { + inline bool sanitize (hb_sanitize_context_t *c, const void *base) const + { TRACE_SANITIZE (this); if (unlikely (!c->check_struct (this))) return TRACE_RETURN (false); unsigned int offset = *this; if (unlikely (!offset)) return TRACE_RETURN (true); - Type &obj = StructAtOffset (base, offset); + const Type &obj = StructAtOffset (base, offset); return TRACE_RETURN (likely (obj.sanitize (c)) || neuter (c)); } template - inline bool sanitize (hb_sanitize_context_t *c, void *base, T user_data) { + inline bool sanitize (hb_sanitize_context_t *c, const void *base, T user_data) const + { TRACE_SANITIZE (this); if (unlikely (!c->check_struct (this))) return TRACE_RETURN (false); unsigned int offset = *this; if (unlikely (!offset)) return TRACE_RETURN (true); - Type &obj = StructAtOffset (base, offset); + const Type &obj = StructAtOffset (base, offset); return TRACE_RETURN (likely (obj.sanitize (c, user_data)) || neuter (c)); } /* Set the offset to Null */ - inline bool neuter (hb_sanitize_context_t *c) { + inline bool neuter (hb_sanitize_context_t *c) const { return c->try_set (this, 0); } DEFINE_SIZE_STATIC (sizeof(OffsetType)); @@ -838,7 +834,8 @@ struct ArrayOf return TRACE_RETURN (true); } - inline bool sanitize (hb_sanitize_context_t *c) { + inline bool sanitize (hb_sanitize_context_t *c) const + { TRACE_SANITIZE (this); if (unlikely (!sanitize_shallow (c))) return TRACE_RETURN (false); @@ -853,7 +850,8 @@ struct ArrayOf return TRACE_RETURN (true); } - inline bool sanitize (hb_sanitize_context_t *c, void *base) { + inline bool sanitize (hb_sanitize_context_t *c, const void *base) const + { TRACE_SANITIZE (this); if (unlikely (!sanitize_shallow (c))) return TRACE_RETURN (false); unsigned int count = len; @@ -863,7 +861,8 @@ struct ArrayOf return TRACE_RETURN (true); } template - inline bool sanitize (hb_sanitize_context_t *c, void *base, T user_data) { + inline bool sanitize (hb_sanitize_context_t *c, const void *base, T user_data) const + { TRACE_SANITIZE (this); if (unlikely (!sanitize_shallow (c))) return TRACE_RETURN (false); unsigned int count = len; @@ -884,7 +883,8 @@ struct ArrayOf } private: - inline bool sanitize_shallow (hb_sanitize_context_t *c) { + inline bool sanitize_shallow (hb_sanitize_context_t *c) const + { TRACE_SANITIZE (this); return TRACE_RETURN (c->check_struct (this) && c->check_array (this, Type::static_size, len)); } @@ -910,12 +910,14 @@ struct OffsetListOf : OffsetArrayOf return this+this->array[i]; } - inline bool sanitize (hb_sanitize_context_t *c) { + inline bool sanitize (hb_sanitize_context_t *c) const + { TRACE_SANITIZE (this); return TRACE_RETURN (OffsetArrayOf::sanitize (c, this)); } template - inline bool sanitize (hb_sanitize_context_t *c, T user_data) { + inline bool sanitize (hb_sanitize_context_t *c, T user_data) const + { TRACE_SANITIZE (this); return TRACE_RETURN (OffsetArrayOf::sanitize (c, this, user_data)); } @@ -949,12 +951,14 @@ struct HeadlessArrayOf return TRACE_RETURN (true); } - inline bool sanitize_shallow (hb_sanitize_context_t *c) { + inline bool sanitize_shallow (hb_sanitize_context_t *c) const + { return c->check_struct (this) && c->check_array (this, Type::static_size, len); } - inline bool sanitize (hb_sanitize_context_t *c) { + inline bool sanitize (hb_sanitize_context_t *c) const + { TRACE_SANITIZE (this); if (unlikely (!sanitize_shallow (c))) return TRACE_RETURN (false); diff --git a/src/3rdparty/harfbuzz-ng/src/hb-ot-cmap-table.hh b/src/3rdparty/harfbuzz-ng/src/hb-ot-cmap-table.hh index d53141157d..0482312553 100644 --- a/src/3rdparty/harfbuzz-ng/src/hb-ot-cmap-table.hh +++ b/src/3rdparty/harfbuzz-ng/src/hb-ot-cmap-table.hh @@ -51,7 +51,8 @@ struct CmapSubtableFormat0 return true; } - inline bool sanitize (hb_sanitize_context_t *c) { + inline bool sanitize (hb_sanitize_context_t *c) const + { TRACE_SANITIZE (this); return TRACE_RETURN (c->check_struct (this)); } @@ -125,7 +126,7 @@ struct CmapSubtableFormat4 return true; } - inline bool sanitize (hb_sanitize_context_t *c) + inline bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); if (unlikely (!c->check_struct (this))) @@ -183,7 +184,8 @@ struct CmapSubtableLongGroup return 0; } - inline bool sanitize (hb_sanitize_context_t *c) { + inline bool sanitize (hb_sanitize_context_t *c) const + { TRACE_SANITIZE (this); return TRACE_RETURN (c->check_struct (this)); } @@ -210,7 +212,8 @@ struct CmapSubtableTrimmed return true; } - inline bool sanitize (hb_sanitize_context_t *c) { + inline bool sanitize (hb_sanitize_context_t *c) const + { TRACE_SANITIZE (this); return TRACE_RETURN (c->check_struct (this) && glyphIdArray.sanitize (c)); } @@ -242,7 +245,8 @@ struct CmapSubtableLongSegmented return true; } - inline bool sanitize (hb_sanitize_context_t *c) { + inline bool sanitize (hb_sanitize_context_t *c) const + { TRACE_SANITIZE (this); return TRACE_RETURN (c->check_struct (this) && groups.sanitize (c)); } @@ -288,7 +292,8 @@ struct UnicodeValueRange return 0; } - inline bool sanitize (hb_sanitize_context_t *c) { + inline bool sanitize (hb_sanitize_context_t *c) const + { TRACE_SANITIZE (this); return TRACE_RETURN (c->check_struct (this)); } @@ -309,7 +314,8 @@ struct UVSMapping return unicodeValue.cmp (codepoint); } - inline bool sanitize (hb_sanitize_context_t *c) { + inline bool sanitize (hb_sanitize_context_t *c) const + { TRACE_SANITIZE (this); return TRACE_RETURN (c->check_struct (this)); } @@ -348,7 +354,8 @@ struct VariationSelectorRecord return varSelector.cmp (variation_selector); } - inline bool sanitize (hb_sanitize_context_t *c, void *base) { + inline bool sanitize (hb_sanitize_context_t *c, const void *base) const + { TRACE_SANITIZE (this); return TRACE_RETURN (c->check_struct (this) && defaultUVS.sanitize (c, base) && @@ -373,7 +380,8 @@ struct CmapSubtableFormat14 return record[record.bsearch(variation_selector)].get_glyph (codepoint, glyph, this); } - inline bool sanitize (hb_sanitize_context_t *c) { + inline bool sanitize (hb_sanitize_context_t *c) const + { TRACE_SANITIZE (this); return TRACE_RETURN (c->check_struct (this) && record.sanitize (c, this)); @@ -418,7 +426,8 @@ struct CmapSubtable } } - inline bool sanitize (hb_sanitize_context_t *c) { + inline bool sanitize (hb_sanitize_context_t *c) const + { TRACE_SANITIZE (this); if (!u.format.sanitize (c)) return TRACE_RETURN (false); switch (u.format) { @@ -461,7 +470,8 @@ struct EncodingRecord return 0; } - inline bool sanitize (hb_sanitize_context_t *c, void *base) { + inline bool sanitize (hb_sanitize_context_t *c, const void *base) const + { TRACE_SANITIZE (this); return TRACE_RETURN (c->check_struct (this) && subtable.sanitize (c, base)); @@ -496,7 +506,8 @@ struct cmap return &(this+encodingRecord[result].subtable); } - inline bool sanitize (hb_sanitize_context_t *c) { + inline bool sanitize (hb_sanitize_context_t *c) const + { TRACE_SANITIZE (this); return TRACE_RETURN (c->check_struct (this) && likely (version == 0) && diff --git a/src/3rdparty/harfbuzz-ng/src/hb-ot-head-table.hh b/src/3rdparty/harfbuzz-ng/src/hb-ot-head-table.hh index ec4e8c9d45..268f133408 100644 --- a/src/3rdparty/harfbuzz-ng/src/hb-ot-head-table.hh +++ b/src/3rdparty/harfbuzz-ng/src/hb-ot-head-table.hh @@ -45,13 +45,15 @@ struct head { static const hb_tag_t tableTag = HB_OT_TAG_head; - inline unsigned int get_upem (void) const { + inline unsigned int get_upem (void) const + { unsigned int upem = unitsPerEm; /* If no valid head table found, assume 1000, which matches typical Type1 usage. */ return 16 <= upem && upem <= 16384 ? upem : 1000; } - inline bool sanitize (hb_sanitize_context_t *c) { + inline bool sanitize (hb_sanitize_context_t *c) const + { TRACE_SANITIZE (this); return TRACE_RETURN (c->check_struct (this) && likely (version.major == 1)); } diff --git a/src/3rdparty/harfbuzz-ng/src/hb-ot-hhea-table.hh b/src/3rdparty/harfbuzz-ng/src/hb-ot-hhea-table.hh index edc0e29cbf..992fe55202 100644 --- a/src/3rdparty/harfbuzz-ng/src/hb-ot-hhea-table.hh +++ b/src/3rdparty/harfbuzz-ng/src/hb-ot-hhea-table.hh @@ -49,7 +49,8 @@ struct _hea static const hb_tag_t hheaTag = HB_OT_TAG_hhea; static const hb_tag_t vheaTag = HB_OT_TAG_vhea; - inline bool sanitize (hb_sanitize_context_t *c) { + inline bool sanitize (hb_sanitize_context_t *c) const + { TRACE_SANITIZE (this); return TRACE_RETURN (c->check_struct (this) && likely (version.major == 1)); } diff --git a/src/3rdparty/harfbuzz-ng/src/hb-ot-hmtx-table.hh b/src/3rdparty/harfbuzz-ng/src/hb-ot-hmtx-table.hh index 317854ce7f..a0e3855a84 100644 --- a/src/3rdparty/harfbuzz-ng/src/hb-ot-hmtx-table.hh +++ b/src/3rdparty/harfbuzz-ng/src/hb-ot-hmtx-table.hh @@ -57,7 +57,8 @@ struct _mtx static const hb_tag_t hmtxTag = HB_OT_TAG_hmtx; static const hb_tag_t vmtxTag = HB_OT_TAG_vmtx; - inline bool sanitize (hb_sanitize_context_t *c) { + inline bool sanitize (hb_sanitize_context_t *c) const + { TRACE_SANITIZE (this); /* We don't check for anything specific here. The users of the * struct do all the hard work... */ diff --git a/src/3rdparty/harfbuzz-ng/src/hb-ot-layout-common-private.hh b/src/3rdparty/harfbuzz-ng/src/hb-ot-layout-common-private.hh index abd063c896..3db7f57ab4 100644 --- a/src/3rdparty/harfbuzz-ng/src/hb-ot-layout-common-private.hh +++ b/src/3rdparty/harfbuzz-ng/src/hb-ot-layout-common-private.hh @@ -37,6 +37,12 @@ namespace OT { +#define TRACE_DISPATCH(this, format) \ + hb_auto_trace_t trace \ + (&c->debug_depth, c->get_name (), this, HB_FUNC, \ + "format %d", (int) format); + + #define NOT_COVERED ((unsigned int) -1) #define MAX_NESTING_LEVEL 8 #define MAX_CONTEXT_LENGTH 64 @@ -63,9 +69,10 @@ struct Record struct sanitize_closure_t { hb_tag_t tag; - void *list_base; + const void *list_base; }; - inline bool sanitize (hb_sanitize_context_t *c, void *base) { + inline bool sanitize (hb_sanitize_context_t *c, const void *base) const + { TRACE_SANITIZE (this); const sanitize_closure_t closure = {tag, base}; return TRACE_RETURN (c->check_struct (this) && offset.sanitize (c, base, &closure)); @@ -121,7 +128,8 @@ struct RecordListOf : RecordArrayOf inline const Type& operator [] (unsigned int i) const { return this+RecordArrayOf::operator [](i).offset; } - inline bool sanitize (hb_sanitize_context_t *c) { + inline bool sanitize (hb_sanitize_context_t *c) const + { TRACE_SANITIZE (this); return TRACE_RETURN (RecordArrayOf::sanitize (c, this)); } @@ -134,7 +142,8 @@ struct RangeRecord return g < start ? -1 : g <= end ? 0 : +1 ; } - inline bool sanitize (hb_sanitize_context_t *c) { + inline bool sanitize (hb_sanitize_context_t *c) const + { TRACE_SANITIZE (this); return TRACE_RETURN (c->check_struct (this)); } @@ -199,7 +208,8 @@ struct LangSys } inline bool sanitize (hb_sanitize_context_t *c, - const Record::sanitize_closure_t * = NULL) { + const Record::sanitize_closure_t * = NULL) const + { TRACE_SANITIZE (this); return TRACE_RETURN (c->check_struct (this) && featureIndex.sanitize (c)); } @@ -238,7 +248,8 @@ struct Script inline const LangSys& get_default_lang_sys (void) const { return this+defaultLangSys; } inline bool sanitize (hb_sanitize_context_t *c, - const Record