mirror of
https://github.com/SFML/CSFML.git
synced 2026-10-24 21:53:37 +02:00
Use more [[nodiscard]]
This commit is contained in:
1 parent
4d23a89918
commit
1a95bf0807
2 files changed
+3
-3
No files matched your search
@@ -46,7 +46,7 @@ static_assert(alignof(sfChar32) == alignof(char32_t));
|
||||
////////////////////////////////////////////////////////////
|
||||
// Define utils to copy from / to sfChar32 and sf::String
|
||||
////////////////////////////////////////////////////////////
|
||||
inline sfChar32* copyToChar32(const sf::String& str)
|
||||
[[nodiscard]] inline sfChar32* copyToChar32(const sf::String& str)
|
||||
{
|
||||
std::size_t byteCount = sizeof(sfChar32) * str.getSize();
|
||||
auto* utf32 = static_cast<sfChar32*>(malloc(byteCount + sizeof(sfChar32)));
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
namespace
|
||||
{
|
||||
// Helper function for converting a SFML address to a CSFML one
|
||||
sfIpAddress fromSFMLAddress(std::optional<sf::IpAddress> address)
|
||||
[[nodiscard]] sfIpAddress fromSFMLAddress(std::optional<sf::IpAddress> address)
|
||||
{
|
||||
sfIpAddress result = {0};
|
||||
|
||||
@@ -48,7 +48,7 @@ sfIpAddress fromSFMLAddress(std::optional<sf::IpAddress> address)
|
||||
}
|
||||
|
||||
// Helper function for converting a CSFML address to a SFML one
|
||||
std::optional<sf::IpAddress> toSFMLAddress(sfIpAddress address)
|
||||
[[nodiscard]] std::optional<sf::IpAddress> toSFMLAddress(sfIpAddress address)
|
||||
{
|
||||
return sf::IpAddress::resolve(address.address);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user