From ced6d20295a8263757d57c02a07ffcb66688a163 Mon Sep 17 00:00:00 2001 From: Craig Robbins Date: Fri, 6 Mar 2015 20:21:51 +1000 Subject: For usages of assert() that are meant to persist in Release builds (when NDEBUG is defined), replace those usages with persistent alternatives --- src/clientiface.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/clientiface.h') diff --git a/src/clientiface.h b/src/clientiface.h index 2f265b128..cc303734a 100644 --- a/src/clientiface.h +++ b/src/clientiface.h @@ -426,9 +426,12 @@ public: /* event to update client state */ void event(u16 peer_id, ClientStateEvent event); - /* set environment */ - void setEnv(ServerEnvironment* env) - { assert(m_env == 0); m_env = env; } + /* Set environment. Do not call this function if environment is already set */ + void setEnv(ServerEnvironment *env) + { + assert(m_env == NULL); // pre-condition + m_env = env; + } static std::string state2Name(ClientState state); -- cgit v1.2.3