|
From: <bul...@us...> - 2013-05-28 16:35:24
|
Revision: 22776
http://sourceforge.net/p/bzflag/code/22776
Author: bullet_catcher
Date: 2013-05-28 16:35:21 +0000 (Tue, 28 May 2013)
Log Message:
-----------
Use const_cast to suppress the last few "casts away qualifiers" warnings from g++ -Wcast-qual.
Modified Paths:
--------------
trunk/bzflag/src/bzflag/ServerStartMenu.cxx
trunk/bzflag/src/bzfs/CustomMesh.cxx
trunk/bzflag/src/obstacle/ArcObstacle.cxx
trunk/bzflag/src/obstacle/ConeObstacle.cxx
trunk/bzflag/src/obstacle/SphereObstacle.cxx
trunk/bzflag/src/obstacle/TetraBuilding.cxx
trunk/bzflag/src/platform/SDLDisplay.cxx
Modified: trunk/bzflag/src/bzflag/ServerStartMenu.cxx
===================================================================
--- trunk/bzflag/src/bzflag/ServerStartMenu.cxx 2013-05-28 06:16:49 UTC (rev 22775)
+++ trunk/bzflag/src/bzflag/ServerStartMenu.cxx 2013-05-28 16:35:21 UTC (rev 22776)
@@ -489,7 +489,7 @@
#if defined(_WIN32)
// Windows
- int result = _spawnvp(_P_DETACH, serverCmd, (char* const*) args);
+ int result = _spawnvp(_P_DETACH, serverCmd, const_cast<char* const*>(args));
if (result < 0) {
if (errno == ENOENT)
setStatus("Failed... can't find server program.");
@@ -541,10 +541,10 @@
close(2);
// exec server
- execvp(serverCmd, (char* const*)args);
+ execvp(serverCmd, const_cast<char* const*>(args));
// If execvp returns, bzfs wasnt at the anticipated location.
// Let execvp try to find it in $PATH by feeding it the "bzfs" name by it self
- execvp(serverApp, (char* const*)args);
+ execvp(serverApp, const_cast<char* const*>(args));
// If that returns too, something bad has happened. Exit.
exit(2);
}
Modified: trunk/bzflag/src/bzfs/CustomMesh.cxx
===================================================================
--- trunk/bzflag/src/bzfs/CustomMesh.cxx 2013-05-28 06:16:49 UTC (rev 22775)
+++ trunk/bzflag/src/bzfs/CustomMesh.cxx 2013-05-28 16:35:21 UTC (rev 22776)
@@ -207,7 +207,7 @@
} else {
vert[0] = vert[1] = vert[2] = 0.0f;
}
- ((std::vector<cfvec3>*)&vertices)->push_back(vert);
+ const_cast<std::vector<cfvec3>*>(&vertices)->push_back(vert);
}
MeshObstacle* mesh =
Modified: trunk/bzflag/src/obstacle/ArcObstacle.cxx
===================================================================
--- trunk/bzflag/src/obstacle/ArcObstacle.cxx 2013-05-28 06:16:49 UTC (rev 22775)
+++ trunk/bzflag/src/obstacle/ArcObstacle.cxx 2013-05-28 16:35:21 UTC (rev 22776)
@@ -79,7 +79,7 @@
ArcObstacle* copy =
new ArcObstacle(tmpXform, pos, size, angle, sweepAngle, ratio,
texsize, useNormals, divisions,
- (const BzMaterial**)materials, phydrv,
+ const_cast<const BzMaterial**>(materials), phydrv,
smoothBounce, driveThrough, shootThrough, ricochet);
return copy;
}
Modified: trunk/bzflag/src/obstacle/ConeObstacle.cxx
===================================================================
--- trunk/bzflag/src/obstacle/ConeObstacle.cxx 2013-05-28 06:16:49 UTC (rev 22775)
+++ trunk/bzflag/src/obstacle/ConeObstacle.cxx 2013-05-28 16:35:21 UTC (rev 22776)
@@ -78,7 +78,7 @@
ConeObstacle* copy =
new ConeObstacle(tmpXform, pos, size, angle, sweepAngle,
texsize, useNormals, divisions,
- (const BzMaterial**)materials, phydrv,
+ const_cast<const BzMaterial**>(materials), phydrv,
smoothBounce, driveThrough, shootThrough, ricochet);
return copy;
}
Modified: trunk/bzflag/src/obstacle/SphereObstacle.cxx
===================================================================
--- trunk/bzflag/src/obstacle/SphereObstacle.cxx 2013-05-28 06:16:49 UTC (rev 22775)
+++ trunk/bzflag/src/obstacle/SphereObstacle.cxx 2013-05-28 16:35:21 UTC (rev 22776)
@@ -77,7 +77,7 @@
SphereObstacle* copy =
new SphereObstacle(tmpXform, pos, size, angle, texsize, useNormals,
- hemisphere, divisions, (const BzMaterial**)materials,
+ hemisphere, divisions, const_cast<const BzMaterial**>(materials),
phydrv, smoothBounce, driveThrough, shootThrough, ricochet);
return copy;
}
Modified: trunk/bzflag/src/obstacle/TetraBuilding.cxx
===================================================================
--- trunk/bzflag/src/obstacle/TetraBuilding.cxx 2013-05-28 06:16:49 UTC (rev 22775)
+++ trunk/bzflag/src/obstacle/TetraBuilding.cxx 2013-05-28 16:35:21 UTC (rev 22776)
@@ -79,7 +79,7 @@
TetraBuilding* copy =
new TetraBuilding(tmpXform, vertices, normals, texcoords,
- useNormals, useTexcoords, (const BzMaterial**)materials,
+ useNormals, useTexcoords, const_cast<const BzMaterial**>(materials),
driveThrough, shootThrough, ricochet);
return copy;
}
Modified: trunk/bzflag/src/platform/SDLDisplay.cxx
===================================================================
--- trunk/bzflag/src/platform/SDLDisplay.cxx 2013-05-28 06:16:49 UTC (rev 22775)
+++ trunk/bzflag/src/platform/SDLDisplay.cxx 2013-05-28 16:35:21 UTC (rev 22776)
@@ -610,7 +610,7 @@
}
void SDLWindow::setFullscreen(bool on) {
- ((SDLDisplay *)getDisplay())->setFullscreen(on);
+ const_cast<SDLDisplay *>((const SDLDisplay *)getDisplay())->setFullscreen(on);
}
void SDLWindow::iconify(void) {
@@ -627,11 +627,11 @@
}
void SDLWindow::setSize(int width, int height) {
- ((SDLDisplay *)getDisplay())->setWindowSize(width, height);
+ const_cast<SDLDisplay *>((const SDLDisplay *)getDisplay())->setWindowSize(width, height);
}
void SDLWindow::getSize(int& width, int& height) const {
- ((SDLDisplay *)getDisplay())->getWindowSize(width, height);
+ const_cast<SDLDisplay *>((const SDLDisplay *)getDisplay())->getWindowSize(width, height);
}
void SDLWindow::setGamma(float gamma) {
@@ -691,14 +691,14 @@
}
bool SDLWindow::create(void) {
- if (!((SDLDisplay *)getDisplay())->createWindow()) {
+ if (!const_cast<SDLDisplay *>((const SDLDisplay *)getDisplay())->createWindow()) {
return false;
}
return true;
}
void SDLWindow::enableGrabMouse(bool on) {
- ((SDLDisplay *)getDisplay())->enableGrabMouse(on);
+ const_cast<SDLDisplay *>((const SDLDisplay *)getDisplay())->enableGrabMouse(on);
}
#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|