From 8e387e7fa758ded3f0d096dcf5fe13a22521dad7 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 16 Nov 2017 10:58:54 -0800 Subject: qsimd.cpp: Remove workaround for GCC 4.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit That's long fallen out of support in Qt. Change-Id: I938b024e38bf4aac9154fffd14f7a603baa24e04 Reviewed-by: Tor Arne Vestbø --- src/corelib/tools/qsimd.cpp | 26 -------------------------- 1 file changed, 26 deletions(-) (limited to 'src/corelib/tools') diff --git a/src/corelib/tools/qsimd.cpp b/src/corelib/tools/qsimd.cpp index 4c6f08c774..25340f2d02 100644 --- a/src/corelib/tools/qsimd.cpp +++ b/src/corelib/tools/qsimd.cpp @@ -652,32 +652,6 @@ Q_CORE_EXPORT QBasicAtomicInteger qt_cpu_features[2] = { Q_BASIC_ATOMI void qDetectCpuFeatures() { -#if defined(Q_CC_GNU) && !defined(Q_CC_CLANG) && !defined(Q_CC_INTEL) -# if Q_CC_GNU < 403 - // GCC 4.2 (at least the one that comes with Apple's XCode, on Mac) is - // known to be broken beyond repair in dealing with the inline assembly - // above. It will generate bad code that could corrupt important registers - // like the PIC register. The behaviour of code after this function would - // be totally unpredictable. - // - // For that reason, simply forego the CPUID check at all and return the set - // of features that we found at compile time, through the #defines from the - // compiler. This should at least allow code to execute, even if none of - // the specialized code found in Qt GUI and elsewhere will ever be enabled - // (it's the user's fault for using a broken compiler). - // - // This also disables the runtime checking that the processor actually - // contains all the features that the code required. Qt 4 ran for years - // like that, so it shouldn't be a problem. - - qt_cpu_features[0].store(minFeature | quint32(QSimdInitialized)); -#ifndef Q_ATOMIC_INT64_IS_SUPPORTED - qt_cpu_features[1].store(minFeature >> 32); -#endif - - return; -# endif -#endif quint64 f = detectProcessorFeatures(); QByteArray disable = qgetenv("QT_NO_CPU_FEATURE"); if (!disable.isEmpty()) { -- cgit v1.2.3 From 110e49c9cecca34dfacad33d19e04612cc2671b2 Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Sat, 28 Oct 2017 23:01:58 -0700 Subject: QTimeZonePrivate: prefer /etc/localtime over /etc/timezone On modern distros (e.g. those using systemd), /etc/localtime is always a symlink. As that file is actually used by libraries (see tzset(3)), prefer it over /etc/timezone (which is no longer needed since https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=803144). This fixes a wrongly reported local timezone when a stale /etc/timezone file exists. While at it, improve sanity check for localtime symlink. Change-Id: I8557a58acf21afaeca0d585066304c79a92b5ddb Reviewed-by: Edward Welbourne --- src/corelib/tools/qtimezoneprivate_tz.cpp | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'src/corelib/tools') diff --git a/src/corelib/tools/qtimezoneprivate_tz.cpp b/src/corelib/tools/qtimezoneprivate_tz.cpp index bcc1285472..6a5df6272a 100644 --- a/src/corelib/tools/qtimezoneprivate_tz.cpp +++ b/src/corelib/tools/qtimezoneprivate_tz.cpp @@ -1050,7 +1050,18 @@ QByteArray QTzTimeZonePrivate::systemTimeZoneId() const if (ianaId == "/etc/localtime") ianaId.clear(); - // On Debian Etch and later /etc/localtime is real file with name held in /etc/timezone + // On most distros /etc/localtime is a symlink to a real file so extract name from the path + if (ianaId.isEmpty()) { + const QString path = QFile::symLinkTarget(QStringLiteral("/etc/localtime")); + if (!path.isEmpty()) { + // /etc/localtime is a symlink to the current TZ file, so extract from path + int index = path.indexOf(QLatin1String("/zoneinfo/")); + if (index != -1) + ianaId = path.mid(index + 10).toUtf8(); + } + } + + // On Debian Etch up to Jessie, /etc/localtime is a regular file while the actual name is in /etc/timezone if (ianaId.isEmpty()) { QFile tzif(QStringLiteral("/etc/timezone")); if (tzif.open(QIODevice::ReadOnly)) { @@ -1061,16 +1072,6 @@ QByteArray QTzTimeZonePrivate::systemTimeZoneId() const } } - // On other distros /etc/localtime is symlink to real file so can extract name from the path - if (ianaId.isEmpty()) { - const QString path = QFile::symLinkTarget(QStringLiteral("/etc/localtime")); - if (!path.isEmpty()) { - // /etc/localtime is a symlink to the current TZ file, so extract from path - int index = path.indexOf(QLatin1String("/zoneinfo/")) + 10; - ianaId = path.mid(index).toUtf8(); - } - } - // On some Red Hat distros /etc/localtime is real file with name held in /etc/sysconfig/clock // in a line like ZONE="Europe/Oslo" or TIMEZONE="Europe/Oslo" if (ianaId.isEmpty()) { -- cgit v1.2.3 From b19036ad56896496cad4d679d44032c031c4010b Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Mon, 28 Aug 2017 17:06:04 +0200 Subject: improve QLocale::formattedDataSize docs slightly Change-Id: I42aaec6d54299d906bf8e2ef1fd696f121b7c2d0 Reviewed-by: Edward Welbourne Reviewed-by: Shawn Rutledge --- src/corelib/tools/qlocale.cpp | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'src/corelib/tools') diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp index 723e63114d..07bc1f8275 100644 --- a/src/corelib/tools/qlocale.cpp +++ b/src/corelib/tools/qlocale.cpp @@ -3805,17 +3805,18 @@ QString QLocale::toCurrencyString(double value, const QString &symbol, int preci /*! \since 5.10 - Converts a size in bytes to a human-readable localized string, expressed in - a unit for which the numeric portion is at least 1 but as low as - possible. For example if \a bytes is 16384, \a precision is 2, and \a format - is \c DataSizeIecFormat (the default), this function returns "16.00 KiB"; - for 1330409069609 bytes it returns "1.21 GiB"; and so on. If \a format is \c - DataSizeIecFormat or \c DataSizeTraditionalFormat, the given number of bytes - is divided by a power of 1024, with result less than 1024; for \c - DataSizeSIFormat, it is divided by a power of 1000, with result less than - 1000. DataSizeIecFormat uses the new IEC standard quantifiers Ki, Mi and so - on, whereas DataSizeSIFormat uses and DataSizeTraditionalFormat abuses the - older SI quantifiers k, M, etc. + Converts a size in bytes to a human-readable localized string, comprising a + number and a quantified unit. The quantifier is chosen such that the number + is at least one, and as small as possible. For example if \a bytes is + 16384, \a precision is 2, and \a format is \l DataSizeIecFormat (the + default), this function returns "16.00 KiB"; for 1330409069609 bytes it + returns "1.21 GiB"; and so on. If \a format is \l DataSizeIecFormat or + \l DataSizeTraditionalFormat, the given number of bytes is divided by a + power of 1024, with result less than 1024; for \l DataSizeSIFormat, it is + divided by a power of 1000, with result less than 1000. + \c DataSizeIecFormat uses the new IEC standard quantifiers Ki, Mi and so on, + whereas \c DataSizeSIFormat uses the older SI quantifiers k, M, etc., and + \c DataSizeTraditionalFormat abuses them. */ QString QLocale::formattedDataSize(qint64 bytes, int precision, DataSizeFormats format) { -- cgit v1.2.3