summaryrefslogtreecommitdiff
path: root/src/environment.cpp
diff options
context:
space:
mode:
authorLoïc Blot <nerzhul@users.noreply.github.com>2017-04-19 23:02:07 +0200
committerGitHub <noreply@github.com>2017-04-19 23:02:07 +0200
commitf3fe62a0bf9e775b3e6e838f104ab605a2238792 (patch)
tree1335fc9752d54924dd3a8f22e70d555fb54945c8 /src/environment.cpp
parentcfe0291b131630a7400fdcf46b720bd70d8d0fa0 (diff)
downloadminetest-f3fe62a0bf9e775b3e6e838f104ab605a2238792.tar.gz
minetest-f3fe62a0bf9e775b3e6e838f104ab605a2238792.tar.bz2
minetest-f3fe62a0bf9e775b3e6e838f104ab605a2238792.zip
Fix various copy instead of const ref reported by cppcheck (#5615)
* Also remove InventoryList::peekItem unused function * Fix some post increment to preincrement reported by cppcheck
Diffstat (limited to 'src/environment.cpp')
-rw-r--r--src/environment.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/environment.cpp b/src/environment.cpp
index 9c2ea8896..c1aeeec60 100644
--- a/src/environment.cpp
+++ b/src/environment.cpp
@@ -70,7 +70,7 @@ void Environment::setTimeOfDay(u32 time)
{
MutexAutoLock lock(this->m_time_lock);
if (m_time_of_day > time)
- m_day_count++;
+ ++m_day_count;
m_time_of_day = time;
m_time_of_day_f = (float)time / 24000.0;
}
@@ -103,7 +103,7 @@ void Environment::stepTimeOfDay(float dtime)
// Sync at overflow
if (m_time_of_day + units >= 24000) {
sync_f = true;
- m_day_count++;
+ ++m_day_count;
}
m_time_of_day = (m_time_of_day + units) % 24000;
if (sync_f)