summaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2010-05-13 10:14:29 +0000
committerrubidium <rubidium@openttd.org>2010-05-13 10:14:29 +0000
commit062dd0e24c283f210216ede06bbde0ed72c7ed25 (patch)
treea917e975f1f5d4c144ecad2c799cf58764a1f592 /src/network
parenta2d6961ab3c9aa43b95dfe9fa4699d290e5627e2 (diff)
downloadopenttd-062dd0e24c283f210216ede06bbde0ed72c7ed25.tar.xz
(svn r19814) -Codechange: give some more unnamed enums a name, in case they consisted of unrelated values use static const (u)int
Diffstat (limited to 'src/network')
-rw-r--r--src/network/network_chat_gui.cpp4
-rw-r--r--src/network/network_content_gui.cpp6
-rw-r--r--src/network/network_gamelist.cpp8
-rw-r--r--src/network/network_udp.cpp8
4 files changed, 9 insertions, 17 deletions
diff --git a/src/network/network_chat_gui.cpp b/src/network/network_chat_gui.cpp
index 10ed4e20c..a3c9208cb 100644
--- a/src/network/network_chat_gui.cpp
+++ b/src/network/network_chat_gui.cpp
@@ -35,9 +35,7 @@
* some spaces and possible translations of [All] to other languages. */
assert_compile((int)DRAW_STRING_BUFFER >= (int)NETWORK_CHAT_LENGTH + NETWORK_NAME_LENGTH + 40);
-enum {
- NETWORK_CHAT_LINE_SPACING = 3,
-};
+static const uint NETWORK_CHAT_LINE_SPACING = 3;
struct ChatMessage {
char message[DRAW_STRING_BUFFER];
diff --git a/src/network/network_content_gui.cpp b/src/network/network_content_gui.cpp
index 8f377a0ba..b2b15133c 100644
--- a/src/network/network_content_gui.cpp
+++ b/src/network/network_content_gui.cpp
@@ -225,10 +225,8 @@ enum NetworkContentListWindowWidgets {
class NetworkContentListWindow : public QueryStringBaseWindow, ContentCallback {
typedef GUIList<const ContentInfo*> GUIContentList;
- enum {
- EDITBOX_MAX_SIZE = 50,
- EDITBOX_MAX_LENGTH = 300,
- };
+ static const uint EDITBOX_MAX_SIZE = 50;
+ static const uint EDITBOX_MAX_LENGTH = 300;
/** Runtime saved values */
static Listing last_sorting;
diff --git a/src/network/network_gamelist.cpp b/src/network/network_gamelist.cpp
index 61efe3b79..0ef8b1b2e 100644
--- a/src/network/network_gamelist.cpp
+++ b/src/network/network_gamelist.cpp
@@ -132,11 +132,9 @@ void NetworkGameListRemoveItem(NetworkGameList *remove)
}
}
-enum {
- MAX_GAME_LIST_REQUERY_COUNT = 10, ///< How often do we requery in number of times per server?
- REQUERY_EVERY_X_GAMELOOPS = 60, ///< How often do we requery in time?
- REFRESH_GAMEINFO_X_REQUERIES = 50, ///< Refresh the game info itself after REFRESH_GAMEINFO_X_REQUERIES * REQUERY_EVERY_X_GAMELOOPS game loops
-};
+static const uint MAX_GAME_LIST_REQUERY_COUNT = 10; ///< How often do we requery in number of times per server?
+static const uint REQUERY_EVERY_X_GAMELOOPS = 60; ///< How often do we requery in time?
+static const uint REFRESH_GAMEINFO_X_REQUERIES = 50; ///< Refresh the game info itself after REFRESH_GAMEINFO_X_REQUERIES * REQUERY_EVERY_X_GAMELOOPS game loops
/** Requeries the (game) servers we have not gotten a reply from */
void NetworkGameListRequery()
diff --git a/src/network/network_udp.cpp b/src/network/network_udp.cpp
index 14cab7647..eb4f8b99b 100644
--- a/src/network/network_udp.cpp
+++ b/src/network/network_udp.cpp
@@ -36,11 +36,9 @@ static ThreadMutex *_network_udp_mutex = ThreadMutex::New();
/** Session key to register ourselves to the master server */
static uint64 _session_key = 0;
-enum {
- ADVERTISE_NORMAL_INTERVAL = 30000, // interval between advertising in ticks (15 minutes)
- ADVERTISE_RETRY_INTERVAL = 300, // readvertise when no response after this many ticks (9 seconds)
- ADVERTISE_RETRY_TIMES = 3 // give up readvertising after this much failed retries
-};
+static const uint ADVERTISE_NORMAL_INTERVAL = 30000; ///< interval between advertising in ticks (15 minutes)
+static const uint ADVERTISE_RETRY_INTERVAL = 300; ///< readvertise when no response after this many ticks (9 seconds)
+static const uint ADVERTISE_RETRY_TIMES = 3; ///< give up readvertising after this much failed retries
NetworkUDPSocketHandler *_udp_client_socket = NULL; ///< udp client socket
NetworkUDPSocketHandler *_udp_server_socket = NULL; ///< udp server socket