|
From: <bul...@us...> - 2013-06-01 06:44:08
|
Revision: 22790
http://sourceforge.net/p/bzflag/code/22790
Author: bullet_catcher
Date: 2013-06-01 06:44:06 +0000 (Sat, 01 Jun 2013)
Log Message:
-----------
Solaris 9 does not have ceilf(), so change the ListServerLink constructor to take a long, change ListServerReAddTime from float to double to better match the way it is used, and then good old ceil() is the correct function to use when calling the refactored constructor.
Modified Paths:
--------------
trunk/bzflag/Xcode/config.h
trunk/bzflag/configure.ac
trunk/bzflag/src/bzfs/ListServerConnection.cxx
trunk/bzflag/src/bzfs/ListServerConnection.h
trunk/bzflag/src/bzfs/bzfs.cxx
Modified: trunk/bzflag/Xcode/config.h
===================================================================
--- trunk/bzflag/Xcode/config.h 2013-05-31 06:45:17 UTC (rev 22789)
+++ trunk/bzflag/Xcode/config.h 2013-06-01 06:44:06 UTC (rev 22790)
@@ -62,9 +62,6 @@
/* Define to 1 if you have the `atexit' function. */
#define HAVE_ATEXIT 1
-/* libm includes ceilf */
-#define HAVE_CEILF 1
-
/* Define to 1 if you have the `CGLGetCurrentContext' function. */
#define HAVE_CGLGETCURRENTCONTEXT 1
Modified: trunk/bzflag/configure.ac
===================================================================
--- trunk/bzflag/configure.ac 2013-05-31 06:45:17 UTC (rev 22789)
+++ trunk/bzflag/configure.ac 2013-06-01 06:44:06 UTC (rev 22790)
@@ -310,7 +310,6 @@
AC_CHECK_LIB([m], [asinf], [AC_DEFINE([HAVE_ASINF],[1],[libm includes asinf])])
AC_CHECK_LIB([m], [atan2f], [AC_DEFINE([HAVE_ATAN2F],[1],[libm includes atan2f])])
AC_CHECK_LIB([m], [atanf], [AC_DEFINE([HAVE_ATANF],[1],[libm includes atanf])])
-AC_CHECK_LIB([m], [ceilf], [AC_DEFINE([HAVE_CEILF],[1],[libm includes ceilf])])
AC_CHECK_LIB([m], [cosf], [AC_DEFINE([HAVE_COSF],[1],[libm includes cosf])])
AC_CHECK_LIB([m], [expf], [AC_DEFINE([HAVE_EXPF],[1],[libm includes expf])])
AC_CHECK_LIB([m], [fabsf], [AC_DEFINE([HAVE_FABSF],[1],[libm includes fabsf])])
Modified: trunk/bzflag/src/bzfs/ListServerConnection.cxx
===================================================================
--- trunk/bzflag/src/bzfs/ListServerConnection.cxx 2013-05-31 06:45:17 UTC (rev 22789)
+++ trunk/bzflag/src/bzfs/ListServerConnection.cxx 2013-06-01 06:44:06 UTC (rev 22790)
@@ -18,7 +18,6 @@
/* system implementation headers */
#include <string.h>
#include <string>
-#include <math.h>
#include <errno.h>
#include <set>
@@ -39,7 +38,7 @@
std::string publicizedAddress,
std::string publicizedTitle,
std::string _advertiseGroups,
- float dnsCache)
+ long dnsCache)
{
std::string bzfsUserAgent = "bzfs ";
@@ -47,7 +46,7 @@
setURLwithNonce(listServerURL);
setUserAgent(bzfsUserAgent);
- setDNSCachingTime((long)ceilf(dnsCache));
+ setDNSCachingTime(dnsCache);
setTimeout(10);
publiclyDisconnected = false;
Modified: trunk/bzflag/src/bzfs/ListServerConnection.h
===================================================================
--- trunk/bzflag/src/bzfs/ListServerConnection.h 2013-05-31 06:45:17 UTC (rev 22789)
+++ trunk/bzflag/src/bzfs/ListServerConnection.h 2013-06-01 06:44:06 UTC (rev 22790)
@@ -32,7 +32,7 @@
// c'tor will fill list and local server information variables and
// do an initial ADD
ListServerLink(std::string listServerURL, std::string publicizedAddress,
- std::string publicizedTitle, std::string advertiseGroups, float dnsCache = 0);
+ std::string publicizedTitle, std::string advertiseGroups, long dnsCache = 0);
// c'tor with no arguments called when we don't want to use a list server.
ListServerLink();
// d'tor will REMOVE server and close connection
Modified: trunk/bzflag/src/bzfs/bzfs.cxx
===================================================================
--- trunk/bzflag/src/bzfs/bzfs.cxx 2013-05-31 06:45:17 UTC (rev 22789)
+++ trunk/bzflag/src/bzfs/bzfs.cxx 2013-06-01 06:44:06 UTC (rev 22790)
@@ -78,10 +78,10 @@
// pass through the SELECT loop
static bool dontWait = true;
-// every ListServerReAddTime server add ourself to the list
+// every ListServerReAddTime seconds add ourself to the list
// server again. this is in case the list server has reset
// or dropped us for some reason.
-static const float ListServerReAddTime = 15.0f * 60.0f;
+static const double ListServerReAddTime = 15 * 60;
static const float FlagHalfLife = 10.0f;
@@ -836,7 +836,8 @@
// list server initialization
for (std::vector<std::string>::const_iterator i = clOptions->listServerURL.begin(); i < clOptions->listServerURL.end(); ++i) {
listServerLink = new ListServerLink(i->c_str(),
- clOptions->publicizedAddress, clOptions->publicizedTitle, clOptions->advertiseGroups, ListServerReAddTime*2.0f); /* recheck dns every other re-add */
+ clOptions->publicizedAddress, clOptions->publicizedTitle, clOptions->advertiseGroups,
+ (long)ceil(ListServerReAddTime * 2)); /* recheck dns every other re-add */
listServerLinksCount++;
}
} else {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|