Instead of four pairs of :1 :15 bit fields, use an array of four :1,
:15 structs. This allows to replace the case folding traits classes
with a simple enum that indexes into said array.
I don't know what the WASM #ifdef'ed code is supposed to effect (a :0
bit-field is only useful to separate adjacent bit-field into separate
memory locations for multi-threading), but I thought it safer to leave
it in, and that means the array must be a 64-bit block of its own, so
I had to move two fields around.
Saves ~4.5KiB in text size on optimized GCC 10 LTO Linux AMD64 builds.
Change-Id: Ib52cd7706342d5227b50b57545d073829c45da9a
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
GCC doesn't like the sequence
: 5
: 5
: 8
: 6
: 8
and inserts a :6 padding between the :5 and the :8 and a :2 padding
between the :6 and the :8, growing the bitfield by 8 bits of embedded
padding and another byte to bring the struct back to sizeof % 2 == 0.
Fix by reshuffling the elements and adding a static_assert for the
next round.
Saves ~5KiB in QtCore executable size.
Change-Id: I4758a6f48ba389abc2aee92f60997d42ebb0e5b8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This has its own locale data, extracted from CLDR. This data may
potentially be shared with other variants on the Islamic calendar, so
is handled by a separate base-class, QHijriCalendar, on which such
variants may base their implementations.
[ChangeLog][QtCore][QCalendar] Added support for the Islamic Civil
calendar, controlled by feature islamiccivilcalendar, with locale data
that can be shared with other implementations, controlled by feature
hijricalendar.
Fixes: QTBUG-56675
Change-Id: Idf32d3da7034baa8ec5e66ef847e59a8a2f31cbd
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This has its own locale data, extracted from CLDR.
[ChangeLog][QtCore][QCalendar] Added support for the Jalali (Persian
or Solar Hijri) calendar, controlled by feature jalalicalendar.
Fixes: QTBUG-58404
Change-Id: Id5c56a10db05a4fd612aafc01615273db81ec743
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Add QCalendarBackend as a base class for calendar implementations and
QCalendar as a facade via which to access it.
QDate's implicit implementation of the Gregorian calendar becomes
QGregorianCalendar and QDate methods now support choice of calendar.
Convert QLocale's CLDR data for month names to a locale-data component
of each supported calendar and relevant QLocale methods now support
choice of calendar. Adapt Python scripts for locale data generation to
extract month name data from CLDR (keeping on version v35.1) into the
new calendar-locale files. The locale data for the Gregorian calendar
is held in a Roman calendar base, for sharing with other calendars.
Add tests for basic uses of the new API.
[ChangeLog][QtCore][QCalendar] Added QCalendar to support diverse
calendars, supported by implementing QCalendarBackend.
[ChangeLog][QtCore][QDate] Allow choice of calendar in various
operations, with Gregorian remaining the default.
Done-with: Lars Knoll <lars.knoll@qt.io>
Done-with: Edward Welbourne <edward.welbourne@qt.io>
Fixes: QTBUG-17110
Fixes: QTBUG-950
Change-Id: I9d6278f394269a183aee8156e990cec4d5198ab8
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The template for the "This is a generated file" notice made a clumsy
intrusion in the code in which it appeared, so split it out as a
constant of the module and access it by name where it's used.
Change-Id: Ic4dfb8e873078c54410b191654d6c21d082c9016
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
We've not run util/locale_database/cldr2qtimezone.py for a while, so
CLDR has had time to add several more zones. Catch up, inserting the
new entries in order.
Change-Id: I8625548b0f7775958230eccbd89b897d7afed9e9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
It wasn't mentioned in cldr2qlocalexml.py's instructions, so I didn't
know to run it. The data it used in an illustration was out of date.
Two tests could be combined with no loss.
Change-Id: I26e619e6210ea5b1258326fc4bc2b6aee9d6a999
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
When scanning the CLDR data, the script raised an exception if it
didn't recognize a zone ID. Instead, collect up such unrecognized IDs
in a list and report them all at the end, so that whoever runs this
can do them all in one go, rather than doing one, running the script,
doing the next, running the script, ad nauseam.
Change-Id: Ia659f1d1c7e1c1b4ccb87cc23828a0588a5bf958
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Use tuples for the fixed data. The numbering of rows in the data
tables isn't part of any public API, so we can change it freely; it is
thus unnecessary, as we can just enumerate a tuple of the data values
to generate sequential indices on the fly. (Updates to the data shall
no longer need to renumber in order to insert entries.)
Restore ordering of the data tables, and remove wanton spacing from
inside parens, in the process.
Change-Id: I59956cfb6191fe729300b57070671b7e66bd0379
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
It's a 38k source file, which makes it MUCH smaller than other generated
files like qlocale_data_p.h (982k) and qunicodetables.cpp (718k). The
constants are platform-independent, since they are defined by IEEE 754,
so they will never change.
The generator tool is moved to util/ and removed from the build. That's
one fewer bootstrapped tool to have to worry about.
The output file is committed as .cpp so it won't get installed.
Fixes: QTBUG-76165
Change-Id: I2b1955a995ad40f3b89afffd15a3ded58dc3e35f
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
We'll be adding calendar code here as well, and tools/ was getting
rather crowded, so it looks like time to move out a reasonably
coherent sub-bundle of it all.
Change-Id: I7e8030f38c31aa307f519dd918a43fc44baa6aa1
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
When parsing the CLDR data, we only handle language, script and
territory (which we call country) codes if they are known to our
enumdata.py tables. When reporting the rest as unknown, in the
content of an actual locale definition (not the likely subtag data),
check whether en.xml can resolve the code for us; if it can, report
the full name it provides, as a hint to whoever's running the script
that an update to enumdata.py may be in order.
Change-Id: I9ca1d6922a91d45bc436f4b622e5557261897d7f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
It was misnamed local_database, quite missing the point of its name.
Change-Id: I73a4fdf24f53daac12304de1f443636d89afacb2
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
A comma appeared on a line on its own; a closing-brace didn't.
Change-Id: I33cf37bb3574cd421c8af5ab6312865b71ce61f1
Reviewed-by: Peter Hartmann <peter-qt@hartmann.tk>
Conflicts:
src/corelib/tools/qlocale_data_p.h
(Regenerated by running the scripts in util/local_database/)
src/gui/opengl/qopengltextureuploader.cpp
Done-With: Edward Welbourne <edward.welbourne@qt.io>
Done-With: Allan Sandfeld Jensen <allan.jensen@qt.io>
Change-Id: I12df7f066ed0a25eb109f61c4b8d8dea63b683e2
It was up to date with v34 (and seems to cope with v35.1) but only
clained support for v29.
Change-Id: I686cae1977824a4deec4633f19604b91061fe78a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Our conversion from CLDR's format to our own was missing some things
it could support sensibly, and some it could do better than ignore or
treat as literal, while mis-handling the 'E'-based formats for day
names. At least in CLDR v34 this doesn't actually make any difference
(on regenerating our locale data, the only change is the date of
generation).
Task-number: QTBUG-70516
Change-Id: I9d27b9bf24afd168c2f8a5258143d3d695bca0ad
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
The grep given in the help from the program to process the
effective-TLD list only worked for voodoo reasons.
Replaced it with an actually-correct use of grep.
The commands given used the name effective_tld_names.dat in the URL
fetched; however, the relevant file has (for some time now) said
explicitly "Please pull this list from, and only from
https://publicsuffix.org/list/public_suffix_list.dat"
Changed the name used to match that URL.
Revised the output file's suggested name and the instructions for what
to do with its contents, making clear they *replace* what was there
before ...
Fixed some typos and related ugliness.
Change-Id: Iacd186c0003227d657099716262eb3a89c9e5f1b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The first replacement had missed objective-C++ code some places ourside
the src dir.
In C-files Q_DECL_NOTHROW is replaced with Q_DECL_NOEXCEPT as we still
need to turn it off when compiled in C mode, but can get rid of the old
NOTHROW moniker.
Change-Id: I6370f57066679c5120d0265a69e7e378e09d4759
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This scans the public suffix list and emits suitable content for the
header. Made some modest efficiency gains while hopefully making the
code easier to understand. Check for success when opening files.
Change-Id: If6b25c5c85f86209b33d9188743e820690e7dc05
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
The current state produces uncompilable code.
Change-Id: I9a68b61866a4a416335ed4d7204c58122803fb1c
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
This work around was added directly to the generated files
at some point, and never to the generator it seems. So to avoid
removing the workaround again when we regenerate the next time,
we need to add it.
Task-number: QTBUG-74511
Change-Id: Ided1bd949234ba82df61c55891646823e7f72e80
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
MSVC 2015 has a size limit on strings; sizeof (including the
terminating '\0') must not exceed 0xffff. The generator for the
suffix-list data worked round this by breaking its data into chunks of
at most 0xffff bytes; however, it was limiting on the strlen, not the
sizeof, so was off by one. It checked for this before adding each
suffix, so has (until now) always happened to break early enough; but
the latest update gave an exactly 0xffff chunk, whose terminating '\0'
took it over MSVC's limit. So adjust the cutoff to effectively
include the terminating '\0'.
Task-number: QTBUG-72623
Change-Id: I76ea40060d9fc13c0f7002c5ba22e71b8d0af787
Reviewed-by: Peter Hartmann <peter-qt@hartmann.tk>
[ChangeLog][qmake] A new feature "cmdline" was added that implies
"CONFIG += console" and "CONFIG -= app_bundle".
Task-number: QTBUG-27079
Change-Id: I6e52b07c9341c904bb1424fc717057432f9360e1
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Document how to do an update, fix the bit-rot that had crept into
main.cpp since last it was compiled, correct the qt_attribution.json
to use the actual version number of UCD (its Revision number) instead
of the (admittedly correlated) Unicode release number. Updated to
Release 22 (which came with Unicode 11.0.0) in the process; but this
doesn't change our actual qunicodetables.cpp (so is incidental).
Task-number: QTBUG-71281
Change-Id: Ieb7a6e1a4d49f639993f76ff82c8f12a572db3c3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
In the process, update the README's e-mail address for Simon and
mention all recognized command-line options in the usage message. The
generated CSS scanner was also out of sync with our source, so update
it. Also fixed handling of FileHeader to cope with running from a
shadow build by handling paths relative to __FILE__; and revised the
CSS3 config to use the same copyright header as was already in use by
the existing generated file.
Change-Id: I918ff84dbdc95d0478fd6aa4ea74e9a221d1a476
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
This amends c1141ed729b84f2c413975d37c1a91fb235fb14a; I failed to
update the doc-string after some design changes part-way through
developing the function.
Change-Id: Ifb83107153d1c3b5a9dbd0536a3d6ee1fe32922d
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
This is the squashed diff from wip/webassembly to dev.
Done-with: Peng Wu <peng.wu@intopalo.com>
Done-with: Sami Enne <sami.enne@intopalo.com>
Done-with: Morten Johan Sørvig <morten.sorvig@qt.io>
Started-by: Andrew Knight <andrew.knight@intopalo.com>
Change-Id: I6562433c0a38d6ec49ab675e0f104f2665f3392d
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
A few patterns accounted for a substantial majority of the output, so
report these in summarised (and somewhat tidly formatted) form.
Change-Id: I57f8e41d5e68774fe57b01bb295534aa84a2df15
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
We were missing a few languages CLDR knew about; so add them to the
list in enumdata.py (and add trailing commas to lists to make future
additions not need to change the prior last line; python is perfectly
happy with this).
[ChangeLog][QtCore][QLocale] Added support for Western Balochi, Ido,
Lojban, Sicilian and Souther Kurdish.
Change-Id: I0d24cff46a0ae8db48ec1db8762088f877319982
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
We iterate theoretically many sources (albeit there's only really ever
one) for this data, so accumulate instead of only keeping the last
(and initialize it as the list it always ended up being, not a
dictionary, so that this can work).
The form of each token is a locale name, so it may be lang_Script just
as readily as lang_LAND; so parse (and validate) the tags more
faithfully to catch both cases. Abstract that parsing into a function
and use it in both places that need it.
Change-Id: Ibdbc4eafefab6a5ef70646d9fea150f2cb408d05
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
PEP 8 wisely advises against the use of naked except: (unless
re-raising the error).
Change-Id: Ia0dfdb48b330d33ad370bdb9f6b205046aa919da
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
Neglected in 44b6757fe5
Noted the need for this in a relevant script's instructions.
Change-Id: If69666f1799acebd434034c80b91056cb8777488
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Replace lines of formatted output with dictionaries from which that
output can be generated efficiently (in sorted order). Tidy up the
python code, in the process.
Change-Id: Ifb74eb69342646c5dbabc3247b3a8ddef602e934
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The scripts that generate the C++ enum names clean out spaces, so
there's no need for enumdata.py to use the squished names; instead,
include spaces where they belong and use them in the relevant names
where they show up.
Change-Id: I7261c87d69e654bc2e89f44d7ebbc06bfb403c58
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>