Fix some errors reported by clang static analyzer.
parent
a358c040f2
commit
a4c5f10ecf
|
@ -1005,7 +1005,8 @@ void ServerEnvironment::clearAllObjects()
|
||||||
}
|
}
|
||||||
num_blocks_checked++;
|
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 /
|
float percent = 100.0 * (float)num_blocks_checked /
|
||||||
loadable_blocks.size();
|
loadable_blocks.size();
|
||||||
infostream<<"ServerEnvironment::clearAllObjects(): "
|
infostream<<"ServerEnvironment::clearAllObjects(): "
|
||||||
|
|
|
@ -944,12 +944,15 @@ int ObjectRef::l_hud_change(lua_State *L)
|
||||||
case HUD_STAT_DIR:
|
case HUD_STAT_DIR:
|
||||||
e->dir = lua_tonumber(L, 4);
|
e->dir = lua_tonumber(L, 4);
|
||||||
value = &e->dir;
|
value = &e->dir;
|
||||||
|
break;
|
||||||
case HUD_STAT_ALIGN:
|
case HUD_STAT_ALIGN:
|
||||||
e->align = read_v2f(L, 4);
|
e->align = read_v2f(L, 4);
|
||||||
value = &e->align;
|
value = &e->align;
|
||||||
|
break;
|
||||||
case HUD_STAT_OFFSET:
|
case HUD_STAT_OFFSET:
|
||||||
e->offset = read_v2f(L, 4);
|
e->offset = read_v2f(L, 4);
|
||||||
value = &e->offset;
|
value = &e->offset;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
getServer(L)->hudChange(player, id, stat, value);
|
getServer(L)->hudChange(player, id, stat, value);
|
||||||
|
|
Loading…
Reference in New Issue