Commit Graph

204 Commits

Author SHA1 Message Date
Moritz Bunkus
b0986ba9ff
BCP 47: use emplace_back for initialization of ISO 15924 script list
It's much faster than using the initializer lists. See previous commits
for more details.
2021-01-26 14:53:31 +01:00
Moritz Bunkus
5d04e5bfd5
BCP 47: use emplace_back for initialization of ISO 3166 region list
It's much faster than using the initializer lists. See previous commits
for more details.
2021-01-26 14:53:31 +01:00
Moritz Bunkus
11584c416a
BCP 47: use emplace_back for initialization of IANA language subtag registries
It's much faster than using the initializer lists. See previous commit
for more details.
2021-01-26 14:53:31 +01:00
Moritz Bunkus
5276839f16
BCP 47: use emplace_back for initialization of ISO 639 language list
It's much faster than using the initializer lists. Here's the result
from a micro benchmark I ran:

2021-01-25T23:49:20+01:00
Running ./bench.g++
Run on (8 X 4500 MHz CPU s)
CPU Caches:
  L1 Data 32 KiB (x4)
  L1 Instruction 32 KiB (x4)
  L2 Unified 256 KiB (x4)
  L3 Unified 8192 KiB (x1)
Load Average: 1.08, 0.72, 0.60
-------------------------------------------------------------
Benchmark                   Time             CPU   Iterations
-------------------------------------------------------------
BM_InitializerList      59667 ns        59625 ns        70526
BM_EmplaceBack          24515 ns        24497 ns       176817
BM_EmplaceBack2         16970 ns        16961 ns       247652
BM_PushBack             52831 ns        52796 ns        79202
BM_PushBack2            52858 ns        52823 ns        79004

The five benchmarks were:

• BM_InitializerList — the old way with initializer lists. Basically
  the same code currently being replaced.

• BM_EmplaceBack — Reserving space & adding each entry with
  g_languages.emplace_back(). A constructor was added to language_t
  struct taking the std::strings as const references (std::string
  const &), assigning them to the member variables normally.

• BM_EmplaceBack2 — Reserving space & adding each entry with
  g_languages.emplace_back(). A constructor was added to language_t
  struct taking the std::strings as rvalue references (std::string &&)
  assigning them to the member variables using std::move().

• BM_PushBack — Reserving space & adding each entry with
  g_languages.push_back(). A constructor was added to language_t
  struct taking the std::strings as const references (std::string
  const &), assigning them to the member variables normally.

• BM_PushBack2 — Reserving space & adding each entry with
  g_languages.push_back(). A constructor was added to language_t
  struct taking the std::strings as rvalue references (std::string &&)
  assigning them to the member variables using std::move().
2021-01-26 14:53:30 +01:00
Moritz Bunkus
68a38909d4
BCP 47: ISO 639 code list: include bool to say if part of ISO 639-2
Part of #3007.
2021-01-26 14:53:30 +01:00
Moritz Bunkus
ed309582ce
BCP 47: various lists: cosmetics (remove superfluous space at end of row) 2021-01-26 14:53:30 +01:00
Moritz Bunkus
b8549432ef
build system: use compiler-style warning output when updating QRC
Allows editors to pick up on them & "go to next warning/error" type
key bindings to work
2020-12-12 13:05:12 +01:00
Ofir Petrushka
962088f59c style: rubocop Style/Encoding
Fix Style/Encoding by rubocop

Signed-off-by: Cody Coder <cody.coder@gitcodebuddy.com>
2020-10-07 11:58:06 +11:00
Moritz Bunkus
82b4c7eaf9
Rakefile: remove debug output 2020-09-07 17:53:37 +02:00
Moritz Bunkus
2156af77fa
Rakefile: add dev target for updating all lists 2020-09-07 17:49:33 +02:00
Moritz Bunkus
1decaad545
BCP 47 language_c: support for UN M.49 region codes without ISO 3166 alpha codes
Part of the implementation of #2919.
2020-09-07 17:49:32 +02:00
Moritz Bunkus
4fd4d56374
ISO 3166: rename from countries to regions
Preparation for adding UN M.49 regions that don't have an ISO 3166-1
country code.

Part of the implementation of #2919.
2020-09-07 17:49:32 +02:00
Moritz Bunkus
19e61a2d2e
IANA language subtag registry: make registry download & parsing reusable
Part of the implementation of #2919.
2020-09-07 17:49:32 +02:00
Moritz Bunkus
941e47d97c
build system: look for & require the PCRE2 library 2020-08-20 13:29:29 +02:00
Moritz Bunkus
d5dbdb0a7e
replace outdated link to GPLv2 with current one 2020-08-01 18:03:54 +02:00
Moritz Bunkus
dff305d136
IANA Language Subtag Registry: add extended language subtags
Part of the implementation of #2419.
2020-07-05 11:35:31 +02:00
Moritz Bunkus
bf89f72189
ISO 639 code: move to namespace mtx::iso639
Part of the implementation of #2419.
2020-07-05 11:35:20 +02:00
Moritz Bunkus
908329f1ca
Rakefile: use range with explicit upper end for older Ruby versions 2020-07-02 19:34:46 +02:00
Moritz Bunkus
ef1a803687
Rakefile: add target for generating IANA language subtag registry 2020-07-02 19:09:47 +02:00
Moritz Bunkus
c8742e80d3
Rakefile: add target for generating list of ISO 3166 countries 2020-07-02 19:09:47 +02:00
Moritz Bunkus
d5239fabb9
Rakefile: add target for generating list of ISO 15924 scripts 2020-07-02 19:09:47 +02:00
Moritz Bunkus
572bf8d552
Rakefile: fix name/description of target generating ISO 639 language list 2020-07-02 19:09:47 +02:00
Moritz Bunkus
d34d87804c
build system: fix dependencies of QRC files wrt. icons 2020-06-21 20:23:11 +02:00
Moritz Bunkus
3e4f59d3ab
build system: add dev target for updating ISO 639 language list 2020-06-02 19:33:10 +02:00
Moritz Bunkus
a8139750c5
build system: look for and use libdvdread if found
This library is required for reading chapters from DVDs.

