From c49e30bd3971f35e5581ef42e07d4948f86a1ad7 Mon Sep 17 00:00:00 2001 From: Lee Salzman Date: Sun, 5 Nov 2006 18:44:19 +0000 Subject: [PATCH] *** empty log message *** git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@474 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/bot/bot.cpp | 2 +- source/src/client.cpp | 2 +- source/src/clientextras.cpp | 2 +- source/src/console.cpp | 4 ++-- source/src/serverbrowser.cpp | 2 +- source/src/serverms.cpp | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/source/src/bot/bot.cpp b/source/src/bot/bot.cpp index 88af1361..c0400e52 100644 --- a/source/src/bot/bot.cpp +++ b/source/src/bot/bot.cpp @@ -310,7 +310,7 @@ void CBot::SendBotInfo() ((editmode ? CS_EDITING : m_pMyEnt->state)<<5); - ENetPacket *packet = enet_packet_create (NULL, MAXTRANS, 0); + ENetPacket *packet = enet_packet_create(NULL, MAXTRANS, 0); ucharbuf p(packet->data, packet->dataLength); putint(p, SV_BOTUPDATE); diff --git a/source/src/client.cpp b/source/src/client.cpp index e2f8f6ed..e70e5821 100644 --- a/source/src/client.cpp +++ b/source/src/client.cpp @@ -222,7 +222,7 @@ void c2sinfo(dynent *d) // send update to the server if(clientnum<0) return; // we haven't had a welcome message from the server yet if(lastmillis-lastupdate<40) return; // don't update faster than 25fps ENetPacket *packet = enet_packet_create (NULL, MAXTRANS, 0); - ucharbuf p(packet->data, MAXTRANS); + ucharbuf p(packet->data, packet->dataLength); bool serveriteminitdone = false; if(toserverpwd) { diff --git a/source/src/clientextras.cpp b/source/src/clientextras.cpp index 1aa7dfb0..5d8403b2 100644 --- a/source/src/clientextras.cpp +++ b/source/src/clientextras.cpp @@ -201,7 +201,7 @@ void sendmap(char *mapname) void getmap() { ENetPacket *packet = enet_packet_create(NULL, MAXTRANS, ENET_PACKET_FLAG_RELIABLE); - ucharbuf p(packet->data, MAXTRANS); + ucharbuf p(packet->data, packet->dataLength); putint(p, SV_RECVMAP); enet_packet_resize(packet, p.length()); sendpackettoserv(packet); diff --git a/source/src/console.cpp b/source/src/console.cpp index ddc32ed1..9eb98904 100644 --- a/source/src/console.cpp +++ b/source/src/console.cpp @@ -112,7 +112,7 @@ void mapmsg(char *s) { s_strncpy(hdr.maptitle, s, 128); }; COMMAND(saycommand, ARG_VARI); COMMAND(mapmsg, ARG_1STR); -#ifndef WIN32 +#if !defined(WIN32) && !defined(__APPLE__) #include #include #endif @@ -126,7 +126,7 @@ void pasteconsole() s_strcat(commandbuf, cb); GlobalUnlock(cb); CloseClipboard(); - #else + #elif !defined(__APPLE__) SDL_SysWMinfo wminfo; SDL_VERSION(&wminfo.version); wminfo.subsystem = SDL_SYSWM_X11; diff --git a/source/src/serverbrowser.cpp b/source/src/serverbrowser.cpp index 8d4b160a..bfb88d28 100644 --- a/source/src/serverbrowser.cpp +++ b/source/src/serverbrowser.cpp @@ -228,7 +228,7 @@ void pingservers() { serverinfo &si = servers[i]; if(si.address.host == ENET_HOST_ANY) continue; - ucharbuf p(ping, MAXTRANS); + ucharbuf p(ping, sizeof(ping)); putint(p, lastmillis); buf.data = ping; buf.dataLength = p.length(); diff --git a/source/src/serverms.cpp b/source/src/serverms.cpp index 721e2d03..fa538542 100644 --- a/source/src/serverms.cpp +++ b/source/src/serverms.cpp @@ -109,7 +109,7 @@ void serverms(int mode, int numplayers, int minremain, char *smapname, int secon buf.dataLength = sizeof(pong); len = enet_socket_receive(pongsock, &addr, &buf, 1); if(len < 0) return; - ucharbuf p(&pong[len], MAXTRANS-len); + ucharbuf p(&pong[len], sizeof(pong)-len); putint(p, PROTOCOL_VERSION); putint(p, mode); putint(p, numplayers);