]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/clientiface.h
make formspec textarea wordwrap
[dragonfireclient.git] / src / clientiface.h
index 13bb45a844888095287a79631afafa881628cf1a..89e0f41b90dd407199989c11a4d12fe4aa579b2e 100644 (file)
@@ -141,6 +141,8 @@ namespace con {
        class Connection;
 }
 
+#define CI_ARRAYSIZE(a) (sizeof(a) / sizeof((a)[0]))
+
 enum ClientState
 {
        Invalid,
@@ -153,7 +155,7 @@ enum ClientState
        Active
 };
 
-static const char** statenames = (const char*[]) {
+static const char* statenames[] = {
        "Invalid",
        "Disconnecting",
        "Denied",
@@ -219,7 +221,6 @@ class RemoteClient
                m_nearest_unsent_d(0),
                m_nearest_unsent_reset_timer(0.0),
                m_excess_gotblocks(0),
-               m_nothing_to_send_counter(0),
                m_nothing_to_send_pause_timer(0.0),
                m_name(""),
                m_version_major(0),
@@ -355,7 +356,6 @@ class RemoteClient
        u32 m_excess_gotblocks;
 
        // CPU usage optimization
-       u32 m_nothing_to_send_counter;
        float m_nothing_to_send_pause_timer;
 
        /*
@@ -433,7 +433,7 @@ class ClientInterface {
        { assert(m_env == 0); m_env = env; }
 
        static std::string state2Name(ClientState state) {
-               assert(state < sizeof(statenames));
+               assert((int) state < CI_ARRAYSIZE(statenames));
                return statenames[state];
        }