diff options
author | Kevin Smith <git@kismith.co.uk> | 2013-03-31 15:46:21 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2013-04-05 07:54:55 (GMT) |
commit | a6b61da8e42e996bc7bbe4babc618e3708639936 (patch) | |
tree | 5977063fa6b8ffe2a315317f541009083e15692b | |
parent | 1924342540d855d07eadb564ad997df1345fb115 (diff) | |
download | swift-a6b61da8e42e996bc7bbe4babc618e3708639936.zip swift-a6b61da8e42e996bc7bbe4babc618e3708639936.tar.bz2 |
Silence a couple of warnings
Change-Id: I86569f168987c1b02bd4a45e569b1acffa3f8007
-rw-r--r-- | SwifTools/SpellCheckerFactory.cpp | 8 | ||||
-rw-r--r-- | Swift/Controllers/Chat/ChatControllerBase.cpp | 4 |
2 files changed, 7 insertions, 5 deletions
diff --git a/SwifTools/SpellCheckerFactory.cpp b/SwifTools/SpellCheckerFactory.cpp index d068d90..428e1a5 100644 --- a/SwifTools/SpellCheckerFactory.cpp +++ b/SwifTools/SpellCheckerFactory.cpp @@ -22,18 +22,20 @@ namespace Swift { SpellCheckerFactory::SpellCheckerFactory() { } -SpellChecker* SpellCheckerFactory::createSpellChecker(const std::string& dictFile) { #ifdef HAVE_HUNSPELL +SpellChecker* SpellCheckerFactory::createSpellChecker(const std::string& dictFile) { std::string affixFile(dictFile); boost::replace_all(affixFile, ".dic", ".aff"); if ((boost::filesystem::exists(dictFile)) && (boost::filesystem::exists(affixFile))) { return new HunspellChecker(affixFile.c_str(), dictFile.c_str()); } // If dictionaries don't exist disable the checker + return NULL; +} #elif defined(SWIFTEN_PLATFORM_MACOSX) +SpellChecker* SpellCheckerFactory::createSpellChecker(const std::string& /*dictFile*/) { return new MacOSXChecker(); -#endif - return NULL; } +#endif } diff --git a/Swift/Controllers/Chat/ChatControllerBase.cpp b/Swift/Controllers/Chat/ChatControllerBase.cpp index ad7f76a..39ec8c3 100644 --- a/Swift/Controllers/Chat/ChatControllerBase.cpp +++ b/Swift/Controllers/Chat/ChatControllerBase.cpp @@ -65,8 +65,8 @@ void ChatControllerBase::createDayChangeTimer() { if (timerFactory_) { boost::posix_time::ptime now = boost::posix_time::second_clock::local_time(); boost::posix_time::ptime midnight(now.date() + boost::gregorian::days(1)); - long millisecondsUntilMidnight = (midnight - now).total_milliseconds(); - dateChangeTimer_ = boost::shared_ptr<Timer>(timerFactory_->createTimer(boost::numeric_cast<int>(millisecondsUntilMidnight))); + int millisecondsUntilMidnight = boost::numeric_cast<int>((midnight - now).total_milliseconds()); + dateChangeTimer_ = boost::shared_ptr<Timer>(timerFactory_->createTimer(millisecondsUntilMidnight)); dateChangeTimer_->onTick.connect(boost::bind(&ChatControllerBase::handleDayChangeTick, this)); dateChangeTimer_->start(); } |