Improve const correctness

This commit is contained in:
Chris Thrasher committed 2024-09-12 10:08:46 -06:00
1 parent 7f5807a6b5
commit 360268ea39
71 files changed
+82 -82

No files matched your search

+1 -1
View File
@@ -104,7 +104,7 @@ CSFML_AUDIO_API sfMusic* sfMusic_createFromStream(sfInputStream* stream);
/// \param music Music to destroy
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API void sfMusic_destroy(sfMusic* music);
CSFML_AUDIO_API void sfMusic_destroy(const sfMusic* music);
////////////////////////////////////////////////////////////
/// \brief Set whether or not a music should loop after reaching the end
+1 -1
View File
@@ -61,7 +61,7 @@ CSFML_AUDIO_API sfSound* sfSound_copy(const sfSound* sound);
/// \param sound Sound to destroy
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API void sfSound_destroy(sfSound* sound);
CSFML_AUDIO_API void sfSound_destroy(const sfSound* sound);
////////////////////////////////////////////////////////////
/// \brief Start or resume playing a sound
+1 -1
View File
@@ -120,7 +120,7 @@ CSFML_AUDIO_API sfSoundBuffer* sfSoundBuffer_copy(const sfSoundBuffer* soundBuff
/// \param soundBuffer Sound buffer to destroy
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API void sfSoundBuffer_destroy(sfSoundBuffer* soundBuffer);
CSFML_AUDIO_API void sfSoundBuffer_destroy(const sfSoundBuffer* soundBuffer);
////////////////////////////////////////////////////////////
/// \brief Save a sound buffer to an audio file
+1 -1
View File
@@ -46,7 +46,7 @@ CSFML_AUDIO_API sfSoundBufferRecorder* sfSoundBufferRecorder_create(void);
/// \param soundBufferRecorder Sound buffer recorder to destroy
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API void sfSoundBufferRecorder_destroy(sfSoundBufferRecorder* soundBufferRecorder);
CSFML_AUDIO_API void sfSoundBufferRecorder_destroy(const sfSoundBufferRecorder* soundBufferRecorder);
////////////////////////////////////////////////////////////
/// \brief Start the capture of a sound recorder recorder
+1 -1
View File
@@ -62,7 +62,7 @@ CSFML_AUDIO_API sfSoundRecorder* sfSoundRecorder_create(sfSoundRecorderStartCall
/// \param soundRecorder Sound recorder to destroy
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API void sfSoundRecorder_destroy(sfSoundRecorder* soundRecorder);
CSFML_AUDIO_API void sfSoundRecorder_destroy(const sfSoundRecorder* soundRecorder);
////////////////////////////////////////////////////////////
/// \brief Start the capture of a sound recorder
+1 -1
View File
@@ -81,7 +81,7 @@ CSFML_AUDIO_API sfSoundStream* sfSoundStream_create(
/// \param soundStream Sound stream to destroy
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API void sfSoundStream_destroy(sfSoundStream* soundStream);
CSFML_AUDIO_API void sfSoundStream_destroy(const sfSoundStream* soundStream);
////////////////////////////////////////////////////////////
/// \brief Start or resume playing a sound stream
+1 -1
View File
@@ -62,7 +62,7 @@ CSFML_GRAPHICS_API sfCircleShape* sfCircleShape_copy(const sfCircleShape* shape)
/// \param shape Shape to delete
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfCircleShape_destroy(sfCircleShape* shape);
CSFML_GRAPHICS_API void sfCircleShape_destroy(const sfCircleShape* shape);
////////////////////////////////////////////////////////////
/// \brief Set the position of a circle shape
+1 -1
View File
@@ -62,7 +62,7 @@ CSFML_GRAPHICS_API sfConvexShape* sfConvexShape_copy(const sfConvexShape* shape)
/// \param shape Shape to delete
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfConvexShape_destroy(sfConvexShape* shape);
CSFML_GRAPHICS_API void sfConvexShape_destroy(const sfConvexShape* shape);
////////////////////////////////////////////////////////////
/// \brief Set the position of a convex shape
+1 -1
View File
@@ -84,7 +84,7 @@ CSFML_GRAPHICS_API sfFont* sfFont_copy(const sfFont* font);
/// \param font Font to delete
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfFont_destroy(sfFont* font);
CSFML_GRAPHICS_API void sfFont_destroy(const sfFont* font);
////////////////////////////////////////////////////////////
/// \brief Get a glyph in a font
+1 -1
View File
@@ -140,7 +140,7 @@ CSFML_GRAPHICS_API sfImage* sfImage_copy(const sfImage* image);
/// \param image Image to delete
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfImage_destroy(sfImage* image);
CSFML_GRAPHICS_API void sfImage_destroy(const sfImage* image);
////////////////////////////////////////////////////////////
/// \brief Save an image to a file on disk
+1 -1
View File
@@ -62,7 +62,7 @@ CSFML_GRAPHICS_API sfRectangleShape* sfRectangleShape_copy(const sfRectangleShap
/// \param shape Shape to delete
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfRectangleShape_destroy(sfRectangleShape* shape);
CSFML_GRAPHICS_API void sfRectangleShape_destroy(const sfRectangleShape* shape);
////////////////////////////////////////////////////////////
/// \brief Set the position of a rectangle shape
+1 -1
View File
@@ -58,7 +58,7 @@ CSFML_GRAPHICS_API sfRenderTexture* sfRenderTexture_create(sfVector2u size, cons
/// \param renderTexture Render texture to destroy
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfRenderTexture_destroy(sfRenderTexture* renderTexture);
CSFML_GRAPHICS_API void sfRenderTexture_destroy(const sfRenderTexture* renderTexture);
////////////////////////////////////////////////////////////
/// \brief Get the size of the rendering region of a render texture
+1 -1
View File
@@ -93,7 +93,7 @@ CSFML_GRAPHICS_API sfRenderWindow* sfRenderWindow_createFromHandle(sfWindowHandl
/// \param renderWindow Render window to destroy
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfRenderWindow_destroy(sfRenderWindow* renderWindow);
CSFML_GRAPHICS_API void sfRenderWindow_destroy(const sfRenderWindow* renderWindow);
////////////////////////////////////////////////////////////
/// \brief Close a render window (but doesn't destroy the internal data)
+1 -1
View File
@@ -112,7 +112,7 @@ CSFML_GRAPHICS_API sfShader* sfShader_createFromStream(sfInputStream* vertexShad
/// \param shader Shader to delete
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfShader_destroy(sfShader* shader);
CSFML_GRAPHICS_API void sfShader_destroy(const sfShader* shader);
////////////////////////////////////////////////////////////
/// \brief Specify value for \p float uniform
+1 -1
View File
@@ -61,7 +61,7 @@ CSFML_GRAPHICS_API sfShape* sfShape_create(sfShapeGetPointCountCallback getPoint
/// \param shape Shape to delete
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfShape_destroy(sfShape* shape);
CSFML_GRAPHICS_API void sfShape_destroy(const sfShape* shape);
////////////////////////////////////////////////////////////
/// \brief Set the position of a shape
+1 -1
View File
@@ -63,7 +63,7 @@ CSFML_GRAPHICS_API sfSprite* sfSprite_copy(const sfSprite* sprite);
/// \param sprite Sprite to delete
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfSprite_destroy(sfSprite* sprite);
CSFML_GRAPHICS_API void sfSprite_destroy(const sfSprite* sprite);
////////////////////////////////////////////////////////////
/// \brief Set the position of a sprite
+1 -1
View File
@@ -77,7 +77,7 @@ CSFML_GRAPHICS_API sfText* sfText_copy(const sfText* text);
/// \param text Text to delete
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfText_destroy(sfText* text);
CSFML_GRAPHICS_API void sfText_destroy(const sfText* text);
////////////////////////////////////////////////////////////
/// \brief Set the position of a text
+1 -1
View File
@@ -175,7 +175,7 @@ CSFML_GRAPHICS_API sfTexture* sfTexture_copy(const sfTexture* texture);
/// \param texture Texture to delete
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfTexture_destroy(sfTexture* texture);
CSFML_GRAPHICS_API void sfTexture_destroy(const sfTexture* texture);
////////////////////////////////////////////////////////////
/// \brief Return the size of the texture
+1 -1
View File
@@ -58,7 +58,7 @@ CSFML_GRAPHICS_API sfTransformable* sfTransformable_copy(const sfTransformable*
/// \param transformable Transformable to delete
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfTransformable_destroy(sfTransformable* transformable);
CSFML_GRAPHICS_API void sfTransformable_destroy(const sfTransformable* transformable);
////////////////////////////////////////////////////////////
/// \brief Set the position of a transformable
+1 -1
View File
@@ -61,7 +61,7 @@ CSFML_GRAPHICS_API sfVertexArray* sfVertexArray_copy(const sfVertexArray* vertex
/// \param vertexArray Vertex array to delete
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfVertexArray_destroy(sfVertexArray* vertexArray);
CSFML_GRAPHICS_API void sfVertexArray_destroy(const sfVertexArray* vertexArray);
////////////////////////////////////////////////////////////
/// \brief Return the vertex count of a vertex array
+1 -1
View File
@@ -87,7 +87,7 @@ CSFML_GRAPHICS_API sfVertexBuffer* sfVertexBuffer_copy(const sfVertexBuffer* ver
/// \param vertexBuffer Vertex buffer to delete
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfVertexBuffer_destroy(sfVertexBuffer* vertexBuffer);
CSFML_GRAPHICS_API void sfVertexBuffer_destroy(const sfVertexBuffer* vertexBuffer);
////////////////////////////////////////////////////////////
/// \brief Return the vertex count
+1 -1
View File
@@ -70,7 +70,7 @@ CSFML_GRAPHICS_API sfView* sfView_copy(const sfView* view);
/// \param view View to destroy
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API void sfView_destroy(sfView* view);
CSFML_GRAPHICS_API void sfView_destroy(const sfView* view);
////////////////////////////////////////////////////////////
/// \brief Set the center of a view
+4 -4
View File
@@ -120,7 +120,7 @@ typedef enum
/// \param ftpListingResponse Ftp listing response to destroy
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API void sfFtpListingResponse_destroy(sfFtpListingResponse* ftpListingResponse);
CSFML_NETWORK_API void sfFtpListingResponse_destroy(const sfFtpListingResponse* ftpListingResponse);
////////////////////////////////////////////////////////////
/// \brief Check if a FTP listing response status code means a success
@@ -182,7 +182,7 @@ CSFML_NETWORK_API const char* sfFtpListingResponse_getName(const sfFtpListingRes
/// \param ftpDirectoryResponse Ftp directory response to destroy
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API void sfFtpDirectoryResponse_destroy(sfFtpDirectoryResponse* ftpDirectoryResponse);
CSFML_NETWORK_API void sfFtpDirectoryResponse_destroy(const sfFtpDirectoryResponse* ftpDirectoryResponse);
////////////////////////////////////////////////////////////
/// \brief Check if a FTP directory response status code means a success
@@ -251,7 +251,7 @@ CSFML_NETWORK_API const sfChar32* sfFtpDirectoryResponse_getDirectoryUnicode(con
/// \param ftpResponse Ftp response to destroy
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API void sfFtpResponse_destroy(sfFtpResponse* ftpResponse);
CSFML_NETWORK_API void sfFtpResponse_destroy(const sfFtpResponse* ftpResponse);
////////////////////////////////////////////////////////////
/// \brief Check if a FTP response status code means a success
@@ -300,7 +300,7 @@ CSFML_NETWORK_API sfFtp* sfFtp_create(void);
/// \param ftp Ftp object to destroy
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API void sfFtp_destroy(sfFtp* ftp);
CSFML_NETWORK_API void sfFtp_destroy(const sfFtp* ftp);
////////////////////////////////////////////////////////////
/// \brief Connect to the specified FTP server
+3 -3
View File
@@ -102,7 +102,7 @@ CSFML_NETWORK_API sfHttpRequest* sfHttpRequest_create(void);
/// \param httpRequest HTTP request to destroy
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API void sfHttpRequest_destroy(sfHttpRequest* httpRequest);
CSFML_NETWORK_API void sfHttpRequest_destroy(const sfHttpRequest* httpRequest);
////////////////////////////////////////////////////////////
/// \brief Set the value of a header field of a HTTP request
@@ -177,7 +177,7 @@ CSFML_NETWORK_API void sfHttpRequest_setBody(sfHttpRequest* httpRequest, const c
/// \param httpResponse HTTP response to destroy
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API void sfHttpResponse_destroy(sfHttpResponse* httpResponse);
CSFML_NETWORK_API void sfHttpResponse_destroy(const sfHttpResponse* httpResponse);
////////////////////////////////////////////////////////////
/// \brief Get the value of a field of a HTTP response
@@ -259,7 +259,7 @@ CSFML_NETWORK_API sfHttp* sfHttp_create(void);
/// \param http Http object to destroy
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API void sfHttp_destroy(sfHttp* http);
CSFML_NETWORK_API void sfHttp_destroy(const sfHttp* http);
////////////////////////////////////////////////////////////
/// \brief Set the target host of a HTTP object
+1 -1
View File
@@ -58,7 +58,7 @@ CSFML_NETWORK_API sfPacket* sfPacket_copy(const sfPacket* packet);
/// \param packet Packet to destroy
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API void sfPacket_destroy(sfPacket* packet);
CSFML_NETWORK_API void sfPacket_destroy(const sfPacket* packet);
////////////////////////////////////////////////////////////
/// \brief Append data to the end of a packet
+1 -1
View File
@@ -57,7 +57,7 @@ CSFML_NETWORK_API sfSocketSelector* sfSocketSelector_copy(const sfSocketSelector
/// \param selector Socket selector to destroy
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API void sfSocketSelector_destroy(sfSocketSelector* selector);
CSFML_NETWORK_API void sfSocketSelector_destroy(const sfSocketSelector* selector);
////////////////////////////////////////////////////////////
/// \brief Add a new socket to a socket selector
+1 -1
View File
@@ -48,7 +48,7 @@ CSFML_NETWORK_API sfTcpListener* sfTcpListener_create(void);
/// \param listener TCP listener to destroy
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API void sfTcpListener_destroy(sfTcpListener* listener);
CSFML_NETWORK_API void sfTcpListener_destroy(const sfTcpListener* listener);
////////////////////////////////////////////////////////////
/// \brief Set the blocking state of a TCP listener
+1 -1
View File
@@ -51,7 +51,7 @@ CSFML_NETWORK_API sfTcpSocket* sfTcpSocket_create(void);
/// \param socket TCP socket to destroy
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API void sfTcpSocket_destroy(sfTcpSocket* socket);
CSFML_NETWORK_API void sfTcpSocket_destroy(const sfTcpSocket* socket);
////////////////////////////////////////////////////////////
/// \brief Set the blocking state of a TCP listener
+1 -1
View File
@@ -50,7 +50,7 @@ CSFML_NETWORK_API sfUdpSocket* sfUdpSocket_create(void);
/// \param socket UDP socket to destroy
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API void sfUdpSocket_destroy(sfUdpSocket* socket);
CSFML_NETWORK_API void sfUdpSocket_destroy(const sfUdpSocket* socket);
////////////////////////////////////////////////////////////
/// \brief Set the blocking state of a UDP listener
+1 -1
View File
@@ -48,7 +48,7 @@ CSFML_SYSTEM_API sfBuffer* sfBuffer_create(void);
/// \param buffer Buffer to delete
///
////////////////////////////////////////////////////////////
CSFML_SYSTEM_API void sfBuffer_destroy(sfBuffer* buffer);
CSFML_SYSTEM_API void sfBuffer_destroy(const sfBuffer* buffer);
////////////////////////////////////////////////////////////
/// \brief Return the size of a buffer
+1 -1
View File
@@ -57,7 +57,7 @@ CSFML_SYSTEM_API sfClock* sfClock_copy(const sfClock* clock);
/// \param clock Clock to destroy
///
////////////////////////////////////////////////////////////
CSFML_SYSTEM_API void sfClock_destroy(sfClock* clock);
CSFML_SYSTEM_API void sfClock_destroy(const sfClock* clock);
////////////////////////////////////////////////////////////
/// \brief Get the time elapsed in a clock
+1 -1
View File
@@ -50,7 +50,7 @@ CSFML_WINDOW_API sfContext* sfContext_create(void);
/// \param context Context to destroy
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API void sfContext_destroy(sfContext* context);
CSFML_WINDOW_API void sfContext_destroy(const sfContext* context);
////////////////////////////////////////////////////////////
/// \brief Check whether a given OpenGL extension is available.
+1 -1
View File
@@ -141,4 +141,4 @@ CSFML_WINDOW_API sfCursor* sfCursor_createFromSystem(sfCursorType type);
/// \param cursor Cursor to destroy
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API void sfCursor_destroy(sfCursor* cursor);
CSFML_WINDOW_API void sfCursor_destroy(const sfCursor* cursor);
+1 -1
View File
@@ -146,7 +146,7 @@ CSFML_WINDOW_API sfWindow* sfWindow_createFromHandle(sfWindowHandle handle, cons
/// \param window Window to destroy
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API void sfWindow_destroy(sfWindow* window);
CSFML_WINDOW_API void sfWindow_destroy(const sfWindow* window);
////////////////////////////////////////////////////////////
/// \brief Close a window and destroy all the attached resources
+1 -1
View File
@@ -117,7 +117,7 @@ CSFML_WINDOW_API sfWindowBase* sfWindowBase_createFromHandle(sfWindowHandle hand
/// \param windowBase Window to destroy
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API void sfWindowBase_destroy(sfWindowBase* windowBase);
CSFML_WINDOW_API void sfWindowBase_destroy(const sfWindowBase* windowBase);
////////////////////////////////////////////////////////////
/// \brief Close a window and destroy all the attached resources