Part of the implementation of #2808.
2020-05-03 11:53:20 +02:00
Moritz Bunkus
080dfeda57
source: use std::regex instead of boost::regex 2019-12-31 15:53:03 +01:00
Moritz Bunkus
e9d65b182b
build system: add dependencies for Qt resource files 2019-11-08 11:12:53 +01:00
Moritz Bunkus
64d2f5e112
GUI: Windows: add dark mode with help of QDarkStyleSheet project
The dark mode is only turned on if Windows 10's own dark mode is
enabled. This manual dark mode configuration is necessary as Qt itself
doesn't support Windows' dark mode yet; see the following bug:

https://bugreports.qt.io/browse/QTBUG-72028

This isn't a problem for other operating systems (Linux, macOS…) as Qt
uses the system colors there and will use dark colors when the
system's colors are set to dark colors, too.
2019-10-12 23:32:03 +02:00
Moritz Bunkus
95f7d12f48
Revert "build system: verify configured host type is same as current host type"
This reverts commit af744cea80.
2019-09-27 18:02:13 +02:00
Moritz Bunkus
9c50085e3f
all: macOS: normalize file & path names to NFD
Fixes #2620.
2019-09-27 17:27:16 +02:00
Moritz Bunkus
af744cea80
build system: verify configured host type is same as current host type 2019-09-27 17:01:22 +02:00
Moritz Bunkus
6a8246e7eb
build system: include git commit number since last release in version for dev builds 2019-09-11 20:27:47 +02:00
Moritz Bunkus
61b8dfd203
build system: create ebml_export.h if using internal libEBML 2019-05-25 12:24:38 +02:00
Moritz Bunkus
3cbd95b003
build system: move compiler flag determination to Rakefile
Logic's more straight forward to implement there instead of having to
check in `configure`, adding a variable to `build-local.in` and using
that variable later on. The logic's the same in both places anyway.
2019-02-23 21:11:19 +01:00
Moritz Bunkus
0830be34db
build sys: include globally-required modules from single place 2019-02-05 13:45:34 +01:00
Moritz Bunkus
2d7d27f504
build system: fix building with non-UTF-8 locales
Fixes #2474.
2019-01-05 15:10:14 +01:00
Moritz Bunkus
d6707da459
build system: protect digest calls from re-entry
The code for Ruby's Digest module seems to be racy
wrt. multi-threading. See e.g.
https://github.com/aws/aws-sdk-ruby/issues/525 for details.
2018-12-04 21:13:17 +01:00
Moritz Bunkus
cc7b32a6f4
build system: implement fmt::format & Qt verification in translation files 2018-12-04 17:18:50 +01:00
Moritz Bunkus
6e7f04a142
fmt conversion: integrate bundled fmt into build system 2018-11-20 21:30:27 +01:00
Moritz Bunkus
d1cd5f2ffe
build system: handle OS-specific source file names everywhere
…and not just in the src/mkvtoolnix-gui sub-directory.
2018-11-04 18:58:06 +01:00
Moritz Bunkus
c6ad3ba3cb
generate manifest.xml files from templates 2018-10-28 13:48:27 +01:00
Moritz Bunkus
64a52f7590
build system: fix dependency calculation with zapcc part 2
In revision 9f2038a8ef I tried to fix
dependency handling for zapcc which were output in a different
format. Unfortunately this broke with other compiler versions that
still put multiple source files on a single line separated by spaces.

So fix the fix.
2018-08-20 17:12:34 +02:00
Moritz Bunkus
9f2038a8ef
build system: fix dependency calculation with zapcc
zapcc (and probably newer clangs, too) will always output absolute
paths to source files in the dependency files they create. Therefore
the algorithm that removes any file not part of the MKVToolNix source
tree from the dependency list has to take that into account.
2018-08-20 14:49:16 +02:00
Moritz Bunkus
9e04c038f4
packaging: move all packaging files to packaging directory 2018-06-25 17:59:11 +02:00
Moritz Bunkus
5f5ae9542e Windows build: build libmtxcommon as DLL on shared builds 2018-04-08 12:53:57 +02:00
Moritz Bunkus
5f3f995fde build system: add accidentally ignored compilation_database.rb 2018-02-27 20:42:23 +01:00
Moritz Bunkus
0dc4ed132c Rakefile: read build-config.local if present and overlay over build-config 2018-01-22 23:41:32 +01:00
Moritz Bunkus
de37cf3418 build system: output error if command to execute isn't found 2018-01-21 12:48:15 +01:00
Moritz Bunkus
eebe77f6a3 build system: use FileUtils.mkdir_p instead of a mutex for creating directories
No need for a full-blown mutex as `mkdir_p` already handles the
directory existing correctly via catching the corresponding
exception.

See #2194.
2018-01-13 21:30:56 +01:00
Moritz Bunkus
635e546a58 build system: avoid race condition when creating dependency directories 2018-01-08 21:10:52 +01:00