Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style: corrected some left over style issues. #998

Merged
merged 2 commits into from
Nov 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions include/dpp/emoji.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,17 @@ enum emoji_flags : uint8_t {
/**
* @brief Managed (introduced by application)
*/
e_managed = 0b00000010,
e_managed = 0b00000010,

/**
* @brief Animated emoji.
*/
e_animated = 0b00000100,
e_animated = 0b00000100,

/**
* @brief Available (false if the guild doesn't meet boosting criteria, etc)
*/
e_available = 0b00001000,
e_available = 0b00001000,
};

/**
Expand Down
5 changes: 4 additions & 1 deletion include/dpp/isa/avx.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@ namespace dpp {
}

protected:
alignas(16) float values[byte_blocks_per_register]{};///< Array for storing the values to be loaded/stored.
/**
* @brief Array for storing the values to be loaded/stored.
*/
alignas(16) float values[byte_blocks_per_register]{};

/**
* @brief Stores values from a 128-bit AVX vector to a storage location.
Expand Down
5 changes: 4 additions & 1 deletion include/dpp/isa/avx2.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,10 @@ namespace dpp {
}

protected:
alignas(32) float values[byte_blocks_per_register]{};///< Array for storing the values to be loaded/stored.
/**
* @brief Array for storing the values to be loaded/stored.
*/
alignas(32) float values[byte_blocks_per_register]{};

/**
* @brief Stores values from a 256-bit AVX2 vector to a storage location.
Expand Down
5 changes: 4 additions & 1 deletion include/dpp/isa/avx512.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,10 @@ namespace dpp {
}

protected:
alignas(64) float values[byte_blocks_per_register]{};///< Array for storing the values to be loaded/stored.
/**
* @brief Array for storing the values to be loaded/stored.
*/
alignas(64) float values[byte_blocks_per_register]{};

/**
* @brief Stores values from a 512-bit AVX512 vector to a storage location.
Expand Down
10 changes: 5 additions & 5 deletions include/dpp/voicestate.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,19 +94,19 @@ class DPP_EXPORT voicestate : public json_interface<voicestate> {
/**
* @brief Optional: The guild id this voice state is for.
*/
snowflake guild_id;
snowflake guild_id{0};

/**
* @brief The channel id this user is connected to.
*
* @note This may be empty.
*/
snowflake channel_id;
snowflake channel_id{0};

/**
* @brief The user id this voice state is for.
*/
snowflake user_id;
snowflake user_id{0};

/**
* @brief The session id for this voice state.
Expand All @@ -116,14 +116,14 @@ class DPP_EXPORT voicestate : public json_interface<voicestate> {
/**
* @brief Voice state flags from dpp::voicestate_flags.
*/
uint8_t flags;
uint8_t flags{0};

/**
* @brief The time at which the user requested to speak.
*
* @note If the user never requested to speak, this is 0.
*/
time_t request_to_speak;
time_t request_to_speak{0};

/**
* @brief Construct a new voicestate object
Expand Down
20 changes: 14 additions & 6 deletions src/dpp/utility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -877,15 +877,23 @@ std::string make_url_parameters(const std::map<std::string, uint64_t>& parameter

std::string markdown_escape(const std::string& text, bool escape_code_blocks) {
/**
* @brief Represents the current state of the finite state machine
* for the markdown_escape function.
*/
* @brief Represents the current state of the finite state machine
* for the markdown_escape function.
*/
enum md_state {
/// normal text
/**
* @brief Normal text
*/
md_normal = 0,
/// a paragraph code block, represented by three backticks

/**
* @brief A paragraph code block, represented by three backticks.
*/
md_big_code_block = 1,
/// an inline code block, represented by one backtick

/**
* @brief An inline code block, represented by one backtick.
*/
md_small_code_block = 2,
};

Expand Down
12 changes: 6 additions & 6 deletions src/dpp/voicestate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ voicestate::voicestate() : shard(nullptr), guild_id(0), channel_id(0), user_id(0
}

voicestate& voicestate::fill_from_json_impl(nlohmann::json* j) {
guild_id = snowflake_not_null(j, "guild_id");
channel_id = snowflake_not_null(j, "channel_id");
user_id = snowflake_not_null(j, "user_id");
session_id = string_not_null(j, "session_id");
request_to_speak = ts_not_null(j, "request_to_speak_timestamp");
flags = 0;
set_snowflake_not_null(j, "guild_id", guild_id);
set_snowflake_not_null(j, "channel_id", channel_id);
set_snowflake_not_null(j, "user_id", user_id);
set_string_not_null(j, "session_id", session_id);
set_ts_not_null(j, "request_to_speak_timestamp", request_to_speak);

if (bool_not_null(j, "deaf")) {
flags |= vs_deaf;
}
Expand Down