Skip to content

Commit

Permalink
Use (void) for function prototypes with no parameters
Browse files Browse the repository at this point in the history
This is required when compiling these headers as C code. These were
omitted becuase before the addition of examples these headers were
only compiled locally as C++ files where adding the void keyword is
not needed.
  • Loading branch information
ChrisThrasher committed Dec 20, 2023
1 parent d4e85f9 commit e193712
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 16 deletions.
6 changes: 3 additions & 3 deletions include/SFML/Audio/Listener.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ CSFML_AUDIO_API void sfListener_setPosition(sfVector3f position);
/// \return The listener's position
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API sfVector3f sfListener_getPosition();
CSFML_AUDIO_API sfVector3f sfListener_getPosition(void);

////////////////////////////////////////////////////////////
/// \brief Set the orientation of the forward vector in the scene
Expand All @@ -91,7 +91,7 @@ CSFML_AUDIO_API void sfListener_setDirection(sfVector3f direction);
/// \return Listener's forward vector (not normalized)
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API sfVector3f sfListener_getDirection();
CSFML_AUDIO_API sfVector3f sfListener_getDirection(void);

////////////////////////////////////////////////////////////
/// \brief Set the upward vector of the listener in the scene
Expand All @@ -114,7 +114,7 @@ CSFML_AUDIO_API void sfListener_setUpVector(sfVector3f upVector);
/// \return Listener's upward vector (not normalized)
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API sfVector3f sfListener_getUpVector();
CSFML_AUDIO_API sfVector3f sfListener_getUpVector(void);


#endif // SFML_LISTENER_H
2 changes: 1 addition & 1 deletion include/SFML/Audio/SoundRecorder.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ CSFML_AUDIO_API const char** sfSoundRecorder_getAvailableDevices(size_t* count);
/// \return The name of the default audio capture device (null terminated)
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API const char* sfSoundRecorder_getDefaultDevice();
CSFML_AUDIO_API const char* sfSoundRecorder_getDefaultDevice(void);

////////////////////////////////////////////////////////////
/// \brief Set the audio capture device
Expand Down
2 changes: 1 addition & 1 deletion include/SFML/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
// ...
// };
//
// CSFML_DEPRECATED void globalFunc();
// CSFML_DEPRECATED void globalFunc(void);
////////////////////////////////////////////////////////////
#if defined(CSFML_NO_DEPRECATED_WARNINGS)

Expand Down
2 changes: 1 addition & 1 deletion include/SFML/Graphics/RenderStates.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,6 @@ typedef struct
/// \brief Define the default values for a RenderState
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfRenderStates sfRenderStates_default();
CSFML_GRAPHICS_API sfRenderStates sfRenderStates_default(void);

#endif // SFML_RENDERSTATES_H
2 changes: 1 addition & 1 deletion include/SFML/Graphics/RenderTexture.h
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ CSFML_GRAPHICS_API const sfTexture* sfRenderTexture_getTexture(const sfRenderTex
/// \return The maximum anti-aliasing level supported by the system
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API unsigned int sfRenderTexture_getMaximumAntialiasingLevel();
CSFML_GRAPHICS_API unsigned int sfRenderTexture_getMaximumAntialiasingLevel(void);

////////////////////////////////////////////////////////////
/// \brief Enable or disable the smooth filter on a render texture
Expand Down
2 changes: 1 addition & 1 deletion include/SFML/Graphics/Texture.h
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ CSFML_GRAPHICS_API void sfTexture_bind(const sfTexture* texture, sfTextureCoordi
/// \return Maximum size allowed for textures, in pixels
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API unsigned int sfTexture_getMaximumSize();
CSFML_GRAPHICS_API unsigned int sfTexture_getMaximumSize(void);


#endif // SFML_TEXTURE_H
2 changes: 1 addition & 1 deletion include/SFML/Graphics/VertexBuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ CSFML_GRAPHICS_API void sfVertexBuffer_bind(const sfVertexBuffer* vertexBuffer);
/// \return True if vertex buffers are supported, false otherwise
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfBool sfVertexBuffer_isAvailable();
CSFML_GRAPHICS_API sfBool sfVertexBuffer_isAvailable(void);


#endif // SFML_VERTEXBUFFER_H
2 changes: 1 addition & 1 deletion include/SFML/Network/UdpSocket.h
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ CSFML_NETWORK_API sfSocketStatus sfUdpSocket_receivePacket(sfUdpSocket* socket,
/// \return The maximum size of a UDP datagram (message)
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API unsigned int sfUdpSocket_maxDatagramSize();
CSFML_NETWORK_API unsigned int sfUdpSocket_maxDatagramSize(void);


#endif // SFML_UDPSOCKET_H
4 changes: 2 additions & 2 deletions include/SFML/Window/Clipboard.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
/// \return Clipboard contents as a locale-dependent ANSI string
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API const char* sfClipboard_getString();
CSFML_WINDOW_API const char* sfClipboard_getString(void);


////////////////////////////////////////////////////////////
Expand All @@ -55,7 +55,7 @@ CSFML_WINDOW_API const char* sfClipboard_getString();
/// \return Clipboard contents as UTF-32
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API const sfUint32* sfClipboard_getUnicodeString();
CSFML_WINDOW_API const sfUint32* sfClipboard_getUnicodeString(void);

////////////////////////////////////////////////////////////
/// \brief Set the content of the clipboard as ANSI string data
Expand Down
4 changes: 2 additions & 2 deletions include/SFML/Window/Context.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#include <SFML/Window/Types.h>
#include <SFML/Window/Window.h>

typedef void (*GlFunctionPointer)();
typedef void (*GlFunctionPointer)(void);

////////////////////////////////////////////////////////////
/// \brief Create a new context
Expand Down Expand Up @@ -104,6 +104,6 @@ CSFML_WINDOW_API sfContextSettings sfContext_getSettings(const sfContext* contex
/// \return The active context's ID or 0 if no context is currently active
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API sfUint64 sfContext_getActiveContextId();
CSFML_WINDOW_API sfUint64 sfContext_getActiveContextId(void);

#endif // SFML_CONTEXT_H
4 changes: 2 additions & 2 deletions include/SFML/Window/Vulkan.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ typedef uint64_t VkSurfaceKHR;
typedef struct VkAllocationCallbacks VkAllocationCallbacks;


typedef void (*sfVulkanFunctionPointer)();
typedef void (*sfVulkanFunctionPointer)(void);

////////////////////////////////////////////////////////////
/// \brief Tell whether or not the system supports Vulkan
Expand Down Expand Up @@ -79,4 +79,4 @@ CSFML_WINDOW_API sfVulkanFunctionPointer sfVulkan_getFunction(const char* name);
/// \return Vulkan instance extensions required for graphics
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API const char* const* sfVulkan_getGraphicsRequiredInstanceExtensions();
CSFML_WINDOW_API const char* const* sfVulkan_getGraphicsRequiredInstanceExtensions(void);

0 comments on commit e193712

Please sign in to comment.