From b474de4a54c9b1d4d863971e40b807588d554436 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 24 Aug 2012 22:48:35 +0300 Subject: replace defines to consts. --- src/being.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/being.cpp') diff --git a/src/being.cpp b/src/being.cpp index 8ec6f7927..6316c26c3 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -67,7 +67,7 @@ #include "debug.h" -#define CACHE_SIZE 50 +const unsigned int CACHE_SIZE = 50; class BeingCacheEntry { @@ -451,8 +451,8 @@ void Being::setSpeech(const std::string &text, int time) if (!time && mSpeech.size() < 200) time = static_cast(SPEECH_TIME - 300 + (3 * mSpeech.size())); - if (time < SPEECH_MIN_TIME) - time = SPEECH_MIN_TIME; + if (time < static_cast(SPEECH_MIN_TIME)) + time = static_cast(SPEECH_MIN_TIME); // Check for links size_t start = mSpeech.find('['); @@ -486,7 +486,10 @@ void Being::setSpeech(const std::string &text, int time) } if (!mSpeech.empty()) - mSpeechTime = time <= SPEECH_MAX_TIME ? time : SPEECH_MAX_TIME; + { + mSpeechTime = time <= static_cast(SPEECH_MAX_TIME) + ? time : static_cast(SPEECH_MAX_TIME); + } const int speech = mSpeechType; if (speech == TEXT_OVERHEAD && userPalette) -- cgit v1.2.3-60-g2f50