Skip to content

Commit 10fe46f

Browse files
committed
Mark more internal functions as [[nodiscard]]
1 parent 18337dc commit 10fe46f

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

imgui-SFML.cpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,11 @@ static_assert(sizeof(GLuint) <= sizeof(ImTextureID), "ImTextureID is not large e
118118
namespace
119119
{
120120
// various helper functions
121-
ImColor toImColor(sf::Color c);
122-
ImVec2 toImVec2(const sf::Vector2f& v);
123-
sf::Vector2f toSfVector2f(const ImVec2& v);
124-
ImVec2 getTopLeftAbsolute(const sf::FloatRect& rect);
125-
ImVec2 getDownRightAbsolute(const sf::FloatRect& rect);
121+
[[nodiscard]] ImColor toImColor(sf::Color c);
122+
[[nodiscard]] ImVec2 toImVec2(const sf::Vector2f& v);
123+
[[nodiscard]] sf::Vector2f toSfVector2f(const ImVec2& v);
124+
[[nodiscard]] ImVec2 getTopLeftAbsolute(const sf::FloatRect& rect);
125+
[[nodiscard]] ImVec2 getDownRightAbsolute(const sf::FloatRect& rect);
126126

127127
struct SpriteTextureData
128128
{
@@ -131,35 +131,35 @@ struct SpriteTextureData
131131
ImTextureID textureID{};
132132
};
133133

134-
SpriteTextureData getSpriteTextureData(const sf::Sprite& sprite);
134+
[[nodiscard]] SpriteTextureData getSpriteTextureData(const sf::Sprite& sprite);
135135

136-
ImTextureID convertGLTextureHandleToImTextureID(GLuint glTextureHandle);
137-
GLuint convertImTextureIDToGLTextureHandle(ImTextureID textureID);
136+
[[nodiscard]] ImTextureID convertGLTextureHandleToImTextureID(GLuint glTextureHandle);
137+
[[nodiscard]] GLuint convertImTextureIDToGLTextureHandle(ImTextureID textureID);
138138

139139
void RenderDrawLists(ImDrawData* draw_data); // rendering callback function prototype
140140

141141
// Default mapping is XInput gamepad mapping
142142
void initDefaultJoystickMapping();
143143

144144
// Returns first id of connected joystick
145-
unsigned int getConnectedJoystickId();
145+
[[nodiscard]] unsigned int getConnectedJoystickId();
146146

147147
void updateJoystickButtonState(ImGuiIO& io);
148148
void updateJoystickDPadState(ImGuiIO& io);
149149
void updateJoystickAxisState(ImGuiIO& io);
150150

151151
// clipboard functions
152-
void setClipboardText(void* userData, const char* text);
153-
const char* getClipboardText(void* userData);
154-
std::string s_clipboardText;
152+
void setClipboardText(void* userData, const char* text);
153+
[[nodiscard]] const char* getClipboardText(void* userData);
154+
std::string s_clipboardText;
155155

156156
// mouse cursors
157157
void loadMouseCursor(ImGuiMouseCursor imguiCursorType, sf::Cursor::Type sfmlCursorType);
158158
void updateMouseCursor(sf::Window& window);
159159

160160
// Key mappings
161-
ImGuiKey keycodeToImGuiKey(sf::Keyboard::Key code);
162-
ImGuiKey keycodeToImGuiMod(sf::Keyboard::Key code);
161+
[[nodiscard]] ImGuiKey keycodeToImGuiKey(sf::Keyboard::Key code);
162+
[[nodiscard]] ImGuiKey keycodeToImGuiMod(sf::Keyboard::Key code);
163163

164164
// data
165165
constexpr unsigned int NULL_JOYSTICK_ID = sf::Joystick::Count;

0 commit comments

Comments
 (0)