qt5base-lts/qmake/generators/win32
Marc Mutz 7d4bf142d7 QUuid: add fromString(QStringView/QLatin1String)
As for the formatting code, de-duplicate the parsing code by only
parsing char*s, converting QChars to Latin-1 first in a small buffer.

The QUuid(const char*) ctor performed no length checking, relying
instead on the checks performed within _q_uuidFromHex(), which
includes an implicit check for premature end (because NUL is not
a valid token for the parser).

The (QString) and (QByteArray) ctors did perform length checking.
To the extent possible, this is removed, since it is handled by
_q_uuidFromHex(). Failure cases need not be optimized. Only the
QLatin1String overload needs to do some checking, because views in
general are not NUL-terminated. The QStringView overload can just
append a NUL when it converts to Latin-1.

The only check I added to _q_uuidFromHex() is that for src ==
nullptr. It would otherwise be duplicated in several callers.

While touching the internal functions, port to passing and returning
by value.

Saves 1.6KiB in text size on optimized GCC 6.1 Linux AMD64 builds,
even though we added new API.

Port some users to the new functions. Expand fromString() test.

[ChangeLog][QtCore][QUuid] Added fromString(QStringView/QLatin1String).

Change-Id: I519339419129550c86e0ea80514865cd6a768f5d
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-04-20 17:02:44 +00:00
..
mingw_make.cpp unbreak "aux" template for mingw & msvc, take 3 2016-12-07 06:54:04 +00:00
mingw_make.h Merge remote-tracking branch 'origin/5.6' into dev 2016-01-26 16:27:28 +01:00
msbuild_objectmodel.cpp Merge remote-tracking branch 'origin/5.8' into dev 2017-01-25 20:06:06 +01:00
msbuild_objectmodel.h Merge remote-tracking branch 'origin/5.8' into dev 2017-01-25 20:06:06 +01:00
msvc_nmake.cpp Fix MSVC Makefiles when SOURCES is empty 2017-03-07 13:54:57 +00:00
msvc_nmake.h qmake/nmake: Prevent overlong lines in link and lib response files 2017-02-13 14:48:15 +00:00
msvc_objectmodel.cpp Fix uninitialized VCLinkerTool::DebugInfoOption 2017-03-22 16:15:15 +00:00
msvc_objectmodel.h Remove support for WinRT 8.1 and Windows Phone 8.1 2017-01-18 12:38:56 +00:00
msvc_vcproj.cpp QUuid: add fromString(QStringView/QLatin1String) 2017-04-20 17:02:44 +00:00
msvc_vcproj.h Fix unnecessary regeneration of mocables in VS projects 2016-12-21 16:35:22 +00:00
msvc_vcxproj.cpp Updated license headers 2016-01-21 18:55:18 +00:00
msvc_vcxproj.h Updated license headers 2016-01-21 18:55:18 +00:00
registry_p.h move "shared" registry reading code into qmake 2016-12-23 13:45:50 +00:00
registry.cpp move "shared" registry reading code into qmake 2016-12-23 13:45:50 +00:00
winmakefile.cpp Preserve last modification timestamps of installed program files 2017-04-13 11:33:21 +00:00
winmakefile.h Updated license headers 2016-01-21 18:55:18 +00:00