Even more conversion, lots of superfluous macro removal

This commit is contained in:
iikorni
2026-08-29 23:14:23 -05:00
parent 70e5c02355
commit de75b014b3
102 changed files with 7060 additions and 8179 deletions
+17 -15
View File
@@ -26,7 +26,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "net_defs.hpp"
#include "net_loop.hpp"
static qboolean localconnectpending = false;
#include <cstring>
static bool localconnectpending = false;
static qsocket_t *loop_client = NULL;
static qsocket_t *loop_server = NULL;
@@ -43,32 +45,32 @@ void Loop_Shutdown (void)
}
void Loop_Listen (qboolean state)
void Loop_Listen (bool state)
{
}
void Loop_SearchForHosts (qboolean xmit)
void Loop_SearchForHosts (bool xmit)
{
if (!sv.active)
return;
hostCacheCount = 1;
if (Q_strcmp(hostname.string, "UNNAMED") == 0)
Q_strcpy(hostcache[0].name, "local");
if (std::strcmp(hostname.string, "UNNAMED") == 0)
std::strcpy(hostcache[0].name, "local");
else
Q_strcpy(hostcache[0].name, hostname.string);
Q_strcpy(hostcache[0].map, sv.name);
std::strcpy(hostcache[0].name, hostname.string);
std::strcpy(hostcache[0].map, sv.name);
hostcache[0].users = net_activeconnections;
hostcache[0].maxusers = svs.maxclients;
hostcache[0].driver = net_driverlevel;
Q_strcpy(hostcache[0].cname, "local");
std::strcpy(hostcache[0].cname, "local");
}
qsocket_t *Loop_Connect (const char *host)
{
if (Q_strcmp(host,"local") != 0)
if (std::strcmp(host,"local") != 0)
return NULL;
localconnectpending = true;
@@ -80,7 +82,7 @@ qsocket_t *Loop_Connect (const char *host)
Con_Printf("Loop_Connect: no qsocket available\n");
return NULL;
}
Q_strcpy (loop_client->address, "localhost");
std::strcpy (loop_client->address, "localhost");
}
loop_client->receiveMessageLength = 0;
loop_client->sendMessageLength = 0;
@@ -93,7 +95,7 @@ qsocket_t *Loop_Connect (const char *host)
Con_Printf("Loop_Connect: no qsocket available\n");
return NULL;
}
Q_strcpy (loop_server->address, "LOCAL");
std::strcpy (loop_server->address, "LOCAL");
}
loop_server->receiveMessageLength = 0;
loop_server->sendMessageLength = 0;
@@ -181,7 +183,7 @@ int Loop_SendMessage (qsocket_t *sock, sizebuf_t *data)
buffer++;
// message
Q_memcpy(buffer, data->data, data->cursize);
std::memcpy(buffer, data->data, data->cursize);
*bufferLength = IntAlign(*bufferLength + data->cursize + 4);
sock->canSend = false;
@@ -215,13 +217,13 @@ int Loop_SendUnreliableMessage (qsocket_t *sock, sizebuf_t *data)
buffer++;
// message
Q_memcpy(buffer, data->data, data->cursize);
std::memcpy(buffer, data->data, data->cursize);
*bufferLength = IntAlign(*bufferLength + data->cursize + 4);
return 1;
}
qboolean Loop_CanSendMessage (qsocket_t *sock)
bool Loop_CanSendMessage (qsocket_t *sock)
{
if (!sock->driverdata)
return false;
@@ -229,7 +231,7 @@ qboolean Loop_CanSendMessage (qsocket_t *sock)
}
qboolean Loop_CanSendUnreliableMessage (qsocket_t *sock)
bool Loop_CanSendUnreliableMessage (qsocket_t *sock)
{
return true;
}