Skip to content

Commit

Permalink
Replaced char* arguments for raw data with void*
Browse files Browse the repository at this point in the history
  • Loading branch information
LaurentGomila committed Apr 3, 2012
1 parent 9554c00 commit ad035ec
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion include/SFML/Network/Packet.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ CSFML_NETWORK_API void sfPacket_clear(sfPacket* packet);
/// \return Pointer to the data
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API const char* sfPacket_getData(const sfPacket* packet);
CSFML_NETWORK_API const void* sfPacket_getData(const sfPacket* packet);

////////////////////////////////////////////////////////////
/// \brief Get the size of the data contained in a packet
Expand Down
4 changes: 2 additions & 2 deletions include/SFML/Network/TcpSocket.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ CSFML_NETWORK_API void sfTcpSocket_disconnect(sfTcpSocket* socket);
/// \return Status code
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfSocketStatus sfTcpSocket_send(sfTcpSocket* socket, const char* data, size_t size);
CSFML_NETWORK_API sfSocketStatus sfTcpSocket_send(sfTcpSocket* socket, const void* data, size_t size);

////////////////////////////////////////////////////////////
/// \brief Receive raw data from the remote peer of a TCP socket
Expand All @@ -176,7 +176,7 @@ CSFML_NETWORK_API sfSocketStatus sfTcpSocket_send(sfTcpSocket* socket, const cha
/// \return Status code
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfSocketStatus sfTcpSocket_receive(sfTcpSocket* socket, char* data, size_t maxSize, size_t* sizeReceived);
CSFML_NETWORK_API sfSocketStatus sfTcpSocket_receive(sfTcpSocket* socket, void* data, size_t maxSize, size_t* sizeReceived);

////////////////////////////////////////////////////////////
/// \brief Send a formatted packet of data to the remote peer of a TCP socket
Expand Down
4 changes: 2 additions & 2 deletions include/SFML/Network/UdpSocket.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ CSFML_NETWORK_API void sfUdpSocket_Unbind(sfUdpSocket* socket);
/// \return Status code
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfSocketStatus sfUdpSocket_send(sfUdpSocket* socket, const char* data, size_t size, sfIpAddress address, unsigned short port);
CSFML_NETWORK_API sfSocketStatus sfUdpSocket_send(sfUdpSocket* socket, const void* data, size_t size, sfIpAddress address, unsigned short port);

////////////////////////////////////////////////////////////
/// \brief Receive raw data from a remote peer with a UDP socket
Expand All @@ -159,7 +159,7 @@ CSFML_NETWORK_API sfSocketStatus sfUdpSocket_send(sfUdpSocket* socket, const cha
/// \return Status code
///
////////////////////////////////////////////////////////////
CSFML_NETWORK_API sfSocketStatus sfUdpSocket_receive(sfUdpSocket* socket, char* data, size_t maxSize, size_t* sizeReceived, sfIpAddress* address, unsigned short* port);
CSFML_NETWORK_API sfSocketStatus sfUdpSocket_receive(sfUdpSocket* socket, void* data, size_t maxSize, size_t* sizeReceived, sfIpAddress* address, unsigned short* port);

////////////////////////////////////////////////////////////
/// \brief Send a formatted packet of data to a remote peer with a UDP socket
Expand Down
2 changes: 1 addition & 1 deletion include/SFML/System/InputStream.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include <SFML/System/Export.h>


typedef sfInt64 (*sfInputStreamReadFunc)(char* data, sfInt64 size, void* userData);
typedef sfInt64 (*sfInputStreamReadFunc)(void* data, sfInt64 size, void* userData);
typedef sfInt64 (*sfInputStreamSeekFunc)(sfInt64 position, void* userData);
typedef sfInt64 (*sfInputStreamTellFunc)(void* userData);
typedef sfInt64 (*sfInputStreamGetSizeFunc)(void* userData);
Expand Down
2 changes: 1 addition & 1 deletion src/SFML/CallbackStream.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class CallbackStream : public sf::InputStream
/// \return The number of bytes actually read
///
////////////////////////////////////////////////////////////
virtual sf::Int64 read(char* data, sf::Int64 size)
virtual sf::Int64 read(void* data, sf::Int64 size)
{
return myStream.read ? myStream.read(data, size, myStream.userData) : -1;
}
Expand Down
2 changes: 1 addition & 1 deletion src/SFML/Network/Packet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ void sfPacket_clear(sfPacket* packet)


////////////////////////////////////////////////////////////
const char* sfPacket_getData(const sfPacket* packet)
const void* sfPacket_getData(const sfPacket* packet)
{
CSFML_CALL_RETURN(packet, getData(), NULL);
}
Expand Down
4 changes: 2 additions & 2 deletions src/SFML/Network/TcpSocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ void sfTcpSocket_disconnect(sfTcpSocket* socket)


////////////////////////////////////////////////////////////
sfSocketStatus sfTcpSocket_send(sfTcpSocket* socket, const char* data, size_t size)
sfSocketStatus sfTcpSocket_send(sfTcpSocket* socket, const void* data, size_t size)
{
CSFML_CHECK_RETURN(socket, sfSocketError);

Expand All @@ -116,7 +116,7 @@ sfSocketStatus sfTcpSocket_send(sfTcpSocket* socket, const char* data, size_t si


////////////////////////////////////////////////////////////
sfSocketStatus sfTcpSocket_receive(sfTcpSocket* socket, char* data, size_t maxSize, size_t* sizeReceived)
sfSocketStatus sfTcpSocket_receive(sfTcpSocket* socket, void* data, size_t maxSize, size_t* sizeReceived)
{
CSFML_CHECK_RETURN(socket, sfSocketError);

Expand Down
4 changes: 2 additions & 2 deletions src/SFML/Network/UdpSocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ void sfUdpSocket_unbind(sfUdpSocket* socket)


////////////////////////////////////////////////////////////
sfSocketStatus sfUdpSocket_send(sfUdpSocket* socket, const char* data, size_t size, sfIpAddress address, unsigned short port)
sfSocketStatus sfUdpSocket_send(sfUdpSocket* socket, const void* data, size_t size, sfIpAddress address, unsigned short port)
{
CSFML_CHECK_RETURN(socket, sfSocketError);

Expand All @@ -96,7 +96,7 @@ sfSocketStatus sfUdpSocket_send(sfUdpSocket* socket, const char* data, size_t si


////////////////////////////////////////////////////////////
sfSocketStatus sfUdpSocket_receive(sfUdpSocket* socket, char* data, size_t maxSize, size_t* sizeReceived, sfIpAddress* address, unsigned short* port)
sfSocketStatus sfUdpSocket_receive(sfUdpSocket* socket, void* data, size_t maxSize, size_t* sizeReceived, sfIpAddress* address, unsigned short* port)
{
CSFML_CHECK_RETURN(socket, sfSocketError);

Expand Down

0 comments on commit ad035ec

Please sign in to comment.