diff --git a/src/Magnum/Audio/Context.cpp b/src/Magnum/Audio/Context.cpp index 70454b70e..4a8a62d07 100644 --- a/src/Magnum/Audio/Context.cpp +++ b/src/Magnum/Audio/Context.cpp @@ -182,9 +182,9 @@ Context& Context::current() { return *currentContext; } -Context::Context(Int argc, const char** argv): Context(Configuration{}, argc, argv) {} +Context::Context(const Int argc, const char* const* const argv): Context(Configuration{}, argc, argv) {} -Context::Context(NoCreateT, Int argc, const char** argv) noexcept: _device{}, _context{} { +Context::Context(NoCreateT, const Int argc, const char* const* const argv) noexcept: _device{}, _context{} { Utility::Arguments args{"magnum", Utility::Arguments::Flag::IgnoreUnknownOptions}; args.addOption("log", "default").setHelp("log", "console logging", "default|quiet|verbose") diff --git a/src/Magnum/Audio/Context.h b/src/Magnum/Audio/Context.h index 1d139a378..a02e99776 100644 --- a/src/Magnum/Audio/Context.h +++ b/src/Magnum/Audio/Context.h @@ -205,25 +205,13 @@ class MAGNUM_AUDIO_EXPORT Context { * Parses command-line arguments, and creates OpenAL context with given * configuration. */ - explicit Context(const Configuration& configuration, Int argc, const char** argv): Context(NoCreate, argc, argv) { create(configuration); } - - /** @overload */ - explicit Context(const Configuration& configuration, Int argc, char** argv): Context(configuration, argc, const_cast(argv)) {} - - /** @overload */ - explicit Context(const Configuration& configuration, Int argc, std::nullptr_t argv): Context(configuration, argc, static_cast(argv)) {} + explicit Context(const Configuration& configuration, Int argc, const char* const* argv): Context(NoCreate, argc, argv) { create(configuration); } /** @overload */ explicit Context(const Configuration& configuration): Context(configuration, 0, nullptr) {} /** @overload */ - explicit Context(Int argc, const char** argv); - - /** @overload */ - explicit Context(Int argc, char** argv): Context(argc, const_cast(argv)) {} - - /** @overload */ - explicit Context(Int argc, std::nullptr_t argv): Context(argc, static_cast(argv)) {} + explicit Context(Int argc, const char* const* argv); /** @overload */ explicit Context(): Context(0, nullptr) {} @@ -235,13 +223,7 @@ class MAGNUM_AUDIO_EXPORT Context { * time, for example to do a more involved configuration. Call * @ref create() or @ref tryCreate() to create the actual context. */ - explicit Context(NoCreateT, Int argc, const char** argv) noexcept; - - /** @overload */ - explicit Context(NoCreateT, Int argc, char** argv) noexcept: Context(NoCreate, argc, const_cast(argv)) {} - - /** @overload */ - explicit Context(NoCreateT, Int argc, std::nullptr_t argv) noexcept: Context(NoCreate, argc, static_cast(argv)) {} + explicit Context(NoCreateT, Int argc, const char* const* argv) noexcept; /** @overload */ explicit Context(NoCreateT) noexcept: Context{NoCreate, 0, nullptr} {} diff --git a/src/Magnum/Audio/al-info.cpp b/src/Magnum/Audio/al-info.cpp index e03e4896a..6b6cb714b 100644 --- a/src/Magnum/Audio/al-info.cpp +++ b/src/Magnum/Audio/al-info.cpp @@ -107,7 +107,7 @@ Vendor extension support: using namespace Magnum; -int main(const int argc, const char** const argv) { +int main(const int argc, const char* const* const argv) { Utility::Arguments args; args.addBooleanOption('s', "short").setHelp("short", "display just essential info and exit") .addBooleanOption("extension-strings").setHelp("extension-strings", "list all extension strings provided by the driver (implies --short)") diff --git a/src/Magnum/GL/Context.cpp b/src/Magnum/GL/Context.cpp index 75542aa74..7f8835403 100644 --- a/src/Magnum/GL/Context.cpp +++ b/src/Magnum/GL/Context.cpp @@ -689,9 +689,9 @@ Context& Context::current() { void Context::makeCurrent(Context* context) { currentContext = context; } -Context::Context(NoCreateT, Int argc, const char** argv, void functionLoader(Context&)): Context{NoCreate, Utility::Arguments{"magnum"}, argc, argv, functionLoader} {} +Context::Context(NoCreateT, const Int argc, const char* const* const argv, void functionLoader(Context&)): Context{NoCreate, Utility::Arguments{"magnum"}, argc, argv, functionLoader} {} -Context::Context(NoCreateT, Utility::Arguments& args, Int argc, const char** argv, void functionLoader(Context&)): _functionLoader{functionLoader}, _version{Version::None} { +Context::Context(NoCreateT, Utility::Arguments& args, const Int argc, const char* const* const argv, void functionLoader(Context&)): _functionLoader{functionLoader}, _version{Version::None} { /* Parse arguments */ CORRADE_INTERNAL_ASSERT(args.prefix() == "magnum"); args.addOption("disable-workarounds").setHelp("disable-workarounds", "driver workarounds to disable\n (see https://doc.magnum.graphics/magnum/opengl-workarounds.html for detailed info)", "LIST") diff --git a/src/Magnum/GL/Context.h b/src/Magnum/GL/Context.h index 72971ebfa..7a75b8531 100644 --- a/src/Magnum/GL/Context.h +++ b/src/Magnum/GL/Context.h @@ -870,9 +870,9 @@ class MAGNUM_GL_EXPORT Context { #endif /* Made protected so it's possible to test the NoCreate constructor and also not needed to friend Platform::GLContext. */ - explicit Context(NoCreateT, Int argc, const char** argv, void functionLoader(Context&)); - explicit Context(NoCreateT, Utility::Arguments&& args, Int argc, const char** argv, void functionLoader(Context&)): Context{NoCreate, args, argc, argv, functionLoader} {} - explicit Context(NoCreateT, Utility::Arguments& args, Int argc, const char** argv, void functionLoader(Context&)); + explicit Context(NoCreateT, Int argc, const char* const* argv, void functionLoader(Context&)); + explicit Context(NoCreateT, Utility::Arguments&& args, Int argc, const char* const* argv, void functionLoader(Context&)): Context{NoCreate, args, argc, argv, functionLoader} {} + explicit Context(NoCreateT, Utility::Arguments& args, Int argc, const char* const* argv, void functionLoader(Context&)); bool tryCreate(const Configuration& configuration); void create(const Configuration& configuration); diff --git a/src/Magnum/Platform/GLContext.h b/src/Magnum/Platform/GLContext.h index b453993d8..2306df00e 100644 --- a/src/Magnum/Platform/GLContext.h +++ b/src/Magnum/Platform/GLContext.h @@ -57,26 +57,20 @@ class GLContext: public GL::Context { /** * @brief Constructor * - * Equivalent to calling @ref GLContext(NoCreateT, Int, const char**) + * Equivalent to calling @ref GLContext(NoCreateT, Int, const char* const*) * followed by @ref create(const Configuration&). */ - explicit GLContext(Int argc, const char** argv, const Configuration& configuration = {}): GLContext{NoCreate, argc, argv} { + explicit GLContext(Int argc, const char* const* argv, const Configuration& configuration = {}): GLContext{NoCreate, argc, argv} { create(configuration); } - /** @overload */ - explicit GLContext(Int argc, char** argv, const Configuration& configuration = {}): GLContext{argc, const_cast(argv), configuration} {} - - /** @overload */ - explicit GLContext(Int argc, std::nullptr_t argv, const Configuration& configuration = {}): GLContext{argc, static_cast(argv), configuration} {} - /** * @brief Default constructor * * Equivalent to passing @cpp {0, nullptr, configuration} @ce to - * @ref GLContext(Int, const char**, const Configuration&). Even if the - * command-line options are not propagated, it's still possible to - * affect the setup behavior from the environment or by passing a + * @ref GLContext(Int, const char* const*, const Configuration&). Even + * if the command-line options are not propagated, it's still possible + * to affect the setup behavior from the environment or by passing a * @relativeref{GL::Context,Configuration} instance. See * @ref GL-Context-usage for more information. */ @@ -88,26 +82,18 @@ class GLContext: public GL::Context { * Parses command-line arguments and sets @ref version() to * @ref GL::Version::None, everything else is left in an empty state. * Use @ref create() or @ref tryCreate() to create the context. - * @see @ref GLContext(Int, const char**, const Configuration&) + * @see @ref GLContext(Int, const char* const*, const Configuration&) */ - explicit GLContext(NoCreateT, Int argc, const char** argv): + explicit GLContext(NoCreateT, Int argc, const char* const* argv): #ifndef CORRADE_TARGET_EMSCRIPTEN GL::Context{NoCreate, argc, argv, flextGLInit} {} #else GL::Context{NoCreate, argc, argv, nullptr} {} #endif - /** @overload */ - explicit GLContext(NoCreateT, Int argc, char** argv): GLContext{NoCreate, argc, const_cast(argv)} {} - - /** @overload */ - explicit GLContext(NoCreateT, Int argc, std::nullptr_t argv): GLContext{NoCreate, argc, static_cast(argv)} {} - #ifndef DOXYGEN_GENERATING_OUTPUT /* Used privately to inject additional command-line arguments */ - explicit GLContext(NoCreateT, Utility::Arguments& args, Int argc, char** argv): GLContext{NoCreate, args, argc, const_cast(argv)} {} - explicit GLContext(NoCreateT, Utility::Arguments& args, Int argc, std::nullptr_t argv): GLContext{NoCreate, args, argc, static_cast(argv)} {} - explicit GLContext(NoCreateT, Utility::Arguments& args, Int argc, const char** argv): + explicit GLContext(NoCreateT, Utility::Arguments& args, Int argc, const char* const* argv): #ifndef CORRADE_TARGET_EMSCRIPTEN GL::Context{NoCreate, args, argc, argv, flextGLInit} {} #else @@ -119,7 +105,7 @@ class GLContext: public GL::Context { * @brief Construct with creation delayed to later * * Equivalent to passing @cpp {NoCreate, 0, nullptr} @ce to - * @ref GLContext(NoCreateT, Int, const char**). Even if the + * @ref GLContext(NoCreateT, Int, const char* const*). Even if the * command-line options are not propagated, it's still possible to * affect the renderer behavior from the environment or by passing * a @relativeref{GL::Context,Configuration} instance to @ref create() @@ -130,14 +116,14 @@ class GLContext: public GL::Context { /** * @brief Create the context * - * Meant to be called on a @ref GLContext(NoCreateT, Int, char**) "NoCreate"'d + * Meant to be called on a @ref GLContext(NoCreateT, Int, const char* const*) "NoCreate"'d * instance. Parses command-line arguments, loads OpenGL function * pointers using a platform-specific API, does initial setup, detects * available features and enables them throughout the engine. If * detected version is unsupported or any other error occurs, a message * is printed to output and the application exits. See @ref tryCreate() * for an alternative. - * @see @ref GLContext(Int, char**, const Configuration&), + * @see @ref GLContext(Int, const char* const*, const Configuration&), * @ref GL-Context-usage, @fn_gl{Get} with @def_gl{MAJOR_VERSION}, * @def_gl{MINOR_VERSION}, @def_gl{CONTEXT_FLAGS}, * @def_gl{NUM_EXTENSIONS}, @fn_gl{GetString} with diff --git a/src/Magnum/Vk/Implementation/InstanceState.cpp b/src/Magnum/Vk/Implementation/InstanceState.cpp index 56166ef65..12020d781 100644 --- a/src/Magnum/Vk/Implementation/InstanceState.cpp +++ b/src/Magnum/Vk/Implementation/InstanceState.cpp @@ -27,6 +27,6 @@ namespace Magnum { namespace Vk { namespace Implementation { -InstanceState::InstanceState(Instance&, Int argc, const char** argv): argc{argc}, argv{argv} {} +InstanceState::InstanceState(Instance&, Int argc, const char* const* argv): argc{argc}, argv{argv} {} }}} diff --git a/src/Magnum/Vk/Implementation/InstanceState.h b/src/Magnum/Vk/Implementation/InstanceState.h index 3972204b4..722ecdee3 100644 --- a/src/Magnum/Vk/Implementation/InstanceState.h +++ b/src/Magnum/Vk/Implementation/InstanceState.h @@ -30,10 +30,10 @@ namespace Magnum { namespace Vk { namespace Implementation { struct InstanceState { - explicit InstanceState(Instance& instance, Int argc, const char** argv); + explicit InstanceState(Instance& instance, Int argc, const char* const* argv); Int argc; - const char** argv; + const char* const* argv; /* There are currently no instance-level extension-dependent code paths. Everything is currently in DeviceProperties internals, as diff --git a/src/Magnum/Vk/Instance.cpp b/src/Magnum/Vk/Instance.cpp index 0e63059f4..f34e69c84 100644 --- a/src/Magnum/Vk/Instance.cpp +++ b/src/Magnum/Vk/Instance.cpp @@ -56,10 +56,10 @@ struct InstanceCreateInfo::State { bool quietLog = false; Version version = Version::None; Int argc; - const char** argv; + const char* const* argv; }; -InstanceCreateInfo::InstanceCreateInfo(const Int argc, const char** const argv, const LayerProperties* const layerProperties, const InstanceExtensionProperties* extensionProperties, const Flags flags): _info{}, _applicationInfo{} { +InstanceCreateInfo::InstanceCreateInfo(const Int argc, const char* const* const argv, const LayerProperties* const layerProperties, const InstanceExtensionProperties* extensionProperties, const Flags flags): _info{}, _applicationInfo{} { Utility::Arguments args = Implementation::arguments(); args.parse(argc, argv); @@ -364,7 +364,7 @@ template void Instance::initializeExtensions(const Containers::ArrayVie } } -void Instance::initialize(const Version version, const Int argc, const char** const argv) { +void Instance::initialize(const Version version, const Int argc, const char* const* const argv) { /* Init version, function pointers */ _version = version; flextVkInitInstance(_handle, &_functionPointers); diff --git a/src/Magnum/Vk/Instance.h b/src/Magnum/Vk/Instance.h index 139b73895..e4b1e7f41 100644 --- a/src/Magnum/Vk/Instance.h +++ b/src/Magnum/Vk/Instance.h @@ -436,7 +436,7 @@ class MAGNUM_VK_EXPORT Instance { private: template MAGNUM_VK_LOCAL void initializeExtensions(Containers::ArrayView enabledExtensions); - MAGNUM_VK_LOCAL void initialize(Version version, Int argc, const char** argv); + MAGNUM_VK_LOCAL void initialize(Version version, Int argc, const char* const* argv); VkInstance _handle; HandleFlags _flags; diff --git a/src/Magnum/Vk/InstanceCreateInfo.h b/src/Magnum/Vk/InstanceCreateInfo.h index b788999f8..9ca5eabab 100644 --- a/src/Magnum/Vk/InstanceCreateInfo.h +++ b/src/Magnum/Vk/InstanceCreateInfo.h @@ -54,7 +54,7 @@ class MAGNUM_VK_EXPORT InstanceCreateInfo { * @brief Instance creation flag * * Wraps @type_vk_keyword{InstanceCreateFlagBits}. - * @see @ref Flags, @ref InstanceCreateInfo(Int, const char**, const LayerProperties*, const InstanceExtensionProperties*, Flags) + * @see @ref Flags, @ref InstanceCreateInfo(Int, const char* const*, const LayerProperties*, const InstanceExtensionProperties*, Flags) */ enum class Flag: UnsignedInt { /* Any magnum-specific flags added here have to be filtered out @@ -77,7 +77,7 @@ class MAGNUM_VK_EXPORT InstanceCreateInfo { * @brief Instance creation flags * * Type-safe wrapper for @type_vk_keyword{InstanceCreateFlags}. - * @see @ref InstanceCreateInfo(Int, const char**, const LayerProperties*, const InstanceExtensionProperties*, Flags) + * @see @ref InstanceCreateInfo(Int, const char* const*, const LayerProperties*, const InstanceExtensionProperties*, Flags) */ typedef Containers::EnumSet Flags; @@ -110,22 +110,10 @@ class MAGNUM_VK_EXPORT InstanceCreateInfo { Instance instance{argc, argv}; in which case all these overloads would need to be duplicated on Instance as well. */ - /*implicit*/ InstanceCreateInfo(Int argc, const char** argv, const LayerProperties* layerProperties, const InstanceExtensionProperties* const extensionProperties, Flags flags = {}); + /*implicit*/ InstanceCreateInfo(Int argc, const char* const* argv, const LayerProperties* layerProperties, const InstanceExtensionProperties* const extensionProperties, Flags flags = {}); /** @overload */ - /*implicit*/ InstanceCreateInfo(Int argc, char** argv, const LayerProperties* layerProperties, const InstanceExtensionProperties* extensionProperties, Flags flags = {}): InstanceCreateInfo{argc, const_cast(argv), layerProperties, extensionProperties, flags} {} - - /** @overload */ - /*implicit*/ InstanceCreateInfo(Int argc, std::nullptr_t argv, const LayerProperties* layerProperties, const InstanceExtensionProperties* extensionProperties, Flags flags = {}): InstanceCreateInfo{argc, static_cast(argv), layerProperties, extensionProperties, flags} {} - - /** @overload */ - /*implicit*/ InstanceCreateInfo(Int argc, const char** argv, Flags flags = {}): InstanceCreateInfo{argc, argv, nullptr, nullptr, flags} {} - - /** @overload */ - /*implicit*/ InstanceCreateInfo(Int argc, char** argv, Flags flags = {}): InstanceCreateInfo{argc, argv, nullptr, nullptr, flags} {} - - /** @overload */ - /*implicit*/ InstanceCreateInfo(Int argc, std::nullptr_t argv, Flags flags = {}): InstanceCreateInfo{argc, argv, nullptr, nullptr, flags} {} + /*implicit*/ InstanceCreateInfo(Int argc, const char* const* argv, Flags flags = {}): InstanceCreateInfo{argc, argv, nullptr, nullptr, flags} {} /** @overload */ /*implicit*/ InstanceCreateInfo(Flags flags = {}): InstanceCreateInfo{0, nullptr, flags} {}