Skip to content

Commit

Permalink
rename unuseable template functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Jnnshschl committed Jul 29, 2021
1 parent 6ac9d77 commit 16a7442
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions AnTCP.Server.Sample/src/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,19 @@ int __stdcall SigIntHandler(unsigned long signal)
void AddCallback(ClientHandler* handler, char type, const void* data, int size)
{
int c = ((int*)data)[0] + ((int*)data)[1];
handler->SendData(type, c);
handler->SendDataVar(type, c);
}

void SubtractCallback(ClientHandler* handler, char type, const void* data, int size)
{
int c = ((int*)data)[0] - ((int*)data)[1];
handler->SendData(type, c);
handler->SendDataVar(type, c);
}

void MultiplyCallback(ClientHandler* handler, char type, const void* data, int size)
{
int c = ((int*)data)[0] * ((int*)data)[1];
handler->SendData(type, c);
handler->SendDataVar(type, c);
}

void MinAvgMaxCallback(ClientHandler* handler, char type, const void* data, int size)
Expand Down
4 changes: 2 additions & 2 deletions AnTCP.Server/src/AnTcpServer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ class ClientHandler
/// <param name="data">Data to send.</param>
/// <returns>True if data was sent, false if not.</returns>
template<typename T>
constexpr bool SendData(AnTcpMessageType type, const T data) const noexcept
constexpr bool SendDataVar(AnTcpMessageType type, const T data) const noexcept
{
return SendData(type, &data, sizeof(T));
}
Expand All @@ -122,7 +122,7 @@ class ClientHandler
/// <param name="data">Data to send.</param>
/// <returns>True if data was sent, false if not.</returns>
template<typename T>
constexpr bool SendData(AnTcpMessageType type, const T* data) const noexcept
constexpr bool SendDataPtr(AnTcpMessageType type, const T* data) const noexcept
{
return SendData(type, data, sizeof(T));
}
Expand Down

0 comments on commit 16a7442

Please sign in to comment.