|
From: <bul...@us...> - 2013-05-17 20:26:07
|
Revision: 22762
http://sourceforge.net/p/bzflag/code/22762
Author: bullet_catcher
Date: 2013-05-17 20:26:04 +0000 (Fri, 17 May 2013)
Log Message:
-----------
Preserve const quality in some miscellaneous easy cases.
Modified Paths:
--------------
trunk/bzflag/src/bzfs/EntryZones.cxx
trunk/bzflag/src/bzfs/bzfs.cxx
trunk/bzflag/src/bzfs/bzfsHTTPAPI.cxx
trunk/bzflag/src/game/MsgStrings.cxx
Modified: trunk/bzflag/src/bzfs/EntryZones.cxx
===================================================================
--- trunk/bzflag/src/bzfs/EntryZones.cxx 2013-05-17 16:24:26 UTC (rev 22761)
+++ trunk/bzflag/src/bzfs/EntryZones.cxx 2013-05-17 20:26:04 UTC (rev 22762)
@@ -201,7 +201,7 @@
return false;
}
- CustomZone *zone = ((CustomZone *) &zones[closest]);
+ const CustomZone *zone = &zones[closest];
zone->getRandomPoint(pt);
return true;
Modified: trunk/bzflag/src/bzfs/bzfs.cxx
===================================================================
--- trunk/bzflag/src/bzfs/bzfs.cxx 2013-05-17 16:24:26 UTC (rev 22761)
+++ trunk/bzflag/src/bzfs/bzfs.cxx 2013-05-17 20:26:04 UTC (rev 22762)
@@ -949,7 +949,7 @@
static void relayPlayerPacket(int index, uint16_t len, const void *rawbuf, uint16_t code)
{
if (Record::enabled()) {
- Record::addPacket(code, len, (char*)rawbuf + 4);
+ Record::addPacket(code, len, (const char*)rawbuf + 4);
}
// relay packet to all players except origin
Modified: trunk/bzflag/src/bzfs/bzfsHTTPAPI.cxx
===================================================================
--- trunk/bzflag/src/bzfs/bzfsHTTPAPI.cxx 2013-05-17 16:24:26 UTC (rev 22761)
+++ trunk/bzflag/src/bzfs/bzfsHTTPAPI.cxx 2013-05-17 20:26:04 UTC (rev 22762)
@@ -492,7 +492,7 @@
RESPONSE_DATA(data);
if (v && size)
- data->Body += std::string((char*)v,size);
+ data->Body += std::string((const char*)v,size);
}
//---- Request----
Modified: trunk/bzflag/src/game/MsgStrings.cxx
===================================================================
--- trunk/bzflag/src/game/MsgStrings.cxx 2013-05-17 16:24:26 UTC (rev 22761)
+++ trunk/bzflag/src/game/MsgStrings.cxx 2013-05-17 20:26:04 UTC (rev 22762)
@@ -62,7 +62,7 @@
static std::string strFlagStatus (FlagStatus status);
static std::string strTeam (u16 id);
static std::string strPlayer (u16 id);
-static std::string strVector (float *vector);
+static std::string strVector (const float *vector);
static std::string strKillReason (int16_t reason);
static std::string strAddress (Address& address);
@@ -417,7 +417,7 @@
}
-static std::string strVector (float *vector)
+static std::string strVector (const float *vector)
{
std::string str = TextUtils::format ("(%8.3f, %8.3f, %8.3f)",
vector[0], vector[1], vector[2]);
@@ -893,8 +893,8 @@
listPush (list, 1, "type: %.2s", finfo.flagType->flagAbbv.c_str()); // FIXME ?
listPush (list, 2, "id: %i", shot.id);
listPush (list, 2, "team: %s", strTeam(shot.team).c_str());
- listPush (list, 2, "pos: %s", strVector((float*)shot.pos).c_str());
- listPush (list, 2, "vel: %s", strVector((float*)shot.vel).c_str());
+ listPush (list, 2, "pos: %s", strVector(shot.pos).c_str());
+ listPush (list, 2, "vel: %s", strVector(shot.vel).c_str());
listPush (list, 2, "lifetime: %-8.3f", finfo.lifetime);
return list;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|