From 8f26e784713fe6efa8279eadfbc38c5756a4ad77 Mon Sep 17 00:00:00 2001 From: "Craig Edwards (Brain)" Date: Sun, 20 Oct 2024 11:35:48 +0100 Subject: [PATCH] refactor: cleanup namespaces and unneeded includes (#1295) --- include/dpp/appcommand.h | 2 +- include/dpp/application.h | 2 +- include/dpp/auditlog.h | 2 +- include/dpp/automod.h | 2 +- include/dpp/ban.h | 2 +- include/dpp/bignum.h | 2 +- include/dpp/cache.h | 2 +- include/dpp/channel.h | 2 +- include/dpp/cluster.h | 2 +- include/dpp/collector.h | 2 +- include/dpp/commandhandler.h | 2 +- include/dpp/coro/async.h | 2 +- include/dpp/coro/coroutine.h | 2 +- include/dpp/coro/task.h | 2 +- include/dpp/discordclient.h | 2 +- include/dpp/discordevents.h | 2 +- include/dpp/discordvoiceclient.h | 2 +- include/dpp/dispatcher.h | 2 +- include/dpp/dtemplate.h | 2 +- include/dpp/emoji.h | 2 +- include/dpp/entitlement.h | 2 +- include/dpp/etf.h | 2 +- include/dpp/event.h | 2 +- include/dpp/event_router.h | 2 +- include/dpp/exception.h | 2 +- include/dpp/guild.h | 2 +- include/dpp/httpsclient.h | 2 +- include/dpp/integration.h | 2 +- include/dpp/intents.h | 2 +- include/dpp/invite.h | 2 +- include/dpp/isa/avx.h | 2 +- include/dpp/isa/avx2.h | 2 +- include/dpp/isa/avx512.h | 2 +- include/dpp/isa/fallback.h | 2 +- include/dpp/json_interface.h | 2 +- include/dpp/managed.h | 2 +- include/dpp/message.h | 2 +- include/dpp/misc-enum.h | 2 +- include/dpp/once.h | 2 +- include/dpp/permissions.h | 2 +- include/dpp/presence.h | 2 +- include/dpp/prune.h | 2 +- include/dpp/queues.h | 2 +- include/dpp/restrequest.h | 2 +- include/dpp/restresults.h | 2 +- include/dpp/role.h | 2 +- include/dpp/sku.h | 2 +- include/dpp/snowflake.h | 2 +- include/dpp/sslclient.h | 2 +- include/dpp/stage_instance.h | 2 +- include/dpp/stringops.h | 2 +- include/dpp/sync.h | 2 +- include/dpp/timed_listener.h | 2 +- include/dpp/timer.h | 2 +- include/dpp/user.h | 2 +- include/dpp/utility.h | 2 +- include/dpp/voiceregion.h | 2 +- include/dpp/voicestate.h | 2 +- include/dpp/webhook.h | 2 +- include/dpp/wsclient.h | 2 +- src/dpp/application.cpp | 6 +----- src/dpp/auditlog.cpp | 2 +- src/dpp/automod.cpp | 2 +- src/dpp/ban.cpp | 2 +- src/dpp/cache.cpp | 4 +--- src/dpp/channel.cpp | 3 +-- src/dpp/cluster.cpp | 8 ------- src/dpp/cluster/appcommand.cpp | 2 +- src/dpp/cluster/automod.cpp | 2 +- src/dpp/cluster/channel.cpp | 2 +- src/dpp/cluster/confirmation.cpp | 2 +- src/dpp/cluster/dm.cpp | 2 +- src/dpp/cluster/emoji.cpp | 2 +- src/dpp/cluster/entitlement.cpp | 2 +- src/dpp/cluster/gateway.cpp | 2 +- src/dpp/cluster/guild.cpp | 2 +- src/dpp/cluster/guild_member.cpp | 2 +- src/dpp/cluster/invite.cpp | 2 +- src/dpp/cluster/json_interface.cpp | 2 +- src/dpp/cluster/message.cpp | 2 +- src/dpp/cluster/role.cpp | 2 +- src/dpp/cluster/scheduled_event.cpp | 2 +- src/dpp/cluster/sku.cpp | 2 +- src/dpp/cluster/stage_instance.cpp | 2 +- src/dpp/cluster/sticker.cpp | 2 +- src/dpp/cluster/template.cpp | 2 +- src/dpp/cluster/thread.cpp | 2 +- src/dpp/cluster/timer.cpp | 2 +- src/dpp/cluster/user.cpp | 2 +- src/dpp/cluster/voice.cpp | 2 +- src/dpp/cluster/webhook.cpp | 2 +- src/dpp/commandhandler.cpp | 3 +-- src/dpp/discordclient.cpp | 15 +------------ src/dpp/discordevents.cpp | 8 ++----- src/dpp/discordvoiceclient.cpp | 12 +---------- src/dpp/dispatcher.cpp | 2 +- src/dpp/dns.cpp | 1 - src/dpp/dtemplate.cpp | 2 +- src/dpp/emoji.cpp | 3 +-- src/dpp/entitlement.cpp | 2 +- src/dpp/etf.cpp | 4 +--- src/dpp/guild.cpp | 5 +---- src/dpp/httpsclient.cpp | 4 +--- src/dpp/integration.cpp | 4 +--- src/dpp/invite.cpp | 4 +--- src/dpp/message.cpp | 2 +- src/dpp/permissions.cpp | 2 +- src/dpp/presence.cpp | 14 +++++------- src/dpp/prune.cpp | 2 +- src/dpp/queues.cpp | 3 +-- src/dpp/role.cpp | 6 +----- src/dpp/scheduled_event.cpp | 3 +-- src/dpp/sku.cpp | 2 +- src/dpp/slashcommand.cpp | 3 +-- src/dpp/snowflake.cpp | 2 +- src/dpp/sslclient.cpp | 13 +++--------- src/dpp/stage_instance.cpp | 2 +- src/dpp/thread.cpp | 1 - src/dpp/user.cpp | 33 ++++++++++++----------------- src/dpp/utility.cpp | 6 +----- src/dpp/voice/enabled/audio_mix.cpp | 2 -- src/dpp/voice/enabled/cleanup.cpp | 2 -- src/dpp/voiceregion.cpp | 3 +-- src/dpp/voicestate.cpp | 3 +-- src/dpp/webhook.cpp | 4 +--- src/dpp/wsclient.cpp | 2 +- 126 files changed, 141 insertions(+), 233 deletions(-) diff --git a/include/dpp/appcommand.h b/include/dpp/appcommand.h index e628bd97f8..a4f99f7938 100644 --- a/include/dpp/appcommand.h +++ b/include/dpp/appcommand.h @@ -1591,4 +1591,4 @@ typedef std::unordered_map slashcommand_map; */ typedef std::unordered_map guild_command_permissions_map; -} // namespace dpp +} diff --git a/include/dpp/application.h b/include/dpp/application.h index f49dd9735a..5fae5738d5 100644 --- a/include/dpp/application.h +++ b/include/dpp/application.h @@ -472,4 +472,4 @@ class DPP_EXPORT application : public managed, public json_interface application_map; -} // namespace dpp +} diff --git a/include/dpp/auditlog.h b/include/dpp/auditlog.h index 90339ec331..5af57abdb7 100644 --- a/include/dpp/auditlog.h +++ b/include/dpp/auditlog.h @@ -478,4 +478,4 @@ class DPP_EXPORT auditlog : public json_interface { virtual ~auditlog() = default; }; -} // namespace dpp +} diff --git a/include/dpp/automod.h b/include/dpp/automod.h index f01c81d821..05c194f47f 100644 --- a/include/dpp/automod.h +++ b/include/dpp/automod.h @@ -400,4 +400,4 @@ class DPP_EXPORT automod_rule : public managed, public json_interface automod_rule_map; -} // namespace dpp +} diff --git a/include/dpp/ban.h b/include/dpp/ban.h index 6a02352ed1..039aa90e31 100644 --- a/include/dpp/ban.h +++ b/include/dpp/ban.h @@ -66,4 +66,4 @@ class DPP_EXPORT ban : public json_interface { */ typedef std::unordered_map ban_map; -} // namespace dpp +} diff --git a/include/dpp/bignum.h b/include/dpp/bignum.h index 2966d7b8b0..6d13f8f472 100644 --- a/include/dpp/bignum.h +++ b/include/dpp/bignum.h @@ -98,4 +98,4 @@ class DPP_EXPORT bignumber { [[nodiscard]] std::vector get_binary() const; }; -} // namespace dpp +} diff --git a/include/dpp/cache.h b/include/dpp/cache.h index cdfa3788f8..f4bb884e98 100644 --- a/include/dpp/cache.h +++ b/include/dpp/cache.h @@ -270,5 +270,5 @@ cache_decl(role, find_role, get_role_cache, get_role_count); cache_decl(channel, find_channel, get_channel_cache, get_channel_count); cache_decl(emoji, find_emoji, get_emoji_cache, get_emoji_count); -} // namespace dpp +} diff --git a/include/dpp/channel.h b/include/dpp/channel.h index 6b97b9e23a..4550bfc247 100644 --- a/include/dpp/channel.h +++ b/include/dpp/channel.h @@ -878,5 +878,5 @@ void to_json(nlohmann::json& j, const permission_overwrite& po); */ typedef std::unordered_map channel_map; -} // namespace dpp +} diff --git a/include/dpp/cluster.h b/include/dpp/cluster.h index 4825fe497f..9c283e4a72 100644 --- a/include/dpp/cluster.h +++ b/include/dpp/cluster.h @@ -3982,4 +3982,4 @@ class DPP_EXPORT cluster { }; -} // namespace dpp +} diff --git a/include/dpp/collector.h b/include/dpp/collector.h index ac09bf95a6..7d25c1e659 100644 --- a/include/dpp/collector.h +++ b/include/dpp/collector.h @@ -470,4 +470,4 @@ class scheduled_event_collector : public scheduled_event_collector_t { virtual ~scheduled_event_collector() = default; }; -} // namespace dpp +} diff --git a/include/dpp/commandhandler.h b/include/dpp/commandhandler.h index 1958bc43d4..c8be5c9c97 100644 --- a/include/dpp/commandhandler.h +++ b/include/dpp/commandhandler.h @@ -425,4 +425,4 @@ class DPP_EXPORT DPP_DEPRECATED("commandhandler should not be used. Please consi }; -} // namespace dpp +} diff --git a/include/dpp/coro/async.h b/include/dpp/coro/async.h index 4295ae1218..2feac38d8a 100644 --- a/include/dpp/coro/async.h +++ b/include/dpp/coro/async.h @@ -184,6 +184,6 @@ class async : public awaitable { DPP_CHECK_ABI_COMPAT(async<>, async_dummy); -} // namespace dpp +} #endif /* DPP_CORO */ diff --git a/include/dpp/coro/coroutine.h b/include/dpp/coro/coroutine.h index a9e7a5d100..648ac2b79b 100644 --- a/include/dpp/coro/coroutine.h +++ b/include/dpp/coro/coroutine.h @@ -393,7 +393,7 @@ namespace detail::coroutine { DPP_CHECK_ABI_COMPAT(coroutine, coroutine_dummy) DPP_CHECK_ABI_COMPAT(coroutine, coroutine_dummy) -} // namespace dpp +} /** * @brief Specialization of std::coroutine_traits, helps the standard library figure out a promise type from a coroutine function. diff --git a/include/dpp/coro/task.h b/include/dpp/coro/task.h index 6625bb1f3e..d57bc8ce7f 100644 --- a/include/dpp/coro/task.h +++ b/include/dpp/coro/task.h @@ -433,7 +433,7 @@ std_coroutine::coroutine_handle<> final_awaiter::await_suspend(handle_t ha DPP_CHECK_ABI_COMPAT(task, task_dummy) DPP_CHECK_ABI_COMPAT(task, task_dummy) -} // namespace dpp +} /** * @brief Specialization of std::coroutine_traits, helps the standard library figure out a promise_t type from a coroutine function. diff --git a/include/dpp/discordclient.h b/include/dpp/discordclient.h index 872dbaa916..d57c2d775b 100644 --- a/include/dpp/discordclient.h +++ b/include/dpp/discordclient.h @@ -533,4 +533,4 @@ class DPP_EXPORT discord_client : public websocket_client voiceconn* get_voice(snowflake guild_id); }; -} // namespace dpp +} diff --git a/include/dpp/discordevents.h b/include/dpp/discordevents.h index 184294818b..c603239b61 100644 --- a/include/dpp/discordevents.h +++ b/include/dpp/discordevents.h @@ -229,4 +229,4 @@ std::string DPP_EXPORT base64_encode(unsigned char const* buf, unsigned int buff */ std::string DPP_EXPORT ts_to_string(time_t ts); -} // namespace dpp +} diff --git a/include/dpp/discordvoiceclient.h b/include/dpp/discordvoiceclient.h index 1330b7e0b2..ceb9d92829 100644 --- a/include/dpp/discordvoiceclient.h +++ b/include/dpp/discordvoiceclient.h @@ -1271,5 +1271,5 @@ class DPP_EXPORT discord_voice_client : public websocket_client void process_mls_group_rosters(const std::map>& rmap); }; -} // namespace dpp +} diff --git a/include/dpp/dispatcher.h b/include/dpp/dispatcher.h index 749f3a0454..be08488b7b 100644 --- a/include/dpp/dispatcher.h +++ b/include/dpp/dispatcher.h @@ -2198,5 +2198,5 @@ struct DPP_EXPORT entitlement_delete_t : public event_dispatch_t { entitlement deleted = {}; }; -} // namespace dpp +} diff --git a/include/dpp/dtemplate.h b/include/dpp/dtemplate.h index 098824e458..b0a2dc494b 100644 --- a/include/dpp/dtemplate.h +++ b/include/dpp/dtemplate.h @@ -112,4 +112,4 @@ class DPP_EXPORT dtemplate : public json_interface { */ typedef std::unordered_map dtemplate_map; -} // namespace dpp +} diff --git a/include/dpp/emoji.h b/include/dpp/emoji.h index 6249b4c9eb..7546ead720 100644 --- a/include/dpp/emoji.h +++ b/include/dpp/emoji.h @@ -249,4 +249,4 @@ class DPP_EXPORT emoji : public managed, public json_interface { */ typedef std::unordered_map emoji_map; -} // namespace dpp +} diff --git a/include/dpp/entitlement.h b/include/dpp/entitlement.h index 857b2691dd..fd181d6c5c 100644 --- a/include/dpp/entitlement.h +++ b/include/dpp/entitlement.h @@ -243,4 +243,4 @@ class DPP_EXPORT entitlement : public managed, public json_interface entitlement_map; -} // namespace dpp +} diff --git a/include/dpp/etf.h b/include/dpp/etf.h index 8e17ca3a96..f4e9f1d29b 100644 --- a/include/dpp/etf.h +++ b/include/dpp/etf.h @@ -708,4 +708,4 @@ class DPP_EXPORT etf_parser { std::string build(const nlohmann::json& j); }; -} // namespace dpp +} diff --git a/include/dpp/event.h b/include/dpp/event.h index 6921586755..1e34e1b365 100644 --- a/include/dpp/event.h +++ b/include/dpp/event.h @@ -156,4 +156,4 @@ event_decl(entitlement_create, ENTITLEMENT_CREATE); event_decl(entitlement_update, ENTITLEMENT_UPDATE); event_decl(entitlement_delete, ENTITLEMENT_DELETE); -} // namespace dpp::events +} diff --git a/include/dpp/event_router.h b/include/dpp/event_router.h index 2babc42e29..be8fc14d22 100644 --- a/include/dpp/event_router.h +++ b/include/dpp/event_router.h @@ -742,4 +742,4 @@ const T &awaitable::await_resume() { } #endif -} // namespace dpp +} diff --git a/include/dpp/exception.h b/include/dpp/exception.h index 1c60084240..3d5f41ff08 100644 --- a/include/dpp/exception.h +++ b/include/dpp/exception.h @@ -602,5 +602,5 @@ class exception : public std::exception # endif /* DPP_CORO */ #endif -} // namespace dpp +} diff --git a/include/dpp/guild.h b/include/dpp/guild.h index 86c9393f0b..b031371e20 100644 --- a/include/dpp/guild.h +++ b/include/dpp/guild.h @@ -2048,4 +2048,4 @@ typedef std::unordered_map guild_member_map; */ guild_member DPP_EXPORT find_guild_member(const snowflake guild_id, const snowflake user_id); -} // namespace dpp +} diff --git a/include/dpp/httpsclient.h b/include/dpp/httpsclient.h index 0090c68af4..5a0ff481cf 100644 --- a/include/dpp/httpsclient.h +++ b/include/dpp/httpsclient.h @@ -356,4 +356,4 @@ class DPP_EXPORT https_client : public ssl_client { }; -} // namespace dpp +} diff --git a/include/dpp/integration.h b/include/dpp/integration.h index 1e48c7be65..1dc78747fc 100644 --- a/include/dpp/integration.h +++ b/include/dpp/integration.h @@ -335,5 +335,5 @@ typedef std::unordered_map integration_map; */ typedef std::unordered_map connection_map; -} // namespace dpp +} diff --git a/include/dpp/intents.h b/include/dpp/intents.h index d225a9d5e1..f2e82b0c74 100644 --- a/include/dpp/intents.h +++ b/include/dpp/intents.h @@ -152,4 +152,4 @@ enum intents { i_unverified_default_intents = dpp::i_default_intents | dpp::i_message_content }; -} // namespace dpp +} diff --git a/include/dpp/invite.h b/include/dpp/invite.h index c20708056a..d1d9a939b9 100644 --- a/include/dpp/invite.h +++ b/include/dpp/invite.h @@ -242,4 +242,4 @@ class DPP_EXPORT invite : public json_interface { */ typedef std::unordered_map invite_map; -} // namespace dpp +} diff --git a/include/dpp/isa/avx.h b/include/dpp/isa/avx.h index b84d90b56a..6cae986288 100644 --- a/include/dpp/isa/avx.h +++ b/include/dpp/isa/avx.h @@ -107,6 +107,6 @@ namespace dpp { } }; -} // namespace dpp +} #endif \ No newline at end of file diff --git a/include/dpp/isa/avx2.h b/include/dpp/isa/avx2.h index 009127932a..29ed493e43 100644 --- a/include/dpp/isa/avx2.h +++ b/include/dpp/isa/avx2.h @@ -110,6 +110,6 @@ namespace dpp { } }; -} // namespace dpp +} #endif \ No newline at end of file diff --git a/include/dpp/isa/avx512.h b/include/dpp/isa/avx512.h index e5535da742..333a1a64f7 100644 --- a/include/dpp/isa/avx512.h +++ b/include/dpp/isa/avx512.h @@ -113,6 +113,6 @@ namespace dpp { } }; -} // namespace dpp +} #endif \ No newline at end of file diff --git a/include/dpp/isa/fallback.h b/include/dpp/isa/fallback.h index a7154233b2..5d246d4d29 100644 --- a/include/dpp/isa/fallback.h +++ b/include/dpp/isa/fallback.h @@ -76,4 +76,4 @@ namespace dpp { } }; -} // namespace dpp +} diff --git a/include/dpp/json_interface.h b/include/dpp/json_interface.h index 0fd209ed00..720b7a2eba 100644 --- a/include/dpp/json_interface.h +++ b/include/dpp/json_interface.h @@ -70,4 +70,4 @@ struct json_interface { } }; -} // namespace dpp +} diff --git a/include/dpp/managed.h b/include/dpp/managed.h index 4ccd2e5318..66d6b210a1 100644 --- a/include/dpp/managed.h +++ b/include/dpp/managed.h @@ -113,4 +113,4 @@ class DPP_EXPORT managed { } }; -} // namespace dpp +} diff --git a/include/dpp/message.h b/include/dpp/message.h index 44640af8d8..200f3f7a07 100644 --- a/include/dpp/message.h +++ b/include/dpp/message.h @@ -2651,4 +2651,4 @@ typedef std::unordered_map sticker_map; */ typedef std::unordered_map sticker_pack_map; -} // namespace dpp +} diff --git a/include/dpp/misc-enum.h b/include/dpp/misc-enum.h index 19fd2fcd9a..d9ac781f08 100644 --- a/include/dpp/misc-enum.h +++ b/include/dpp/misc-enum.h @@ -86,4 +86,4 @@ enum loglevel { ll_critical }; -} // namespace dpp +} diff --git a/include/dpp/once.h b/include/dpp/once.h index f81a02cfdb..ef24f205bb 100644 --- a/include/dpp/once.h +++ b/include/dpp/once.h @@ -43,4 +43,4 @@ template auto run_once() { return !std::exchange(called, true); }; -} // namespace dpp +} diff --git a/include/dpp/permissions.h b/include/dpp/permissions.h index 22b1b555ba..4124e3cd80 100644 --- a/include/dpp/permissions.h +++ b/include/dpp/permissions.h @@ -456,4 +456,4 @@ class DPP_EXPORT permission { } }; -} // namespace dpp +} diff --git a/include/dpp/presence.h b/include/dpp/presence.h index 7515b14bac..3918bf2d60 100644 --- a/include/dpp/presence.h +++ b/include/dpp/presence.h @@ -595,4 +595,4 @@ class DPP_EXPORT presence : public json_interface { */ typedef std::unordered_map presence_map; -} // namespace dpp +} diff --git a/include/dpp/prune.h b/include/dpp/prune.h index 36e6275f6d..08b7592597 100644 --- a/include/dpp/prune.h +++ b/include/dpp/prune.h @@ -77,4 +77,4 @@ struct DPP_EXPORT prune : public json_interface { json to_json(bool with_id = false) const; // Intentional shadow of json_interface, mostly present for documentation }; -} // namespace dpp +} diff --git a/include/dpp/queues.h b/include/dpp/queues.h index 3597e78931..c502647936 100644 --- a/include/dpp/queues.h +++ b/include/dpp/queues.h @@ -671,4 +671,4 @@ class DPP_EXPORT request_queue { bool is_globally_ratelimited() const; }; -} // namespace dpp +} diff --git a/include/dpp/restrequest.h b/include/dpp/restrequest.h index 93fdd27071..2fcff85a77 100644 --- a/include/dpp/restrequest.h +++ b/include/dpp/restrequest.h @@ -294,4 +294,4 @@ template inline void rest_request_vector(dpp::cluster* c, const char* b } -} // namespace dpp +} diff --git a/include/dpp/restresults.h b/include/dpp/restresults.h index c496f13c79..a78b9e9dfe 100644 --- a/include/dpp/restresults.h +++ b/include/dpp/restresults.h @@ -335,4 +335,4 @@ typedef std::function command_completion_e * @brief Automatically JSON encoded HTTP result */ typedef std::function json_encode_t; -} // namespace dpp +} diff --git a/include/dpp/role.h b/include/dpp/role.h index a3da13f367..1a76862823 100644 --- a/include/dpp/role.h +++ b/include/dpp/role.h @@ -994,5 +994,5 @@ typedef std::unordered_map role_map; */ typedef std::vector application_role_connection_metadata_list; -} // namespace dpp +} diff --git a/include/dpp/sku.h b/include/dpp/sku.h index f9d7c03908..7515a06260 100644 --- a/include/dpp/sku.h +++ b/include/dpp/sku.h @@ -173,4 +173,4 @@ class DPP_EXPORT sku : public managed, public json_interface { */ typedef std::unordered_map sku_map; -} // namespace dpp +} diff --git a/include/dpp/snowflake.h b/include/dpp/snowflake.h index 109f16a53a..871dca729b 100644 --- a/include/dpp/snowflake.h +++ b/include/dpp/snowflake.h @@ -269,7 +269,7 @@ class DPP_EXPORT snowflake final { } }; -} // namespace dpp +} template<> struct std::hash diff --git a/include/dpp/sslclient.h b/include/dpp/sslclient.h index e8e17e2c82..00371ef287 100644 --- a/include/dpp/sslclient.h +++ b/include/dpp/sslclient.h @@ -257,4 +257,4 @@ class DPP_EXPORT ssl_client virtual void log(dpp::loglevel severity, const std::string &msg) const; }; -} // namespace dpp +} diff --git a/include/dpp/stage_instance.h b/include/dpp/stage_instance.h index 6b0d2719a0..2bd90884a8 100644 --- a/include/dpp/stage_instance.h +++ b/include/dpp/stage_instance.h @@ -109,4 +109,4 @@ struct DPP_EXPORT stage_instance : public managed, public json_interface stage_instance_map; -} // namespace dpp +} diff --git a/include/dpp/stringops.h b/include/dpp/stringops.h index 9383fa4d06..cd99d9cc4f 100644 --- a/include/dpp/stringops.h +++ b/include/dpp/stringops.h @@ -220,4 +220,4 @@ template std::string leading_zeroes(T i, size_t width) return stream.str(); } -} // namespace dpp +} diff --git a/include/dpp/sync.h b/include/dpp/sync.h index 3c69f43a05..fdce669b2d 100644 --- a/include/dpp/sync.h +++ b/include/dpp/sync.h @@ -78,4 +78,4 @@ template T sync(class cluster* c, F func, Ts&& return _f.get(); } -} // namespace dpp +} diff --git a/include/dpp/timed_listener.h b/include/dpp/timed_listener.h index c5d7d0229b..d4dca777fc 100644 --- a/include/dpp/timed_listener.h +++ b/include/dpp/timed_listener.h @@ -102,4 +102,4 @@ template class timed_listene } }; -} // namespace dpp +} diff --git a/include/dpp/timer.h b/include/dpp/timer.h index e3e10943d1..c3dfbfa97e 100644 --- a/include/dpp/timer.h +++ b/include/dpp/timer.h @@ -129,4 +129,4 @@ class DPP_EXPORT oneshot_timer ~oneshot_timer(); }; -} // namespace dpp +} diff --git a/include/dpp/user.h b/include/dpp/user.h index cc7acadadd..57a8d73444 100644 --- a/include/dpp/user.h +++ b/include/dpp/user.h @@ -581,4 +581,4 @@ void from_json(const nlohmann::json& j, user_identified& u); */ typedef std::unordered_map user_map; -} // namespace dpp +} diff --git a/include/dpp/utility.h b/include/dpp/utility.h index 6654606fc3..cf6c417104 100644 --- a/include/dpp/utility.h +++ b/include/dpp/utility.h @@ -1066,4 +1066,4 @@ struct alignas(T) dummy { }; } // namespace utility -} // namespace dpp +} diff --git a/include/dpp/voiceregion.h b/include/dpp/voiceregion.h index 15d9306294..f3fd56055c 100644 --- a/include/dpp/voiceregion.h +++ b/include/dpp/voiceregion.h @@ -123,4 +123,4 @@ class DPP_EXPORT voiceregion : public json_interface { */ typedef std::unordered_map voiceregion_map; -} // namespace dpp +} diff --git a/include/dpp/voicestate.h b/include/dpp/voicestate.h index b5f9b55bcf..dc29652524 100644 --- a/include/dpp/voicestate.h +++ b/include/dpp/voicestate.h @@ -176,4 +176,4 @@ class DPP_EXPORT voicestate : public json_interface { /** A container of voicestates */ typedef std::unordered_map voicestate_map; -} // namespace dpp +} diff --git a/include/dpp/webhook.h b/include/dpp/webhook.h index 304565c26b..bef620814b 100644 --- a/include/dpp/webhook.h +++ b/include/dpp/webhook.h @@ -196,4 +196,4 @@ class DPP_EXPORT webhook : public managed, public json_interface { */ typedef std::unordered_map webhook_map; -} // namespace dpp +} diff --git a/include/dpp/wsclient.h b/include/dpp/wsclient.h index ee476c14f9..fbbf72dee7 100644 --- a/include/dpp/wsclient.h +++ b/include/dpp/wsclient.h @@ -237,4 +237,4 @@ class DPP_EXPORT websocket_client : public ssl_client { void send_close_packet(); }; -} // namespace dpp +} diff --git a/src/dpp/application.cpp b/src/dpp/application.cpp index e1c79c4848..1d2878d96d 100644 --- a/src/dpp/application.cpp +++ b/src/dpp/application.cpp @@ -21,10 +21,7 @@ ************************************************************************************/ #include #include -#include -#include #include -#include namespace dpp { @@ -168,5 +165,4 @@ std::string application::get_icon_url(uint16_t size, const image_type format) co return ""; } -} // namespace dpp - +} diff --git a/src/dpp/auditlog.cpp b/src/dpp/auditlog.cpp index 9abc95f121..2dcf8fb99f 100644 --- a/src/dpp/auditlog.cpp +++ b/src/dpp/auditlog.cpp @@ -74,5 +74,5 @@ auditlog& auditlog::fill_from_json_impl(nlohmann::json* j) { return *this; } -} // namespace dpp +} diff --git a/src/dpp/automod.cpp b/src/dpp/automod.cpp index 219d347859..0492f49a97 100644 --- a/src/dpp/automod.cpp +++ b/src/dpp/automod.cpp @@ -186,5 +186,5 @@ json automod_rule::to_json_impl(bool with_id) const { return j; } -} // namespace dpp +} diff --git a/src/dpp/ban.cpp b/src/dpp/ban.cpp index aee056b68e..a697b35c70 100644 --- a/src/dpp/ban.cpp +++ b/src/dpp/ban.cpp @@ -40,5 +40,5 @@ ban& ban::fill_from_json_impl(nlohmann::json* j) { return *this; } -} // namespace dpp +} diff --git a/src/dpp/cache.cpp b/src/dpp/cache.cpp index 715b829dd8..256e4e16f0 100644 --- a/src/dpp/cache.cpp +++ b/src/dpp/cache.cpp @@ -21,10 +21,8 @@ ************************************************************************************/ #include #include -#include #include #include -#include namespace dpp { @@ -85,4 +83,4 @@ cache_helper(role, role_cache, find_role, get_role_cache, get_role_count); cache_helper(guild, guild_cache, find_guild, get_guild_cache, get_guild_count); cache_helper(emoji, emoji_cache, find_emoji, get_emoji_cache, get_emoji_count); -} // namespace dpp +} diff --git a/src/dpp/channel.cpp b/src/dpp/channel.cpp index 4903b60f81..a12be0f59d 100644 --- a/src/dpp/channel.cpp +++ b/src/dpp/channel.cpp @@ -22,7 +22,6 @@ #include #include #include -#include #include #include #include @@ -580,4 +579,4 @@ forum_layout_type channel::get_default_forum_layout() const { } -} // namespace dpp +} diff --git a/src/dpp/cluster.cpp b/src/dpp/cluster.cpp index 26e333d194..90d4cb12c0 100644 --- a/src/dpp/cluster.cpp +++ b/src/dpp/cluster.cpp @@ -21,17 +21,9 @@ #include #include #include -#include -#include -#include -#include -#include -#include #include #include #include -#include -#include namespace dpp { diff --git a/src/dpp/cluster/appcommand.cpp b/src/dpp/cluster/appcommand.cpp index 80c3308447..ae131da0ab 100644 --- a/src/dpp/cluster/appcommand.cpp +++ b/src/dpp/cluster/appcommand.cpp @@ -191,4 +191,4 @@ void cluster::interaction_followup_get_original(const std::string &token, comman rest_request(this, API_PATH "/webhooks",std::to_string(me.id), utility::url_encode(token) + "/messages/@original", m_get, "", callback); } -} // namespace dpp +} diff --git a/src/dpp/cluster/automod.cpp b/src/dpp/cluster/automod.cpp index f4584baab7..c0d2d534aa 100644 --- a/src/dpp/cluster/automod.cpp +++ b/src/dpp/cluster/automod.cpp @@ -43,4 +43,4 @@ void cluster::automod_rule_delete(snowflake guild_id, snowflake rule_id, command rest_request(this, API_PATH "/guilds", std::to_string(guild_id), "/auto-moderation/rules/" + std::to_string(rule_id), m_delete, "", callback); } -} // namespace dpp +} diff --git a/src/dpp/cluster/channel.cpp b/src/dpp/cluster/channel.cpp index 4e0e41cc80..83e317f71c 100644 --- a/src/dpp/cluster/channel.cpp +++ b/src/dpp/cluster/channel.cpp @@ -101,4 +101,4 @@ void cluster::channel_set_voice_status(snowflake channel_id, const std::string& rest_request(this, API_PATH "/channels", std::to_string(channel_id), "voice-status", m_put, j.dump(-1, ' ', false, json::error_handler_t::replace), callback); } -} // namespace dpp +} diff --git a/src/dpp/cluster/confirmation.cpp b/src/dpp/cluster/confirmation.cpp index 07072ccaf2..6e48b138a2 100644 --- a/src/dpp/cluster/confirmation.cpp +++ b/src/dpp/cluster/confirmation.cpp @@ -161,4 +161,4 @@ error_info confirmation_callback_t::get_error() const { return {}; } -} // namespace dpp +} diff --git a/src/dpp/cluster/dm.cpp b/src/dpp/cluster/dm.cpp index cba8af9654..be895f7690 100644 --- a/src/dpp/cluster/dm.cpp +++ b/src/dpp/cluster/dm.cpp @@ -63,4 +63,4 @@ void cluster::gdm_remove(snowflake channel_id, snowflake user_id, command_comple rest_request(this, API_PATH "/channels", std::to_string(channel_id), "recipients/" + std::to_string(user_id), m_delete, "", callback); } -} // namespace dpp +} diff --git a/src/dpp/cluster/emoji.cpp b/src/dpp/cluster/emoji.cpp index 626707d13c..9e2f2b8461 100644 --- a/src/dpp/cluster/emoji.cpp +++ b/src/dpp/cluster/emoji.cpp @@ -81,4 +81,4 @@ void cluster::application_emoji_delete(snowflake emoji_id, command_completion_ev rest_request(this, API_PATH "/applications", me.id.str(), "emojis/" + emoji_id.str(), m_delete, "", callback); } -} // namespace dpp +} diff --git a/src/dpp/cluster/entitlement.cpp b/src/dpp/cluster/entitlement.cpp index d2b120772e..fa96e4c2b1 100644 --- a/src/dpp/cluster/entitlement.cpp +++ b/src/dpp/cluster/entitlement.cpp @@ -81,4 +81,4 @@ void cluster::entitlement_consume(const class snowflake entitlement_id, command_ rest_request(this, API_PATH "/applications", me.id.str(), "entitlements/" + entitlement_id.str() + "/consume", m_post, "", callback); } -} // namespace dpp +} diff --git a/src/dpp/cluster/gateway.cpp b/src/dpp/cluster/gateway.cpp index 7da7a81dd4..85bcfd6ca1 100644 --- a/src/dpp/cluster/gateway.cpp +++ b/src/dpp/cluster/gateway.cpp @@ -26,4 +26,4 @@ void cluster::get_gateway_bot(command_completion_event_t callback) { rest_request(this, API_PATH "/gateway", "bot", "", m_get, "", callback); } -} // namespace dpp +} diff --git a/src/dpp/cluster/guild.cpp b/src/dpp/cluster/guild.cpp index bf58372f69..75396c907b 100644 --- a/src/dpp/cluster/guild.cpp +++ b/src/dpp/cluster/guild.cpp @@ -169,4 +169,4 @@ void cluster::guild_edit_welcome_screen(snowflake guild_id, const struct welcome } -} // namespace dpp +} diff --git a/src/dpp/cluster/guild_member.cpp b/src/dpp/cluster/guild_member.cpp index 28e3b953b0..8ab690ea94 100644 --- a/src/dpp/cluster/guild_member.cpp +++ b/src/dpp/cluster/guild_member.cpp @@ -152,4 +152,4 @@ void cluster::guild_search_members(snowflake guild_id, const std::string& query, }); } -} // namespace dpp +} diff --git a/src/dpp/cluster/invite.cpp b/src/dpp/cluster/invite.cpp index 5d73f6aed7..1e03ed6555 100644 --- a/src/dpp/cluster/invite.cpp +++ b/src/dpp/cluster/invite.cpp @@ -35,4 +35,4 @@ void cluster::invite_get(const std::string &invite_code, command_completion_even rest_request(this, API_PATH "/invites", utility::url_encode(invite_code) + "?with_counts=true&with_expiration=true", "", m_get, "", callback); } -} // namespace dpp +} diff --git a/src/dpp/cluster/json_interface.cpp b/src/dpp/cluster/json_interface.cpp index 76863321ce..3af8435841 100644 --- a/src/dpp/cluster/json_interface.cpp +++ b/src/dpp/cluster/json_interface.cpp @@ -25,4 +25,4 @@ namespace dpp { -} // namespace dpp +} diff --git a/src/dpp/cluster/message.cpp b/src/dpp/cluster/message.cpp index e1d4943b59..b1922902a1 100644 --- a/src/dpp/cluster/message.cpp +++ b/src/dpp/cluster/message.cpp @@ -208,4 +208,4 @@ void cluster::channel_pins_get(snowflake channel_id, command_completion_event_t rest_request_list(this, API_PATH "/channels", std::to_string(channel_id), "pins", m_get, "", callback); } -} // namespace dpp +} diff --git a/src/dpp/cluster/role.cpp b/src/dpp/cluster/role.cpp index 2a2065a8f2..371c6256bb 100644 --- a/src/dpp/cluster/role.cpp +++ b/src/dpp/cluster/role.cpp @@ -70,4 +70,4 @@ void cluster::user_application_role_connection_update(snowflake application_id, rest_request(this, API_PATH "/users/@me/applications", std::to_string(application_id), "role-connection", m_put, connection.build_json(), callback); } -} // namespace dpp +} diff --git a/src/dpp/cluster/scheduled_event.cpp b/src/dpp/cluster/scheduled_event.cpp index ddc7ea16c6..fbf91ca18c 100644 --- a/src/dpp/cluster/scheduled_event.cpp +++ b/src/dpp/cluster/scheduled_event.cpp @@ -68,4 +68,4 @@ void cluster::guild_event_get(snowflake guild_id, snowflake event_id, command_co rest_request(this, API_PATH "/guilds", std::to_string(guild_id), "/scheduled-events/" + std::to_string(event_id) + "?with_user_count=true", m_get, "", callback); } -} // namespace dpp +} diff --git a/src/dpp/cluster/sku.cpp b/src/dpp/cluster/sku.cpp index 20f23f3e77..2c44c30c01 100644 --- a/src/dpp/cluster/sku.cpp +++ b/src/dpp/cluster/sku.cpp @@ -27,4 +27,4 @@ void cluster::skus_get(command_completion_event_t callback) { rest_request_list(this, API_PATH "/applications", me.id.str(), "entitlements", m_get, "", callback); } -} // namespace dpp +} diff --git a/src/dpp/cluster/stage_instance.cpp b/src/dpp/cluster/stage_instance.cpp index 9257f90a6d..ac9146d568 100644 --- a/src/dpp/cluster/stage_instance.cpp +++ b/src/dpp/cluster/stage_instance.cpp @@ -39,4 +39,4 @@ void cluster::stage_instance_delete(const snowflake channel_id, command_completi rest_request(this, API_PATH "/stage-instances", std::to_string(channel_id), "", m_delete, "", callback); } -} // namespace dpp +} diff --git a/src/dpp/cluster/sticker.cpp b/src/dpp/cluster/sticker.cpp index 9f61521a44..bc5ba5a0b5 100644 --- a/src/dpp/cluster/sticker.cpp +++ b/src/dpp/cluster/sticker.cpp @@ -55,4 +55,4 @@ void cluster::sticker_packs_get(command_completion_event_t callback) { rest_request_list(this, API_PATH "/sticker-packs", "", "", m_get, "", callback); } -} // namespace dpp +} diff --git a/src/dpp/cluster/template.cpp b/src/dpp/cluster/template.cpp index f0503ff83f..bf01b136a2 100644 --- a/src/dpp/cluster/template.cpp +++ b/src/dpp/cluster/template.cpp @@ -60,4 +60,4 @@ void cluster::template_get(const std::string &code, command_completion_event_t c rest_request(this, API_PATH "/guilds", "templates", code, m_get, "", callback); } -} // namespace dpp +} diff --git a/src/dpp/cluster/thread.cpp b/src/dpp/cluster/thread.cpp index b3c109406e..bf2205b51b 100644 --- a/src/dpp/cluster/thread.cpp +++ b/src/dpp/cluster/thread.cpp @@ -191,4 +191,4 @@ void cluster::thread_get(snowflake thread_id, command_completion_event_t callbac rest_request(this, API_PATH "/channels", std::to_string(thread_id), "", m_get, "", callback); } -} // namespace dpp +} diff --git a/src/dpp/cluster/timer.cpp b/src/dpp/cluster/timer.cpp index e6d7df1814..a6520306f2 100644 --- a/src/dpp/cluster/timer.cpp +++ b/src/dpp/cluster/timer.cpp @@ -146,4 +146,4 @@ oneshot_timer::~oneshot_timer() { cancel(); } -} // namespace dpp +} diff --git a/src/dpp/cluster/user.cpp b/src/dpp/cluster/user.cpp index b3504ceae2..616c5c101f 100644 --- a/src/dpp/cluster/user.cpp +++ b/src/dpp/cluster/user.cpp @@ -129,4 +129,4 @@ void cluster::user_get_cached(snowflake user_id, command_completion_event_t call rest_request(this, API_PATH "/users", std::to_string(user_id), "", m_get, "", callback); } -} // namespace dpp +} diff --git a/src/dpp/cluster/voice.cpp b/src/dpp/cluster/voice.cpp index ea78a487a4..c99bc45303 100644 --- a/src/dpp/cluster/voice.cpp +++ b/src/dpp/cluster/voice.cpp @@ -32,4 +32,4 @@ void cluster::guild_get_voice_regions(snowflake guild_id, command_completion_eve rest_request_list(this, API_PATH "/guilds", std::to_string(guild_id), "regions", m_get, "", callback); } -} // namespace dpp +} diff --git a/src/dpp/cluster/webhook.cpp b/src/dpp/cluster/webhook.cpp index 5231d19e40..8ebf9370e4 100644 --- a/src/dpp/cluster/webhook.cpp +++ b/src/dpp/cluster/webhook.cpp @@ -117,4 +117,4 @@ void cluster::get_webhook_with_token(snowflake webhook_id, const std::string &to rest_request(this, API_PATH "/webhooks", std::to_string(webhook_id), utility::url_encode(token), m_get, "", callback); } -} // namespace dpp +} diff --git a/src/dpp/commandhandler.cpp b/src/dpp/commandhandler.cpp index e337b0eee9..9101bbd477 100644 --- a/src/dpp/commandhandler.cpp +++ b/src/dpp/commandhandler.cpp @@ -20,7 +20,6 @@ ************************************************************************************/ #include #include -#include #include #include #include @@ -437,4 +436,4 @@ void commandhandler::thonk(command_source source, command_completion_event_t cal thinking(source, callback); } -} // namespace dpp +} diff --git a/src/dpp/discordclient.cpp b/src/dpp/discordclient.cpp index 09e5258ece..cf43b76fca 100644 --- a/src/dpp/discordclient.cpp +++ b/src/dpp/discordclient.cpp @@ -20,7 +20,6 @@ * ************************************************************************************/ #include -#include #include #include #include @@ -30,18 +29,6 @@ #include #include #include -#ifdef _WIN32 - #include - #include - #include -#else - #include - #include - #include - #include - #include - #include -#endif #define PATH_UNCOMPRESSED_JSON "/?v=" DISCORD_API_VERSION "&encoding=json" #define PATH_COMPRESSED_JSON "/?v=" DISCORD_API_VERSION "&encoding=json&compress=zlib-stream" @@ -732,4 +719,4 @@ voiceconn& voiceconn::connect(snowflake guild_id) { } -} // namespace dpp +} diff --git a/src/dpp/discordevents.cpp b/src/dpp/discordevents.cpp index f3e2aebb68..fb58faf610 100644 --- a/src/dpp/discordevents.cpp +++ b/src/dpp/discordevents.cpp @@ -22,7 +22,7 @@ /* OpenBSD errors when xopen_source is defined. * We want to make sure that OpenBSD does not define it. */ -#if !defined(__OpenBSD__) +#ifndef __OpenBSD__ #ifndef _XOPEN_SOURCE #define _XOPEN_SOURCE #endif @@ -35,11 +35,7 @@ #include #include #include -#include -#include -#include #include -#include #include #include @@ -439,4 +435,4 @@ void discord_client::handle_event(const std::string &event, json &j, const std:: } } -} // namespace dpp +} diff --git a/src/dpp/discordvoiceclient.cpp b/src/dpp/discordvoiceclient.cpp index 4a4f484968..5b241d1122 100644 --- a/src/dpp/discordvoiceclient.cpp +++ b/src/dpp/discordvoiceclient.cpp @@ -21,16 +21,6 @@ ************************************************************************************/ #include -#ifdef _WIN32 - #include - #include - #include -#else - #include - #include - #include -#endif -#include #include #include #include @@ -460,4 +450,4 @@ discord_voice_client& discord_voice_client::send_stop_frames(bool send_now) { return *this; } -} // namespace dpp +} diff --git a/src/dpp/dispatcher.cpp b/src/dpp/dispatcher.cpp index 6ac9775d40..db8ea2e888 100644 --- a/src/dpp/dispatcher.cpp +++ b/src/dpp/dispatcher.cpp @@ -286,4 +286,4 @@ void voice_receive_t::reassign(discord_voice_client* vc, snowflake _user_id, con audio_size = audio_data.size(); } -} // namespace dpp +} diff --git a/src/dpp/dns.cpp b/src/dpp/dns.cpp index 257b9b2315..42aed3ce8f 100644 --- a/src/dpp/dns.cpp +++ b/src/dpp/dns.cpp @@ -21,7 +21,6 @@ ************************************************************************************/ #include -#include #include #include #include diff --git a/src/dpp/dtemplate.cpp b/src/dpp/dtemplate.cpp index 8f67e0efd6..1ed6f53905 100644 --- a/src/dpp/dtemplate.cpp +++ b/src/dpp/dtemplate.cpp @@ -57,4 +57,4 @@ json dtemplate::to_json_impl(bool with_id) const { }; } -} // namespace dpp +} diff --git a/src/dpp/emoji.cpp b/src/dpp/emoji.cpp index b8d0350e20..4d90982e64 100644 --- a/src/dpp/emoji.cpp +++ b/src/dpp/emoji.cpp @@ -22,7 +22,6 @@ #include #include #include -#include namespace dpp { @@ -130,5 +129,5 @@ std::string emoji::get_url(uint16_t size, const dpp::image_type format, bool pre } -} // namespace dpp +} diff --git a/src/dpp/entitlement.cpp b/src/dpp/entitlement.cpp index f3ee034a04..b30871ce58 100644 --- a/src/dpp/entitlement.cpp +++ b/src/dpp/entitlement.cpp @@ -83,4 +83,4 @@ bool entitlement::is_consumed() const { return flags & entitlement_flags::ent_consumed; } -} // namespace dpp +} diff --git a/src/dpp/etf.cpp b/src/dpp/etf.cpp index a76f5d9c41..2b4c25f657 100644 --- a/src/dpp/etf.cpp +++ b/src/dpp/etf.cpp @@ -33,8 +33,6 @@ ************************************************************************************/ #include #include -#include -#include #include #include #include @@ -729,5 +727,5 @@ etf_buffer::etf_buffer(size_t initial) { etf_buffer::~etf_buffer() = default; -} // namespace dpp +} diff --git a/src/dpp/guild.cpp b/src/dpp/guild.cpp index 7751d6abea..0cecaaea4c 100644 --- a/src/dpp/guild.cpp +++ b/src/dpp/guild.cpp @@ -20,9 +20,6 @@ ************************************************************************************/ #include #include -#include -#include -#include #include #include #include @@ -1196,4 +1193,4 @@ onboarding &onboarding::set_enabled(const bool is_enabled) { } -} // namespace dpp +} diff --git a/src/dpp/httpsclient.cpp b/src/dpp/httpsclient.cpp index 9ac8faa021..8c7cff3258 100644 --- a/src/dpp/httpsclient.cpp +++ b/src/dpp/httpsclient.cpp @@ -27,8 +27,6 @@ #include #include #include -#include -#include namespace dpp { @@ -358,4 +356,4 @@ http_connect_info https_client::get_host_info(std::string url) { return hci; } -} // namespace dpp +} diff --git a/src/dpp/integration.cpp b/src/dpp/integration.cpp index c8e870fde1..e2cd59b51f 100644 --- a/src/dpp/integration.cpp +++ b/src/dpp/integration.cpp @@ -25,8 +25,6 @@ #include #include - - namespace dpp { using json = nlohmann::json; @@ -150,4 +148,4 @@ connection& connection::fill_from_json_impl(nlohmann::json* j) { return *this; } -} // namespace dpp +} diff --git a/src/dpp/invite.cpp b/src/dpp/invite.cpp index c063ac4aed..b33435f6e9 100644 --- a/src/dpp/invite.cpp +++ b/src/dpp/invite.cpp @@ -23,8 +23,6 @@ #include #include - - namespace dpp { using json = nlohmann::json; @@ -117,4 +115,4 @@ invite &invite::set_unique(const bool is_unique) { return *this; } -} // namespace dpp +} diff --git a/src/dpp/message.cpp b/src/dpp/message.cpp index 8c7efa1fe4..cb96f4edaa 100644 --- a/src/dpp/message.cpp +++ b/src/dpp/message.cpp @@ -1548,4 +1548,4 @@ sticker& sticker::set_file_content(std::string_view fc) { } -} // namespace dpp +} diff --git a/src/dpp/permissions.cpp b/src/dpp/permissions.cpp index 02dd8325d7..58eefaa3ce 100644 --- a/src/dpp/permissions.cpp +++ b/src/dpp/permissions.cpp @@ -27,4 +27,4 @@ permission::operator nlohmann::json() const { return std::to_string(value); } -} // namespace dpp +} diff --git a/src/dpp/presence.cpp b/src/dpp/presence.cpp index 34809b1c4c..7b40dc9a0d 100644 --- a/src/dpp/presence.cpp +++ b/src/dpp/presence.cpp @@ -21,12 +21,8 @@ ************************************************************************************/ #include #include -#include -#include #include - - namespace dpp { using json = nlohmann::json; @@ -35,8 +31,8 @@ std::string activity::get_large_asset_url(uint16_t size, const image_type format if (!this->assets.large_image.empty() && this->application_id && this->assets.large_image.find(':') == std::string::npos) { // make sure it's not a prefixed proxy image return utility::cdn_endpoint_url({ i_jpg, i_png, i_webp }, - "app-assets/" + std::to_string(this->application_id) + "/" + this->assets.large_image, - format, size); + "app-assets/" + std::to_string(this->application_id) + "/" + this->assets.large_image, + format, size); } else { return std::string(); } @@ -46,8 +42,8 @@ std::string activity::get_small_asset_url(uint16_t size, const image_type format if (!this->assets.small_image.empty() && this->application_id && this->assets.small_image.find(':') == std::string::npos) { // make sure it's not a prefixed proxy image return utility::cdn_endpoint_url({ i_jpg, i_png, i_webp }, - "app-assets/" + std::to_string(this->application_id) + "/" + this->assets.small_image, - format, size); + "app-assets/" + std::to_string(this->application_id) + "/" + this->assets.small_image, + format, size); } else { return std::string(); } @@ -308,4 +304,4 @@ presence_status presence::status() const { return (presence_status)((flags >> PF_SHIFT_MAIN) & PF_STATUS_MASK); } -} // namespace dpp +} diff --git a/src/dpp/prune.cpp b/src/dpp/prune.cpp index afd7f9ae52..befea860f0 100644 --- a/src/dpp/prune.cpp +++ b/src/dpp/prune.cpp @@ -51,4 +51,4 @@ json prune::to_json(bool with_id) const { return to_json_impl(with_id); } -} // namespace dpp +} diff --git a/src/dpp/queues.cpp b/src/dpp/queues.cpp index 8505606556..96aa1d5288 100644 --- a/src/dpp/queues.cpp +++ b/src/dpp/queues.cpp @@ -28,7 +28,6 @@ #include #include #include -#include namespace dpp { @@ -480,4 +479,4 @@ bool request_queue::is_globally_ratelimited() const return this->globally_ratelimited; } -} // namespace dpp +} diff --git a/src/dpp/role.cpp b/src/dpp/role.cpp index 89643f210f..877cf6d0a4 100644 --- a/src/dpp/role.cpp +++ b/src/dpp/role.cpp @@ -23,12 +23,8 @@ #include #include #include -#include -#include #include - - namespace dpp { using json = nlohmann::json; @@ -485,4 +481,4 @@ json application_role_connection::to_json_impl(bool with_id) const { } -} // namespace dpp +} diff --git a/src/dpp/scheduled_event.cpp b/src/dpp/scheduled_event.cpp index fe7e2c7a4c..2af52a4e5f 100644 --- a/src/dpp/scheduled_event.cpp +++ b/src/dpp/scheduled_event.cpp @@ -19,7 +19,6 @@ * ************************************************************************************/ #include -#include #include #include #include @@ -193,4 +192,4 @@ json scheduled_event::to_json_impl(bool with_id) const { return j; } -} // namespace dpp +} diff --git a/src/dpp/sku.cpp b/src/dpp/sku.cpp index 170a158159..52b0b62161 100644 --- a/src/dpp/sku.cpp +++ b/src/dpp/sku.cpp @@ -86,4 +86,4 @@ bool sku::is_user_subscription() const { return flags & sku_flags::sku_user_subscription; } -} // namespace dpp +} diff --git a/src/dpp/slashcommand.cpp b/src/dpp/slashcommand.cpp index 77dd4bfebe..782393ccde 100644 --- a/src/dpp/slashcommand.cpp +++ b/src/dpp/slashcommand.cpp @@ -20,7 +20,6 @@ ************************************************************************************/ #include #include -#include #include #include #include @@ -941,4 +940,4 @@ std::string command_interaction::get_mention() const { std::string slashcommand::get_mention() const { return dpp::utility::slashcommand_mention(id, name); } -} // namespace dpp +} diff --git a/src/dpp/snowflake.cpp b/src/dpp/snowflake.cpp index 72d566756c..2257b3158c 100644 --- a/src/dpp/snowflake.cpp +++ b/src/dpp/snowflake.cpp @@ -44,4 +44,4 @@ snowflake::operator json() const { return std::to_string(value); } -} // namespace dpp +} diff --git a/src/dpp/sslclient.cpp b/src/dpp/sslclient.cpp index 54698eb0e4..7cdf92150e 100644 --- a/src/dpp/sslclient.cpp +++ b/src/dpp/sslclient.cpp @@ -37,20 +37,13 @@ #else /* Anyting other than Windows (e.g. sane OSes) */ #include - #include - #include - #include #include - #include #include #endif -#include -#include -#include +#include #include #include -#include -#include +#include #include #include /* Windows specific OpenSSL symbol weirdness */ @@ -676,4 +669,4 @@ ssl_client::~ssl_client() cleanup(); } -} // namespace dpp +} diff --git a/src/dpp/stage_instance.cpp b/src/dpp/stage_instance.cpp index 4fde6c9dd3..dc11433e97 100644 --- a/src/dpp/stage_instance.cpp +++ b/src/dpp/stage_instance.cpp @@ -55,4 +55,4 @@ json stage_instance::to_json_impl(bool with_id) const { return j; } -} // namespace dpp +} diff --git a/src/dpp/thread.cpp b/src/dpp/thread.cpp index af661fe663..5ffc1f44f7 100644 --- a/src/dpp/thread.cpp +++ b/src/dpp/thread.cpp @@ -22,7 +22,6 @@ #include #include - namespace dpp { thread_member& thread_member::fill_from_json_impl(nlohmann::json* j) { diff --git a/src/dpp/user.cpp b/src/dpp/user.cpp index 64f21ae898..7f2d08cf4d 100644 --- a/src/dpp/user.cpp +++ b/src/dpp/user.cpp @@ -24,8 +24,8 @@ #include namespace dpp { -using json = nlohmann:: -json; + +using json = nlohmann::json; /* A mapping of discord's flag values to our bitmap (they're different bit positions to fit other stuff in) */ std::map usermap = { @@ -46,12 +46,7 @@ std::map usermap = { { 1 << 22, dpp::u_active_developer}, }; -user::user() : - managed(), - flags(0), - discriminator(0), - refcount(1) -{ +user::user() : managed(), flags(0), discriminator(0), refcount(1) { } std::string user::get_mention(const snowflake& id) { @@ -98,8 +93,8 @@ std::string user::get_avatar_url(uint16_t size, const image_type format, bool pr return get_default_avatar_url(); } else if (this->id) { return utility::cdn_endpoint_url_hash({ i_jpg, i_png, i_webp, i_gif }, - "avatars/" + std::to_string(this->id), this->avatar.to_string(), - format, size, prefer_animated, has_animated_icon()); + "avatars/" + std::to_string(this->id), this->avatar.to_string(), + format, size, prefer_animated, has_animated_icon()); } else { return std::string(); } @@ -108,12 +103,12 @@ std::string user::get_avatar_url(uint16_t size, const image_type format, bool pr std::string user::get_default_avatar_url() const { if (this->discriminator) { return utility::cdn_endpoint_url({ i_png }, - "embed/avatars/" + std::to_string(this->discriminator % 5), - i_png, 0); + "embed/avatars/" + std::to_string(this->discriminator % 5), + i_png, 0); } else if (this->id){ return utility::cdn_endpoint_url({ i_png }, - "embed/avatars/" + std::to_string((this->id >> 22) % 6), - i_png, 0); + "embed/avatars/" + std::to_string((this->id >> 22) % 6), + i_png, 0); } else { return std::string(); } @@ -122,8 +117,8 @@ std::string user::get_default_avatar_url() const { std::string user::get_avatar_decoration_url(uint16_t size) const { if (this->id) { return utility::cdn_endpoint_url_hash({ i_png }, - "avatar-decorations/" + std::to_string(this->id), this->avatar_decoration.to_string(), - i_png, size); + "avatar-decorations/" + std::to_string(this->id), this->avatar_decoration.to_string(), + i_png, size); } else { return std::string(); } @@ -253,8 +248,8 @@ bool user_identified::has_animated_banner() const { std::string user_identified::get_banner_url(uint16_t size, const image_type format, bool prefer_animated) const { if (!this->banner.to_string().empty() && this->id) { return utility::cdn_endpoint_url_hash({ i_jpg, i_png, i_webp, i_gif }, - "banners/" + std::to_string(this->id), this->banner.to_string(), - format, size, prefer_animated, has_animated_banner()); + "banners/" + std::to_string(this->id), this->banner.to_string(), + format, size, prefer_animated, has_animated_banner()); } else { return std::string(); } @@ -309,4 +304,4 @@ void from_json(const nlohmann::json& j, user& u) { } } -} // namespace dpp +} diff --git a/src/dpp/utility.cpp b/src/dpp/utility.cpp index b41be262fa..922fc4195e 100644 --- a/src/dpp/utility.cpp +++ b/src/dpp/utility.cpp @@ -21,7 +21,6 @@ ************************************************************************************/ #include #include -#include #include #include #include @@ -34,9 +33,6 @@ #include #include #include -#include -#include -#include #ifdef _WIN32 #include @@ -936,4 +932,4 @@ void set_thread_name(const std::string& name) { #endif } -} // namespace dpp::utility +} diff --git a/src/dpp/voice/enabled/audio_mix.cpp b/src/dpp/voice/enabled/audio_mix.cpp index 6d0f128e8c..c43d712313 100644 --- a/src/dpp/voice/enabled/audio_mix.cpp +++ b/src/dpp/voice/enabled/audio_mix.cpp @@ -21,14 +21,12 @@ ************************************************************************************/ #include -#include #include #include #include #include #include #include -#include #include namespace dpp { diff --git a/src/dpp/voice/enabled/cleanup.cpp b/src/dpp/voice/enabled/cleanup.cpp index 838000e884..5ae1d9c7e2 100644 --- a/src/dpp/voice/enabled/cleanup.cpp +++ b/src/dpp/voice/enabled/cleanup.cpp @@ -25,10 +25,8 @@ #include #include #include - #include #include "../../dave/encryptor.h" - #include "enabled.h" namespace dpp { diff --git a/src/dpp/voiceregion.cpp b/src/dpp/voiceregion.cpp index e3c9fc6349..22410228d7 100644 --- a/src/dpp/voiceregion.cpp +++ b/src/dpp/voiceregion.cpp @@ -72,5 +72,4 @@ bool voiceregion::is_custom() const { return flags & v_custom; } -} // namespace dpp - +} diff --git a/src/dpp/voicestate.cpp b/src/dpp/voicestate.cpp index f0bcbd6e9f..9968890200 100644 --- a/src/dpp/voicestate.cpp +++ b/src/dpp/voicestate.cpp @@ -90,5 +90,4 @@ bool voicestate::is_suppressed() const { return flags & vs_suppress; } -} // namespace dpp - +} diff --git a/src/dpp/webhook.cpp b/src/dpp/webhook.cpp index 4c43c4df2c..cc5622fe06 100644 --- a/src/dpp/webhook.cpp +++ b/src/dpp/webhook.cpp @@ -22,7 +22,6 @@ #include #include #include -#include namespace dpp { @@ -101,5 +100,4 @@ webhook& webhook::load_image(const std::string &image_blob, const image_type typ return *this; } -} // namespace dpp - +} diff --git a/src/dpp/wsclient.cpp b/src/dpp/wsclient.cpp index 424c34d2b1..618c7e7282 100644 --- a/src/dpp/wsclient.cpp +++ b/src/dpp/wsclient.cpp @@ -331,4 +331,4 @@ void websocket_client::close() ssl_client::close(); } -} // namespace dpp +}