diff options
author | David Robillard <d@drobilla.net> | 2024-07-17 11:33:25 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2024-07-17 12:30:47 -0400 |
commit | 175c04323ad1aaaa1e0c949b8de411d5e2cece74 (patch) | |
tree | ac359693858f9ba2e619f2d9fc9b809af637a82e /src/Configuration.cpp | |
parent | 973db12fe33bab8e6efca80deca358b4998d5eb2 (diff) | |
download | ingen-175c04323ad1aaaa1e0c949b8de411d5e2cece74.tar.gz ingen-175c04323ad1aaaa1e0c949b8de411d5e2cece74.tar.bz2 ingen-175c04323ad1aaaa1e0c949b8de411d5e2cece74.zip |
Avoid C-style casts and some size type conversions
Aside from the syntactic cast changes, reduces some size types to 32-bits,
since they can never be so large in practice. This eliminates some type
conversions and shaves a few bytes.
Diffstat (limited to 'src/Configuration.cpp')
-rw-r--r-- | src/Configuration.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Configuration.cpp b/src/Configuration.cpp index 5ee2ad2d..918bd9d3 100644 --- a/src/Configuration.cpp +++ b/src/Configuration.cpp @@ -55,6 +55,8 @@ Configuration::Configuration(Forge& forge) " ingen -eg # Run engine and GUI in one process\n" " ingen -eg foo.ingen # Run engine and GUI and load a graph") { + static const auto default_n_threads = static_cast<int32_t>(std::max(std::thread::hardware_concurrency(), 1U)); + add("atomicBundles", "atomic-bundles", 'a', "Execute bundles atomically", GLOBAL, forge.Bool, forge.make(false)); add("bufferSize", "buffer-size", 'b', "Buffer size in samples", GLOBAL, forge.Int, forge.make(1024)); add("clientPort", "client-port", 'C', "Client port", GLOBAL, forge.Int, Atom()); @@ -77,7 +79,7 @@ Configuration::Configuration(Forge& forge) add("flushLog", "flush-log", 'f', "Flush logs after every entry", GLOBAL, forge.Bool, forge.make(false)); add("dump", "dump", 'd', "Print debug output", SESSION, forge.Bool, forge.make(false)); add("trace", "trace", 't', "Show LV2 plugin trace messages", SESSION, forge.Bool, forge.make(false)); - add("threads", "threads", 'p', "Number of processing threads", GLOBAL, forge.Int, forge.make(int32_t(std::max(std::thread::hardware_concurrency(), 1U)))); + add("threads", "threads", 'p', "Number of processing threads", GLOBAL, forge.Int, forge.make(default_n_threads)); add("humanNames", "human-names", 0, "Show human names in GUI", GUI, forge.Bool, forge.make(true)); add("portLabels", "port-labels", 0, "Show port labels in GUI", GUI, forge.Bool, forge.make(true)); add("graphDirectory", "graph-directory", 0, "Default directory for opening graphs", GUI, forge.String, Atom()); |