From: Ilya Zhuravlev Date: Sun, 12 Jan 2014 18:07:35 +0000 (+0400) Subject: Fix some errors reported by clang static analyzer. X-Git-Url: http://81.2.79.47:8989/gitweb/?a=commitdiff_plain;h=a4c5f10ecf4fd49cfbf73580b00c0b4f12ee40cf;p=zefram%2Fminetest%2Fminetest_engine.git Fix some errors reported by clang static analyzer. --- diff --git a/src/environment.cpp b/src/environment.cpp index 034db00d..5249dd9e 100644 --- a/src/environment.cpp +++ b/src/environment.cpp @@ -1005,7 +1005,8 @@ void ServerEnvironment::clearAllObjects() } num_blocks_checked++; - if(num_blocks_checked % report_interval == 0){ + if(report_interval != 0 && + num_blocks_checked % report_interval == 0){ float percent = 100.0 * (float)num_blocks_checked / loadable_blocks.size(); infostream<<"ServerEnvironment::clearAllObjects(): " diff --git a/src/script/lua_api/l_object.cpp b/src/script/lua_api/l_object.cpp index 457d8ea7..6d4ce54f 100644 --- a/src/script/lua_api/l_object.cpp +++ b/src/script/lua_api/l_object.cpp @@ -944,12 +944,15 @@ int ObjectRef::l_hud_change(lua_State *L) case HUD_STAT_DIR: e->dir = lua_tonumber(L, 4); value = &e->dir; + break; case HUD_STAT_ALIGN: e->align = read_v2f(L, 4); value = &e->align; + break; case HUD_STAT_OFFSET: e->offset = read_v2f(L, 4); value = &e->offset; + break; } getServer(L)->hudChange(player, id, stat, value);